:root {
  /* Зелёная палитра админки PureRust */
  --bg: #0a100c;
  --bg-alt: #0f1711;
  --panel: rgba(15, 23, 17, 0.62);
  --panel-border: rgba(31, 157, 84, 0.22);
  --hazard: #1f9d54;
  --hazard-dark: #146c3a;
  --hazard-light: #34d17a;
  --success: #9fc98f;
  --text: #ece1c8;
  --muted: #7d7266;
  --muted-2: #b6a98f;
  --font-display: 'Oswald', 'Segoe UI', Arial, sans-serif;
  --font-body: 'IBM Plex Mono', 'Consolas', monospace;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  position: relative;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(820px 560px at 6% -8%, rgba(31,157,84, 0.28), transparent 60%),
    radial-gradient(720px 520px at 98% 10%, rgba(58,47,39, 0.32), transparent 60%),
    radial-gradient(1000px 760px at 50% 115%, rgba(20,108,58, 0.18), transparent 60%),
    linear-gradient(180deg, #0e0808 0%, #0a0707 40%, #070404 100%);
  filter: blur(2px);
}
html::after {
  content: '';
  position: fixed; inset: 0; z-index: 500; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 45%, transparent 50%, rgba(0,0,0,.62) 100%);
}

::selection { background: var(--hazard); color: #fff; }
a { color: var(--hazard-light); text-decoration: none; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ===== Шапка ===== */
.site-header {
  border-bottom: 1px solid var(--panel-border);
  background: rgba(16, 12, 10, 0.75);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo, .footer-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 1px;
  text-decoration: none;
  display: inline-flex;
  gap: 4px;
}
.logo-rust { color: var(--hazard-light); }
.logo-white { color: var(--text); }
.logo-admin {
  color: var(--muted-2);
  font-size: .75rem;
  align-self: flex-end;
  margin-left: 4px;
  letter-spacing: 2px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 2px 6px;
}
.main-nav a {
  color: var(--muted-2);
  margin-left: 22px;
  font-size: .92rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.main-nav a.active, .main-nav a:hover { color: var(--hazard-light); }

/* ===== Герой / приветствие ===== */
.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  position: relative;
  z-index: 1;
  text-align: center;
}
.hero-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  color: var(--hazard-light);
  font-size: .78rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: var(--panel);
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 1px;
  margin: 0;
}
.hero-subtitle {
  max-width: 560px;
  color: var(--muted-2);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0;
}
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--muted-2);
  font-size: .88rem;
}
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: .85rem;
  border: 1px solid var(--panel-border);
}
.btn-primary {
  background: var(--hazard);
  color: #fff;
  border-color: var(--hazard);
}
.btn-primary:hover { background: var(--hazard-light); }

/* ===== Подвал ===== */
.site-footer {
  border-top: 1px solid var(--panel-border);
  background: rgba(16, 12, 10, 0.75);
  padding: 32px 0;
  position: relative;
  z-index: 1;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.footer-inner p { color: var(--muted-2); margin: 0; max-width: 480px; }
.footer-pill {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  font-size: .82rem;
}
.footer-bottom { color: var(--muted); font-size: .78rem; margin-top: 8px; }

/* ============================================================
   Админ-панель
   ============================================================ */
.admin-body { overflow-x: hidden; }
.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 248px;
  flex-shrink: 0;
  background: rgba(16, 12, 10, 0.85);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-logo {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 10px 18px;
  display: inline-flex;
  gap: 4px;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-group-label {
  margin: 16px 10px 6px;
  font-size: .72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--muted-2);
  font-size: .92rem;
}
.side-link:hover { background: var(--panel); color: var(--text); }
.side-link.active { background: rgba(31,157,84, 0.16); color: var(--hazard-light); }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.side-user {
  border-top: 1px solid var(--panel-border);
  padding: 14px 10px 4px;
  margin-top: 10px;
}
.side-user-name { color: var(--text); font-size: .92rem; font-weight: 600; }
.side-user-role { color: var(--muted); font-size: .76rem; margin-bottom: 8px; }
.side-logout {
  background: none; border: 1px solid var(--panel-border); color: var(--muted-2);
  border-radius: var(--radius); padding: 6px 10px; font-family: var(--font-body);
  font-size: .8rem; cursor: pointer; width: 100%;
}
.side-logout:hover { color: var(--hazard-light); border-color: var(--hazard); }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  padding: 22px 32px 0;
}
.admin-topbar h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 0 4px;
}
.admin-flash {
  display: inline-block; margin-top: 6px; padding: 8px 14px; border-radius: var(--radius);
  background: rgba(159,201,143,.14); border: 1px solid rgba(159,201,143,.4); color: var(--success); font-size: .85rem;
}
.admin-content { padding: 18px 32px 48px; flex: 1; }

