:root {
  --bg: #090b0f;
  --bg-soft: #10131a;
  --card: #14181f;
  --card-2: #1b2230;
  --card-3: #20293a;
  --accent: #35506f;
  --accent-2: #26384f;
  --text: #e5e8ee;
  --muted: #97a0af;
  --line: rgba(255,255,255,0.08);
  --danger: #db6f7a;
  --success: #74b37d;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', Arial, sans-serif;
  background:
    radial-gradient(circle at top, rgba(38, 56, 79, 0.22), transparent 30%),
    linear-gradient(180deg, #0f1218 0%, var(--bg) 28%, #07090c 100%);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--accent); }
.shell { width: min(1380px, calc(100% - 48px)); margin: 28px auto; }

/* ---- Top bar ---- */
.topbar {
  background: linear-gradient(180deg, rgba(25, 30, 39, 0.96) 0%, rgba(17, 21, 28, 0.98) 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
}
.brand-wrap { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid rgba(123, 145, 172, 0.3);
  display: grid; place-items: center;
  font-size: 22px; font-weight: 800; color: var(--accent);
  background: linear-gradient(180deg, #1a2330 0%, #10151d 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.brand { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.brand-sub { color: #a9b2c0; font-size: 13px; }
.top-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search-box input, select {
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06); color: var(--text);
  padding: 11px 14px; border-radius: 12px; min-width: 200px; font-size: 14px;
  outline: none; transition: border-color .2s;
}
.search-box input:focus, select:focus { border-color: rgba(112, 138, 170, 0.55); }
select option { background: #14181f; }
.btn {
  text-decoration: none; color: var(--text); border: 1px solid var(--line);
  padding: 11px 16px; border-radius: 12px; background: rgba(255,255,255,.04);
  font-size: 14px; cursor: pointer; transition: background .15s;
}
.btn.ghost:hover { background: rgba(255,255,255,.07); }
.user-badge { display: flex; align-items: center; gap: 8px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(123, 145, 172, 0.35); }

/* ---- Nav tabs ---- */
.nav-tabs {
  display: flex; gap: 10px; padding: 12px;
  background: rgba(17, 21, 28, 0.88); border: 1px solid var(--line); border-radius: 16px;
  margin-top: 18px;
}
.tab, .subtab {
  background: rgba(255,255,255,.02); color: var(--text); border: 1px solid rgba(255,255,255,.05);
  border-radius: 12px; padding: 10px 18px; cursor: pointer;
  font-weight: 600; font-size: 14px; transition: all .15s;
}
.tab:hover, .subtab:hover { background: rgba(255,255,255,.05); }
.tab.active, .subtab.active {
  background: linear-gradient(180deg, var(--card-3) 0%, var(--card-2) 100%);
  border-color: rgba(96, 121, 153, 0.42);
  color: #dbe3ee;
}

/* ---- Panel ---- */
.panel {
  background: rgba(17, 21, 28, 0.94); border: 1px solid var(--line);
  border-radius: 16px; margin-top: 18px; padding: 24px;
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.18);
}
.page { display: none; }
.page.active { display: block; }
.page-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.page-head h1 { font-size: 28px; font-weight: 800; }
.page-head p, .notice { color: var(--muted); font-size: 14px; }

/* ---- Table ---- */
.table { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: rgba(255,255,255,.015); }
.table-head, .row {
  display: grid; gap: 12px; align-items: center; padding: 14px 18px;
}
.table-head {
  background: linear-gradient(90deg, #253041, #1d2634);
  font-weight: 700; font-size: 13px; text-transform: uppercase;
  letter-spacing: .5px; color: #d4dce7;
}
.row {
  border-top: 1px solid var(--line);
  font-size: 14px;
  transition: background .12s;
}
.row:hover { background: rgba(255,255,255,.04); }
.row .muted { color: var(--muted); font-size: 12px; margin-top: 2px; }
.row.clickable { cursor: pointer; }

/* Ban table columns */
.ban-grid { grid-template-columns: 160px 1.4fr 1.2fr 1fr 110px; }
/* Ticket table columns */
.ticket-grid { grid-template-columns: 1.3fr 1fr 200px 120px 140px; }
/* Log table columns */
.log-grid { grid-template-columns: 160px 1.2fr 1.4fr 1fr 110px; }

/* ---- Status badge ---- */
.status-badge {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
}
.status-badge.active { background: rgba(219,111,122,.12); color: var(--danger); }
.status-badge.unbanned { background: rgba(116,179,125,.12); color: var(--success); }
.status-badge.expired { background: rgba(181, 145, 82, .16); color: #c6a46d; }
.log-category-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  background: rgba(53,80,111,.18); color: var(--accent);
}

/* ---- Subtabs (log categories) ---- */
.subtabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }

/* ---- Modal ---- */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  display: grid; place-items: center; padding: 20px; z-index: 100;
}
.modal-card {
  width: min(760px, 100%); background: #131820;
  border: 1px solid var(--line); border-radius: 18px;
  padding: 28px; position: relative;
  animation: modalIn .2s ease;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.32);
}
@keyframes modalIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-close {
  position: absolute; top: 14px; right: 14px; border: none;
  background: transparent; color: var(--text); font-size: 30px;
  cursor: pointer; line-height: 1;
}
.details-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 14px; margin-top: 18px;
}
.detail-card {
  padding: 14px; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.025) 0%, rgba(255,255,255,.015) 100%);
}
.detail-card strong { color: var(--muted); font-size: 12px; text-transform: uppercase; display: block; margin-bottom: 4px; }

/* ---- Inline controls ---- */
.inline-controls { display: flex; gap: 12px; align-items: center; }
.inline-controls label { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }

/* ---- Empty state ---- */
.empty-state {
  text-align: center; padding: 48px 20px; color: var(--muted);
  font-size: 15px;
}

/* ---- Hidden ---- */
.hidden { display: none !important; }

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .ban-grid, .ticket-grid, .log-grid { grid-template-columns: 1fr; }
  .page-head, .topbar { flex-direction: column; align-items: stretch; }
  .top-actions { justify-content: stretch; }
  .search-box input, select { min-width: 100%; }
  .details-grid { grid-template-columns: 1fr; }
}
