/* ==========================================================================
   MURDERSPIN — admin panel stylesheet (standalone /admin page)
   Dark, site-matching. Tokens mirror public/style.css §5.
   ========================================================================== */

:root {
  --bg: #05070f;
  --bg-2: #070b16;
  --panel: #0c1120;
  --panel-2: #0e1428;
  --bubble: #121a2e;
  --line: #1a2138;
  --blue: #2f7bf6;
  --blue-2: #2563eb;
  --blue-text: #4c9aff;
  --gold: #f0a21d;
  --gold-2: #ffb020;
  --green: #35c46f;
  --red: #e14b4b;
  --text: #ffffff;
  --muted: #828ca6;
  --muted-2: #5c6584;

  --r-panel: 12px;
  --r-row: 10px;
  --r-btn: 8px;
  --r-chip: 6px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  background:
    radial-gradient(1200px 640px at 50% -220px, rgba(47, 123, 246, .10), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 500;
  min-height: 100vh;
}

::selection { background: rgba(47, 123, 246, .45); }
[hidden] { display: none !important; }
img { max-width: 100%; }
button { font-family: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select { font-family: inherit; color: var(--text); }
code, .mono { font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1c2440; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #273154; }
* { scrollbar-width: thin; scrollbar-color: #1c2440 transparent; }

:focus-visible { outline: 2px solid rgba(76, 154, 255, .6); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* ---------------------------------------------------------------- brand ---- */
.brand {
  font-style: italic;
  font-weight: 900;
  letter-spacing: -.5px;
  user-select: none;
  white-space: nowrap;
  font-size: 24px;
}
.brand .m { color: #fff; }
.brand .s {
  background: linear-gradient(105deg, #6fb0ff 0%, var(--blue) 45%, #2557d6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 6px;
}
.brand-tag {
  display: inline-block;
  margin-left: 10px;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-2);
  background: rgba(240, 162, 29, .12);
  border: 1px solid rgba(240, 162, 29, .35);
  border-radius: var(--r-chip);
  padding: 3px 8px;
  vertical-align: middle;
}

/* --------------------------------------------------------------- buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: var(--r-btn);
  color: #fff;
  transition: filter .15s, transform .08s, box-shadow .15s, background .15s, color .15s;
  user-select: none;
  white-space: nowrap;
}
.btn:hover  { filter: brightness(1.13); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.btn--blue {
  background: linear-gradient(180deg, #3b86f8, var(--blue-2));
  box-shadow: 0 4px 14px rgba(47, 123, 246, .35);
}
.btn--gold {
  background: linear-gradient(180deg, var(--gold-2), #d88a0e);
  box-shadow: 0 4px 14px rgba(240, 162, 29, .3);
  color: #1a1206;
}
.btn--green {
  background: linear-gradient(180deg, #43d47e, #2aa259);
  box-shadow: 0 4px 14px rgba(53, 196, 111, .3);
  color: #04160c;
}
.btn--danger {
  background: linear-gradient(180deg, #ef5a5a, #c53434);
  box-shadow: 0 4px 14px rgba(225, 75, 75, .28);
}
.btn--ghost {
  background: var(--bubble);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn--ghost:hover { color: var(--text); filter: none; background: #1a2440; }
.btn--sm  { padding: 7px 14px; font-size: 12px; }
.btn--xs  { padding: 5px 11px; font-size: 11px; }

/* --------------------------------------------------------------- inputs ---- */
.inp {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 12px;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.inp::placeholder { color: var(--muted-2); }
.inp:focus { border-color: rgba(76, 154, 255, .55); box-shadow: 0 0 0 3px rgba(47, 123, 246, .12); }
.inp--sm { width: 90px; }

/* ============================================================== GATE ======= */
.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.gate__card {
  width: 380px;
  max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65);
  padding: 34px 30px 28px;
  text-align: center;
}
.gate__brand { font-size: 30px; margin-bottom: 4px; }
.gate__sub { color: var(--muted-2); font-size: 12px; font-weight: 700; letter-spacing: .04em; margin-bottom: 24px; }

.field { display: block; text-align: left; margin-bottom: 14px; }
.field__label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}
.gate__err {
  color: #ff9b9b;
  background: rgba(225, 75, 75, .1);
  border: 1px solid rgba(225, 75, 75, .3);
  border-radius: var(--r-btn);
  font-size: 12px;
  font-weight: 700;
  padding: 9px 12px;
  margin-bottom: 14px;
  text-align: left;
}
.gate__actions { margin-top: 4px; }
.gate__actions .btn { width: 100%; }
.gate__foot { margin-top: 18px; font-size: 12px; color: var(--muted-2); }
.gate__foot a { color: var(--blue-text); text-decoration: none; font-weight: 700; }
.gate__foot a:hover { text-decoration: underline; }

.denied__icon { font-size: 40px; margin-bottom: 10px; }
.denied__title { font-size: 20px; font-weight: 900; margin-bottom: 6px; }
.denied__text { color: var(--muted); font-size: 13px; line-height: 1.5; margin-bottom: 20px; }
.denied__who { color: var(--text); font-weight: 800; }

/* ============================================================ DASHBOARD ==== */
.dash { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 17, 32, .9), rgba(7, 11, 22, .7));
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(6px);
}
.topbar__spacer { flex: 1; }
.topbar__user {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 13px;
  color: var(--text);
  background: var(--bubble);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
}
.topbar__user .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.topbar a.link {
  color: var(--muted); font-weight: 800; font-size: 12px; text-decoration: none;
  padding: 8px 12px; border-radius: var(--r-btn);
}
.topbar a.link:hover { color: var(--text); background: var(--bubble); }

.maint-banner {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  background: rgba(240, 162, 29, .12);
  border-bottom: 1px solid rgba(240, 162, 29, .3);
  color: var(--gold-2);
  font-weight: 800; font-size: 12px; letter-spacing: .05em; text-transform: uppercase;
  padding: 8px;
}

/* tabs */
.tabs {
  display: flex;
  gap: 4px;
  padding: 12px 22px 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tab {
  position: relative;
  font-weight: 800;
  font-size: 13px;
  color: var(--muted);
  padding: 12px 18px 14px;
  border-radius: var(--r-btn) var(--r-btn) 0 0;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.tab:hover { color: var(--text); background: rgba(26, 36, 64, .5); }
.tab.is-active { color: #fff; }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--blue), var(--blue-text));
}

.content { flex: 1; padding: 24px 26px 60px; max-width: 1440px; width: 100%; margin: 0 auto; }
.panel { animation: fade-up .22s ease-out; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }

.panel__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.panel__head h2 { font-size: 19px; font-weight: 900; letter-spacing: -.01em; }
.panel__tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.panel__tools .inp { width: 260px; }
.hint { color: var(--muted-2); font-size: 12px; font-weight: 600; }

/* --------------------------------------------------------- stat cards ------ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.stat-card {
  position: relative;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 18px 18px 16px;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--blue);
  opacity: .8;
}
.stat-card--green::before { background: var(--green); }
.stat-card--red::before   { background: var(--red); }
.stat-card--gold::before  { background: var(--gold-2); }
.stat-card__label {
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.stat-card__value { font-size: 30px; font-weight: 900; line-height: 1; letter-spacing: -.02em; }
.stat-card__value .dec { font-weight: 700; opacity: .5; font-size: .7em; }
.stat-card__value .coin { color: var(--gold-2); }
.stat-card__sub { margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.stat-card--gold .stat-card__value { color: var(--gold-2); }
.stat-card--green .stat-card__value { color: #56e08f; }
.stat-card--red .stat-card__value { color: #ff7a7a; }

/* ------------------------------------------------------------- tables ------ */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  overflow: auto;
  background: var(--panel);
}
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
.tbl thead th {
  position: sticky; top: 0;
  background: var(--panel-2);
  text-align: left;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  z-index: 1;
}
.tbl tbody td { padding: 11px 14px; border-bottom: 1px solid rgba(26, 33, 56, .6); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: rgba(26, 36, 64, .4); }
.tbl .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .id { color: var(--muted-2); font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.tbl .uname { font-weight: 800; }
.tbl .email { color: var(--muted); }
.tbl .muted { color: var(--muted-2); }
.tbl .coin-val { color: var(--gold-2); font-weight: 800; }
.tbl-empty { padding: 34px; text-align: center; color: var(--muted-2); font-weight: 700; }

.pager { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.pager .hint { margin: 0 auto; }

/* ------------------------------------------------------------- badges ------ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge--green { color: #6ee6a0; background: rgba(53, 196, 111, .12); border-color: rgba(53, 196, 111, .3); }
.badge--red   { color: #ff8a8a; background: rgba(225, 75, 75, .12); border-color: rgba(225, 75, 75, .32); }
.badge--gold  { color: var(--gold-2); background: rgba(240, 162, 29, .12); border-color: rgba(240, 162, 29, .32); }
.badge--blue  { color: var(--blue-text); background: rgba(47, 123, 246, .14); border-color: rgba(47, 123, 246, .32); }
.badge--gray  { color: var(--muted); background: rgba(130, 140, 166, .1); border-color: rgba(130, 140, 166, .22); }
.badge-row { display: inline-flex; gap: 5px; flex-wrap: wrap; }

/* level pill */
.lv {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; padding: 2px 6px; border-radius: var(--r-chip);
  font-size: 10px; font-weight: 800; color: #fff; flex: none;
}
.lv--gray   { background: #4a5370; }
.lv--green  { background: var(--green); }
.lv--orange { background: #e8862c; }
.lv--red    { background: var(--red); }
.lv--purple { background: #9d5cf0; }

.chat-cell { display: flex; align-items: center; gap: 8px; }
.chat-text { display: block; max-width: 520px; word-break: break-word; }
.chat-text--deleted { color: var(--muted-2); font-style: italic; }

/* ---------------------------------------------------------- settings ------- */
.settings-grid { display: grid; gap: 16px; max-width: 640px; }
.set-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 18px 20px;
}
.set-card h3 { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.set-card p { color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 12px; }
.set-card .inp { max-width: 260px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 46px; height: 26px; border-radius: 999px;
  background: var(--bubble); border: 1px solid var(--line);
  transition: background .18s, border-color .18s; flex: none; position: relative;
}
.switch__track::after {
  content: ""; position: absolute; left: 3px; top: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--muted); transition: transform .18s, background .18s;
}
.switch input:checked + .switch__track { background: rgba(240, 162, 29, .3); border-color: var(--gold-2); }
.switch input:checked + .switch__track::after { transform: translateX(20px); background: var(--gold-2); }
.switch__label { font-weight: 800; font-size: 13px; }

/* ------------------------------------------------------------- modal ------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.modal.is-open { display: flex; }
.modal__scrim {
  position: absolute; inset: 0;
  background: rgba(2, 4, 10, .74);
  backdrop-filter: blur(3px);
  animation: fade-in .16s ease-out;
}
@keyframes fade-in { from { opacity: 0; } }
.modal__panel {
  position: relative; z-index: 1;
  width: 440px; max-width: calc(100vw - 40px); max-height: 92vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65);
  padding: 22px 24px;
  animation: modal-in .16s ease-out;
}
.modal__panel--sm { width: 380px; }
@keyframes modal-in { from { opacity: 0; transform: scale(.93); } }
.modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal__head h2 { font-size: 17px; font-weight: 800; }
.modal__x { width: 32px; height: 32px; font-size: 14px; font-weight: 800; color: var(--muted); border-radius: var(--r-btn); }
.modal__x:hover { color: var(--text); background: var(--bubble); }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.um-meta {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-btn);
  padding: 12px 14px; margin-bottom: 18px;
  font-size: 12px;
}
.um-meta .k { color: var(--muted); font-weight: 700; }
.um-meta .v { color: var(--text); font-weight: 800; margin-left: 5px; }
.um-section { margin-bottom: 18px; }
.um-section:last-child { margin-bottom: 0; }
.um-section h3 {
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.um-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.um-row:last-child { margin-bottom: 0; }
.cf-body { color: var(--muted); font-size: 13px; line-height: 1.55; }
.cf-body b { color: var(--text); }

/* --------------------------------------------------------------- toast ----- */
#toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 500;
  max-width: 360px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--r-row);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .55);
  padding: 14px 18px; font-size: 13px; font-weight: 700; line-height: 1.5;
  display: none;
}
#toast.is-open { display: block; animation: toast-in .22s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
#toast.toast--gold  { border-left-color: var(--gold); }
#toast.toast--green { border-left-color: var(--green); }
#toast.toast--red   { border-left-color: var(--red); }

.spinner { text-align: center; color: var(--muted-2); font-weight: 700; padding: 40px; }

@media (max-width: 640px) {
  .content { padding: 18px 14px 50px; }
  .topbar { padding: 14px 16px; gap: 10px; }
  .panel__tools .inp { width: 160px; }
}