.admin-menu-toggle { display: none; }
.admin-sidebar-overlay { display: none; }

/* ===== Мобильная адаптация админ-панели ===== */
@media (max-width: 880px) {
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    max-width: 82vw;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 10px 0 30px rgba(0,0,0,.45);
  }
  .admin-shell.sidebar-open .admin-sidebar { transform: translateX(0); }

  .admin-sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  .admin-shell.sidebar-open .admin-sidebar-overlay { opacity: 1; pointer-events: auto; }

  .admin-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
  }
  .admin-menu-toggle svg { width: 20px; height: 20px; }

  .admin-topbar {
    padding: 14px 14px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
  }
  .admin-topbar h1 { font-size: 1.2rem; }
  .admin-content { padding: 12px 12px 40px; }

  .panel { padding: 14px 14px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }

  /* Широкие таблицы получают собственную горизонтальную прокрутку,
     вместо того чтобы ломать всю страницу */
  table.data-table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.data-table th, table.data-table td { white-space: nowrap; }
}

@media (max-width: 480px) {
  .admin-logo { font-size: .95rem; }
  .admin-topbar h1 { font-size: 1.05rem; }
}

/* ===== Общие блоки панели ===== */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 20px;
}
.panel h2 { margin-top: 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.panel-sub { color: var(--muted-2); font-size: .85rem; margin: -8px 0 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 14px; padding: 16px 18px;
}
.stat-card .num { font-family: var(--font-display); font-size: 1.9rem; color: var(--hazard-light); }
.stat-card .label { color: var(--muted-2); font-size: .82rem; margin-top: 4px; }

table.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data-table th, table.data-table td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--panel-border); vertical-align: middle;
}
table.data-table th { color: var(--muted-2); font-weight: 600; text-transform: uppercase; font-size: .74rem; letter-spacing: .5px; }
table.data-table tr:hover td { background: rgba(31,157,84,0.05); }
.empty-row td { color: var(--muted); text-align: center; padding: 30px; }

.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .74rem; letter-spacing: .3px;
  border: 1px solid var(--panel-border);
}
.badge-green { color: var(--success); border-color: rgba(159,201,143,.4); background: rgba(159,201,143,.1); }
.badge-red { color: #e5766a; border-color: rgba(229,118,106,.4); background: rgba(229,118,106,.1); }
.badge-orange { color: var(--hazard-light); border-color: rgba(31,157,84,.4); background: rgba(31,157,84,.1); }
.badge-grey { color: var(--muted-2); }

.btn-sm { padding: 6px 12px; font-size: .78rem; }
.btn-danger { background: transparent; color: #e5766a; border-color: rgba(229,118,106,.5); }
.btn-danger:hover { background: rgba(229,118,106,.12); }
.btn-ghost { background: transparent; color: var(--muted-2); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted-2); }

form.inline-form { display: inline; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar input[type=text], .form-grid input, .form-grid select, .form-grid textarea {
  background: var(--bg-alt); border: 1px solid var(--panel-border); color: var(--text);
  border-radius: var(--radius); padding: 9px 12px; font-family: var(--font-body); font-size: .88rem;
}
.filter-bar input[type=text] { min-width: 240px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 12px; align-items: end; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; color: var(--muted-2); }

.key-box {
  display: flex; align-items: center; gap: 8px; background: var(--bg-alt); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 8px 12px; font-family: var(--font-body); font-size: .85rem; color: var(--hazard-light);
  max-width: 460px; overflow-x: auto;
}
.key-box-sm {
  max-width: 170px; padding: 6px 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  display: inline-block;
}

/* ===== Компактная таблица (файлопомойка и т.п.) ===== */
table.data-table-compact th, table.data-table-compact td { padding: 6px 10px; font-size: .82rem; }
.file-name-cell {
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-thumb {
  width: 32px; height: 32px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--panel-border); background: var(--bg-alt); display: block;
}
.file-thumb-generic {
  display: flex; align-items: center; justify-content: center; color: var(--muted-2);
}
.file-thumb-generic svg { width: 16px; height: 16px; }
.copy-btn { cursor: pointer; background: none; border: 1px solid var(--panel-border); color: var(--muted-2); border-radius: var(--radius); padding: 5px 10px; font-size: .76rem; }
.copy-btn:hover { color: var(--text); }

.chat-line { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: .86rem; }
.chat-line .chat-name { color: var(--hazard-light); font-weight: 600; margin-right: 6px; }
.chat-line .chat-meta { color: var(--muted); font-size: .74rem; margin-left: 8px; }
.chat-line.is-command { background: rgba(31,157,84,.06); border-left: 2px solid rgba(31,157,84,.5); padding-left: 8px; font-family: 'Consolas', 'Menlo', monospace; }

.notif-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--panel-border); }
.notif-item.unread { color: var(--text); }
.notif-item:not(.unread) { color: var(--muted-2); }

/* ===== Auth (setup/login) ===== */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 16px; padding: 34px 30px; margin: 20px;
}
.auth-logo { justify-content: center; margin-bottom: 18px; }
.auth-title { font-family: var(--font-display); font-size: 1.4rem; margin: 0 0 6px; text-align: center; }
.auth-sub { color: var(--muted-2); font-size: .86rem; text-align: center; margin: 0 0 20px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: .84rem; color: var(--muted-2); }
.auth-form input {
  background: var(--bg-alt); border: 1px solid var(--panel-border); color: var(--text);
  border-radius: var(--radius); padding: 10px 12px; font-family: var(--font-body);
}
.auth-submit { width: 100%; margin-top: 6px; cursor: pointer; }
.auth-error {
  background: rgba(229,118,106,.12); border: 1px solid rgba(229,118,106,.4); color: #e5766a;
  border-radius: var(--radius); padding: 9px 12px; font-size: .84rem; margin-bottom: 16px;
}

.btn { cursor: pointer; }

/* ===== Карточки серверов ===== */
.hidden { display: none !important; }
.server-card {
  background: var(--bg-alt); border: 1px solid var(--panel-border); border-radius: 14px; padding: 16px 18px;
}
.server-card-top { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.server-card-name { font-weight: 600; font-size: 1.02rem; margin-bottom: 2px; }
.server-card-address { color: var(--muted); font-size: .8rem; margin-bottom: 12px; }
.server-card-online-row { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted-2); margin-bottom: 5px; }
.progress-bar { height: 5px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--hazard); border-radius: 999px; }
.server-card-meta { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); margin: 12px 0; }
.server-card-actions { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid var(--panel-border); }

/* ===== Права доступа сотрудников ===== */
.perm-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.perm-tag {
  font-size: .72rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--panel-border); color: var(--muted-2);
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none;
}
.perm-tag input { accent-color: var(--hazard); }
.perm-tag.checked { color: var(--hazard-light); border-color: rgba(31,157,84,.4); background: rgba(31,157,84,.1); }

/* ===== Вкладки настроек ===== */
.tabs-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--panel-border); margin-bottom: 20px; }
.tab-link {
  padding: 9px 16px; font-size: .88rem; color: var(--muted-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-link.active { color: var(--text); border-bottom-color: var(--hazard); }
.tab-link:hover { color: var(--text); }

.info-box {
  background: rgba(31,157,84,0.07); border: 1px solid rgba(31,157,84,0.25); border-radius: 14px;
  padding: 12px 16px; font-size: .84rem; color: var(--muted-2); margin-bottom: 18px;
}

.rule-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--panel-border);
}
.rule-row:last-child { border-bottom: none; }
.rule-row-title { font-size: .9rem; color: var(--text); }
.rule-row-desc { font-size: .78rem; color: var(--muted); margin-top: 2px; }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; cursor: pointer; inset: 0; background: rgba(255,255,255,0.12); border-radius: 999px; transition: .15s;
}
.switch-track::before {
  content: ""; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .15s;
}
.switch input:checked + .switch-track { background: var(--hazard); }
.switch input:checked + .switch-track::before { transform: translateX(18px); }

.broadcast-bar { display: flex; gap: 10px; margin-top: 16px; }
.broadcast-bar input[type=text] { flex: 1; }
.broadcast-bar select { width: auto; }

/* ===== Профиль игрока ===== */
.clickable-row { cursor: pointer; }
.status-dot-sm { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green { background: var(--success); box-shadow: 0 0 6px rgba(159,201,143,.6); }
.dot-grey { background: var(--muted); }

.profile-header { display: flex; align-items: flex-start; gap: 16px; }
.profile-avatar {
  position: relative; width: 64px; height: 64px; border-radius: 16px; overflow: hidden;
  background: var(--bg-alt); border: 1px solid var(--panel-border);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 700; color: var(--hazard-light);
  flex-shrink: 0;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; }
.info-label { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 3px; }

/* ============================================================
   Слайд-панель игрока (зелёная тема, открывается по клику в /admin/players)
   ============================================================ */
:root {
  --pd-bg: #0b0f0d;
  --pd-card: #111815;
  --pd-card-alt: #0d1310;
  --pd-border: rgba(255,255,255,0.07);
  --pd-green: #29c76f;
  --pd-green-light: #4fe08d;
  --pd-green-soft: rgba(41,199,111,0.14);
  --pd-red: #e0554f;
  --pd-red-soft: rgba(224,85,79,0.14);
  --pd-text: #eef2f0;
  --pd-muted: #7c8a83;
  --pd-muted-2: #a7b3ac;
}

.drawer-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(4,6,5,0.66);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 34px 24px;
  overflow-y: auto;
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease;
}
.drawer-overlay.is-open { opacity: 1; pointer-events: auto; }

.player-drawer {
  position: relative;
  width: min(880px, 100%);
  margin: auto;
  background: var(--pd-bg);
  border: 1px solid var(--pd-border);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  color: var(--pd-text);
  font-family: var(--font-body);
  display: flex; flex-direction: column;
  transform: scale(.97) translateY(6px);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
}
.drawer-overlay.is-open .player-drawer { transform: scale(1) translateY(0); opacity: 1; }

.player-drawer .pd-loading,
.player-drawer .pd-error {
  margin: auto; color: var(--pd-muted-2); font-size: .9rem; text-align: center; padding: 40px 20px;
}
.player-drawer .pd-error { color: var(--pd-red); }

.pd-head { padding: 44px 20px 16px; border-bottom: 1px solid var(--pd-border); position: relative; flex-shrink: 0; }
.pd-close {
  position: absolute; top: 10px; left: 14px; background: none; border: none; color: var(--pd-muted-2);
  font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 20px;
}
.pd-close:hover { color: var(--pd-text); background: rgba(255,255,255,0.06); }

.pd-head-top { display: flex; align-items: flex-start; gap: 14px; }
.pd-avatar {
  position: relative; width: 58px; height: 58px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--pd-card-alt); border: 1px solid var(--pd-border);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 700; color: var(--pd-green-light);
}
.pd-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pd-dot {
  position: absolute; bottom: 1px; right: 1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--pd-bg);
}
.pd-dot-green { background: var(--pd-green); box-shadow: 0 0 6px rgba(41,199,111,.7); }
.pd-dot-grey { background: var(--pd-muted); }

.pd-head-info { flex: 1; min-width: 0; }
.pd-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.pd-sub { color: var(--pd-muted); font-size: .8rem; margin-top: 1px; }
.pd-idbtns { display: flex; gap: 8px; margin-top: 10px; }

.pd-pill {
  display: inline-block; background: var(--pd-card); border: 1px solid var(--pd-border); color: var(--pd-muted-2);
  border-radius: 999px; padding: 5px 12px; font-size: .74rem; cursor: pointer; font-family: var(--font-body);
}
.pd-pill:hover { color: var(--pd-text); border-color: var(--pd-green); }

.pd-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.pd-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .72rem;
  border: 1px solid var(--pd-border); white-space: nowrap;
}
.pd-badge-green { color: var(--pd-green-light); border-color: rgba(41,199,111,.4); background: var(--pd-green-soft); }
.pd-badge-red { color: var(--pd-red); border-color: rgba(224,85,79,.4); background: var(--pd-red-soft); }
.pd-badge-grey { color: var(--pd-muted-2); }
.pd-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.pd-actions { display: flex; gap: 10px; margin-top: 16px; }
.pd-actions form { flex: 1; display: flex; }

.pd-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 100%;
  padding: 9px 14px; border-radius: 14px; font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: .5px; font-size: .8rem; border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
.pd-btn-green { background: var(--pd-green); color: #06170d; font-weight: 600; }
.pd-btn-green:hover { background: var(--pd-green-light); }
.pd-btn-red { background: transparent; color: var(--pd-red); border-color: rgba(224,85,79,.5); flex: 1; }
.pd-btn-red:hover { background: var(--pd-red-soft); }
.pd-btn-block { width: 100%; padding: 12px 14px; font-size: .85rem; }

.pd-body {
  padding: 16px 20px 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  align-items: start;
}
.pd-col { min-width: 0; }
.pd-card {
  background: var(--pd-card); border: 1px solid var(--pd-border); border-radius: 16px; padding: 16px;
  margin-bottom: 14px;
}
.pd-card h3 { margin: 0 0 12px; font-family: var(--font-display); font-size: .95rem; font-weight: 600; color: var(--pd-text); }
.pd-card-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pd-card-title-row h3 { margin: 0; }
.pd-link { color: var(--pd-green-light); font-size: .78rem; }
.pd-muted-sm { color: var(--pd-muted); font-size: .78rem; }
.pd-green-text { color: var(--pd-green-light); }
.pd-red-text { color: var(--pd-red); }
.pd-mono { font-family: 'IBM Plex Mono', monospace; font-size: .84rem; }

.pd-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pd-stat {
  background: var(--pd-card-alt); border: 1px solid var(--pd-border); border-radius: 14px; padding: 12px 14px;
}
.pd-stat-num { font-family: var(--font-display); font-size: 1.5rem; color: var(--pd-text); }
.pd-stat-label { color: var(--pd-muted); font-size: .74rem; margin-top: 2px; }

.pd-info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.pd-info-label { font-size: .68rem; color: var(--pd-muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 3px; }
.pd-info-val { font-size: .88rem; color: var(--pd-text); }

.pd-battle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--pd-border);
}
.pd-battle-row:last-child { border-bottom: none; padding-bottom: 0; }
.pd-opponent { color: var(--pd-text); font-size: .88rem; font-weight: 600; }
.pd-opponent:hover { color: var(--pd-green-light); }
.pd-battle-right { text-align: right; min-width: 92px; }
.pd-kd { font-size: .84rem; color: var(--pd-text); margin-bottom: 3px; }
.pd-winrate { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.pd-winrate span { font-size: .78rem; font-weight: 600; }
.pd-progress { width: 46px; height: 4px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.pd-progress-fill { height: 100%; border-radius: 999px; }
.pd-fill-green { background: var(--pd-green); }
.pd-fill-red { background: var(--pd-red); }

.pd-team-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--pd-border);
}
.pd-team-row:last-child { border-bottom: none; padding-bottom: 0; }
.pd-team-name { font-size: .88rem; color: var(--pd-text); margin-bottom: 6px; }
.pd-team-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-tag {
  font-size: .72rem; color: var(--pd-muted-2); background: var(--pd-card-alt); border: 1px solid var(--pd-border);
  border-radius: 999px; padding: 2px 9px;
}

.pd-footer { padding: 16px 20px 20px; }

@media (max-width: 720px) {
  .pd-body { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .drawer-overlay { padding: 10px; }
  .player-drawer { border-radius: 18px; }
  .pd-stat-grid, .pd-info-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Вкладки в карточке игрока (сайдбар слева + контент справа) —
   переключаются на месте, без перехода на другую страницу.
   ============================================================ */
.pd-shell { display: flex; min-height: 0; max-height: 78vh; }
.pd-sidebar {
  position: relative; width: 230px; flex-shrink: 0; padding: 44px 16px 16px; border-right: 1px solid var(--pd-border);
  display: flex; flex-direction: column; overflow-y: auto;
}
.pd-sidebar .pd-head-top { flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.pd-sidebar .pd-avatar { width: 72px; height: 72px; font-size: 1.6rem; }
.pd-sidebar .pd-head-info { width: 100%; }
.pd-sidebar .pd-idbtns { justify-content: center; }

.pd-nav { margin-top: 20px; display: flex; flex-direction: column; gap: 2px; }
.pd-nav-item {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  background: none; border: none; color: var(--pd-muted-2); text-align: left;
  padding: 9px 10px; border-radius: 14px; font-size: .86rem; font-family: var(--font-body); cursor: pointer;
}
.pd-nav-item:hover { color: var(--pd-text); background: rgba(255,255,255,0.04); }
.pd-nav-item.is-active { color: var(--pd-green-light); background: var(--pd-green-soft); font-weight: 600; }
.pd-nav-item .pd-nav-count {
  margin-left: auto; font-size: .7rem; color: var(--pd-muted); background: var(--pd-card-alt);
  border-radius: 999px; padding: 1px 7px;
}

.pd-content { flex: 1; min-width: 0; overflow-y: auto; padding: 20px 20px 16px; }
.pd-content-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.pd-content-head h3 { margin: 0; font-family: var(--font-display); font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.pd-content-head .pd-nav-count { font-size: .74rem; color: var(--pd-muted); background: var(--pd-card-alt); border-radius: 999px; padding: 1px 8px; }

.pd-empty {
  text-align: center; padding: 40px 20px; color: var(--pd-muted-2); background: var(--pd-card);
  border: 1px dashed var(--pd-border); border-radius: 20px;
}
.pd-empty .pd-empty-icon { font-size: 1.6rem; margin-bottom: 10px; opacity: .6; }
.pd-empty .pd-empty-title { font-weight: 600; color: var(--pd-text); margin-bottom: 4px; }
.pd-empty .pd-empty-sub { font-size: .82rem; margin-bottom: 14px; }
.pd-empty .pd-btn { display: inline-flex; width: auto; padding: 9px 22px; }

.pd-list-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--pd-border);
}
.pd-list-row:last-child { border-bottom: none; }
.pd-list-title { font-size: .88rem; color: var(--pd-text); font-weight: 600; }
.pd-list-sub { font-size: .78rem; color: var(--pd-muted); margin-top: 2px; }
.pd-list-right { text-align: right; flex-shrink: 0; }

.pd-perm-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--pd-border);
}
.pd-perm-row:last-child { border-bottom: none; }
.pd-perm-title { font-size: .87rem; color: var(--pd-text); }
.pd-perm-sub { font-size: .76rem; color: var(--pd-muted); margin-top: 2px; }
.pd-perm-group-label { font-size: .7rem; color: var(--pd-muted); text-transform: uppercase; letter-spacing: .5px; margin: 18px 0 4px; }

.pd-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.pd-switch input { opacity: 0; width: 0; height: 0; }
.pd-switch-slider {
  position: absolute; inset: 0; background: var(--pd-card-alt); border: 1px solid var(--pd-border);
  border-radius: 999px; cursor: pointer; transition: background .15s ease;
}
.pd-switch-slider::before {
  content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%;
  background: var(--pd-muted-2); transition: transform .15s ease, background .15s ease;
}
.pd-switch input:checked + .pd-switch-slider { background: var(--pd-green-soft); border-color: var(--pd-green); }
.pd-switch input:checked + .pd-switch-slider::before { transform: translateX(18px); background: var(--pd-green); }
.pd-switch input:disabled + .pd-switch-slider { opacity: .45; cursor: not-allowed; }

@media (max-width: 720px) {
  .pd-shell { flex-direction: column; max-height: none; }
  .pd-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--pd-border); flex-direction: row; flex-wrap: wrap; align-items: center; }
  .pd-sidebar .pd-head-top { flex-direction: row; text-align: left; }
  .pd-nav { flex-direction: row; flex-wrap: wrap; width: 100%; margin-top: 12px; }
}

/* ===== Аватарки и колонка «Действия» в таблицах (Репорты / Проверки / Кланы) ===== */
.table-person { display: flex; align-items: center; gap: 10px; }
.table-avatar {
  width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--bg-alt); border: 1px solid var(--panel-border);
  display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; color: var(--hazard-light);
}
.table-avatar img { width: 100%; height: 100%; object-fit: cover; }
.table-avatar.is-admin { color: var(--muted-2); }
.table-person-name { font-weight: 600; color: var(--text); }
.table-person-name a { color: inherit; }
.table-person-name a:hover { color: var(--hazard-light); }
.table-sub { color: var(--muted); font-size: .74rem; margin-top: 1px; }
.table-sub-accent { color: var(--hazard-light); font-size: .74rem; margin-top: 1px; }

.badge-icon { margin-right: 4px; display: inline-block; }
.badge-stack { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }

.action-icons { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: var(--radius); border: 1px solid var(--panel-border); background: transparent;
  color: var(--muted-2); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { color: var(--text); border-color: var(--hazard); background: rgba(31,157,84,.08); }
.icon-btn svg { width: 15px; height: 15px; }

.date-cell .table-sub { margin-top: 3px; }

/* ===== Вкладка "Чат" — заголовок в духе мессенджера ===== */
.chat-page-header {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  margin-bottom: 18px;
}
.chat-header-left { display: flex; align-items: center; gap: 12px; }
.chat-icon-box {
  width: 42px; height: 42px; border-radius: 16px; flex-shrink: 0;
  background: rgba(31,157,84,.14); border: 1px solid var(--panel-border);
  display: flex; align-items: center; justify-content: center; color: var(--hazard-light);
}
.chat-icon-box svg { width: 20px; height: 20px; }
.chat-header-left h1 { margin: 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.chat-header-left p { margin: 2px 0 0; color: var(--muted); font-size: .82rem; }
.chat-header-right { display: flex; align-items: center; gap: 10px; position: relative; flex-wrap: wrap; }
.chat-search-btn { border-radius: 50%; }
.chat-select {
  background: var(--bg-alt); border: 1px solid var(--panel-border); color: var(--text);
  border-radius: 999px; padding: 8px 16px; font-family: var(--font-body); font-size: .82rem; cursor: pointer;
}
.chat-search-box {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 5;
  background: var(--bg-alt); border: 1px solid var(--panel-border); border-radius: var(--radius); padding: 8px;
}
.chat-search-box input { width: 260px; }
.chat-search-box.hidden { display: none; }

.chat-panel {
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 20px;
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-list { max-height: 62vh; overflow-y: auto; padding: 10px 0; }
.chat-date-sep {
  text-align: center; margin: 18px 0 10px; position: relative; color: var(--muted); font-size: .72rem;
  text-transform: uppercase; letter-spacing: 1px;
}
.chat-date-sep::before, .chat-date-sep::after {
  content: ''; position: absolute; top: 50%; width: calc(50% - 60px); height: 1px; background: var(--panel-border);
}
.chat-date-sep::before { left: 0; }
.chat-date-sep::after { right: 0; }

.chat-row { display: flex; align-items: center; gap: 10px; padding: 7px 20px; font-size: .87rem; }
.chat-row:hover { background: rgba(31,157,84,.05); }
.chat-time { flex-shrink: 0; width: 58px; color: var(--muted); font-size: .74rem; }
.chat-server-tag {
  flex-shrink: 0; background: var(--bg-alt); border: 1px solid var(--panel-border); border-radius: 20px;
  padding: 2px 7px; font-size: .64rem; color: var(--muted-2); letter-spacing: .3px; white-space: nowrap;
}
.chat-channel-dot {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(31,157,84,.14); color: var(--hazard-light);
}
.chat-msg-avatar {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; overflow: hidden;
  background: var(--bg-alt); border: 1px solid var(--panel-border);
  display: flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 700; color: var(--hazard-light);
}
.chat-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-msg-name { font-weight: 600; color: var(--text); flex-shrink: 0; }
.chat-msg-text { color: var(--muted-2); word-break: break-word; }
.chat-msg-text.is-cmd { color: var(--hazard-light); font-family: 'Consolas', 'Menlo', monospace; }

.chat-composer {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--panel-border);
}
.chat-composer input[type=text] {
  flex: 1; background: var(--bg-alt); border: 1px solid var(--panel-border); border-radius: 999px;
  padding: 11px 16px; color: var(--text); font-family: var(--font-body); font-size: .88rem;
}
.chat-send-btn { border-radius: 999px; display: inline-flex; align-items: center; gap: 7px; padding: 10px 20px; flex-shrink: 0; }

/* ============================================================
   Сайт поддержки (поддомен tickets.<домен>) — соцкнопки, форма тикета
   ============================================================ */
.social-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
}
.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-display);
  font-size: .85rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  transition: border-color .15s ease, color .15s ease, transform .15s ease;
}
.social-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.social-btn:hover { transform: translateY(-1px); }
.social-discord:hover { color: #8ea1e1; border-color: #8ea1e1; }
.social-telegram:hover { color: #6ec2e8; border-color: #6ec2e8; }
.social-vk:hover { color: #7fa8d8; border-color: #7fa8d8; }

.social-contact-line {
  color: var(--muted-2);
  font-size: .88rem;
  max-width: 480px;
  margin: 4px auto 0;
  text-align: center;
}

.ticket-confirm {
  border: 1px solid rgba(159,201,143,.4);
  background: rgba(159,201,143,.1);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 24px 0;
  color: var(--text);
}
.ticket-confirm-title { font-family: var(--font-display); color: var(--success); font-size: 1.05rem; margin-bottom: 4px; }
.ticket-confirm p { margin: 0; color: var(--muted-2); }
.ticket-confirm-error { border-color: rgba(229,118,106,.4); background: rgba(229,118,106,.1); }
.ticket-confirm-error p { color: #e5766a; }

.ticket-form { display: grid; grid-template-columns: 1fr; gap: 16px; }
.ticket-form label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--muted-2); }
.ticket-form input, .ticket-form select, .ticket-form textarea {
  background: var(--bg-alt); border: 1px solid var(--panel-border); color: var(--text);
  border-radius: var(--radius); padding: 11px 14px; font-family: var(--font-body); font-size: .92rem; resize: vertical;
}
.ticket-form .req { color: var(--hazard-light); }

/* ===== Согласие на обработку ПДн в форме тикета ===== */
.consent-row {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .82rem; color: var(--muted-2); line-height: 1.45;
}
.consent-row input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px; accent-color: var(--hazard);
  flex-shrink: 0; cursor: pointer;
}
.consent-row a { color: var(--hazard-light); text-decoration: underline; }
.consent-row label { display: block; cursor: pointer; }

/* ===== Юридические страницы (политика, соглашение, cookie) ===== */
.legal-page { max-width: 860px; margin: 0 auto; padding: 50px 20px 70px; }
.legal-page h1 {
  font-family: var(--font-display); font-size: 1.6rem; margin-bottom: 6px;
}
.legal-updated { color: var(--muted); font-size: .8rem; margin-bottom: 30px; }
.legal-page h2 {
  font-family: var(--font-display); font-size: 1.1rem; margin: 34px 0 12px;
  color: var(--hazard-light);
}
.legal-page p, .legal-page li { color: var(--muted-2); font-size: .93rem; line-height: 1.7; }
.legal-page ul, .legal-page ol { padding-left: 22px; }
.legal-page li { margin-bottom: 6px; }
.legal-page strong { color: var(--text); }
.legal-fill {
  background: rgba(229,118,106,.1); border: 1px dashed rgba(229,118,106,.5);
  color: #e5766a; padding: 2px 6px; border-radius: 4px; font-size: .85em;
}
.legal-links { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; margin: 10px 0 4px; }
.legal-links a { color: var(--muted-2); font-size: .8rem; }
.legal-links a:hover { color: var(--hazard-light); }
.legal-links button.linklike {
  background: none; border: none; padding: 0; font: inherit; color: var(--muted-2);
  font-size: .8rem; cursor: pointer; text-decoration: none;
}
.legal-links button.linklike:hover { color: var(--hazard-light); }

/* ===== Cookie-баннер ===== */
#cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 999;
  background: rgba(10, 16, 12, 0.97); border-top: 1px solid var(--panel-border);
  backdrop-filter: blur(10px);
  padding: 18px 20px; display: none;
}
#cookie-banner.is-visible { display: block; }
#cookie-banner .container {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; justify-content: space-between;
}
#cookie-banner .cookie-text { flex: 1 1 420px; font-size: .85rem; color: var(--muted-2); line-height: 1.55; }
#cookie-banner .cookie-text a { color: var(--hazard-light); text-decoration: underline; }
#cookie-banner .cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
#cookie-banner .btn { white-space: nowrap; }

#cookie-reopen {
  position: fixed; left: 18px; bottom: 18px; z-index: 998;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--panel-border);
  display: none; align-items: center; justify-content: center; cursor: pointer;
  color: var(--hazard-light);
}
#cookie-reopen.is-visible { display: flex; }
#cookie-reopen svg { width: 22px; height: 22px; }
@media (max-width: 640px) {
  #cookie-banner .container { flex-direction: column; align-items: stretch; }
  #cookie-banner .cookie-actions { justify-content: stretch; }
  #cookie-banner .cookie-actions .btn { flex: 1; }
}
