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

/* SELF-HOSTED FONTS (public/fonts/*.woff2) — no external font CDN (CSP-ready,
   matches the main site's Inter/JetBrains Mono). */
@font-face { font-family:'Inter'; font-style:normal; font-weight:400; font-display:swap; src:url('/fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:600; font-display:swap; src:url('/fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:700; font-display:swap; src:url('/fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:800; font-display:swap; src:url('/fonts/inter-800.woff2') format('woff2'); }
@font-face { font-family:'JetBrains Mono'; font-style:normal; font-weight:500; font-display:swap; src:url('/fonts/jbmono-500.woff2') format('woff2'); }

: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: 'Inter', 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;
  display: inline-flex;
  align-items: center;
}
/* v12d: real MM2ROLL logo image instead of the text wordmark */
.brand-logo { height: 30px; width: auto; display: block; }
.gate__brand .brand-logo { height: 46px; margin: 0 auto 6px; }
.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; }

.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; }
}

/* --------------------------------------------------------- Roblox bot ----- */
.sober-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 22px;
  align-items: start;
}
.sober-form { max-width: 420px; }
.sober-cookie {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: .04em;
  -webkit-text-security: disc; /* mask like a password field (WebKit/Chromium) */
  text-security: disc;
}
.sober-cookie:focus { -webkit-text-security: disc; }
.sober-actions { display: flex; gap: 10px; margin-top: 2px; }
.sober-note { margin-top: 12px; line-height: 1.5; max-width: 38ch; }

.sober-screen {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 12px;
}
.sober-screen__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.sober-screen__head .hint { font-weight: 700; color: var(--text); }
.sober-screen__frame {
  position: relative;
  background:
    repeating-conic-gradient(#0a0f1c 0% 25%, #0c1220 0% 50%) 50% / 20px 20px,
    #05070f;
  border: 1px solid var(--line);
  border-radius: var(--r-row);
  min-height: 260px;
  aspect-ratio: 16 / 10;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.sober-screen__frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sober-empty { color: var(--muted); font-size: 13px; font-weight: 600; padding: 20px; text-align: center; }
.sober-screen__spacer { flex: 1 1 auto; }
.sober-live-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; color: #fff;
  background: #dc2626; padding: 2px 8px; border-radius: 999px;
  text-transform: uppercase;
}
.sober-live-dot::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: #fff; animation: sober-live-pulse 1.1s ease-in-out infinite;
}
@keyframes sober-live-pulse { 50% { opacity: .25; } }

@media (max-width: 860px) {
  .sober-grid { grid-template-columns: 1fr; }
  .sober-form { max-width: none; }
}

/* --- in-game inventory (OCR) --- */
.sober-inv {
  margin-top: 22px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 16px 18px;
}
.sober-inv__head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.sober-inv__title { font-size: 15px; font-weight: 800; color: var(--text); letter-spacing: .01em; }
.sober-inv__head .hint { font-weight: 700; color: var(--muted); }
.sober-inv__head #sober-inv-refresh { margin-left: auto; }
.sober-inv__note { margin-top: 12px; color: var(--muted-2); }
.sober-inv__cost {
  margin-top: 12px;
  padding: 9px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-row);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
.sober-inv__cost-main { font-weight: 800; color: var(--text); }
.sober-inv__cost-sub { color: var(--muted-2); }
.sober-inv__cost-total { color: var(--muted); font-weight: 700; }

.sober-inv__cats { display: flex; flex-direction: column; gap: 12px; }
.inv-cat {
  padding: 12px 14px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-row);
}
.inv-cat__head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.inv-cat__name {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
}
.inv-cat__count {
  font-size: 11px; font-weight: 800; color: var(--muted-2);
  background: var(--bubble); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 8px; min-width: 20px; text-align: center;
}

/* item-tile grid — dark rounded tile, icon image on top, name below */
.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.inv-grid__empty {
  grid-column: 1 / -1;
  color: var(--muted-2); font-size: 12.5px; font-weight: 600; font-style: italic;
  padding: 2px 2px;
}
.inv-tile {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 8px;
  background: linear-gradient(180deg, var(--panel-2), #0a1020);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
.inv-tile:hover {
  border-color: rgba(76, 154, 255, .55);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.inv-tile__media {
  width: 100%; aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 120% at 50% 22%, rgba(47, 123, 246, .12), transparent 60%),
    #0a1020;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.inv-tile__img {
  width: 100%; height: 100%; object-fit: contain;
  -webkit-user-drag: none; user-select: none;
}
.inv-tile__ph {
  font-size: 22px; font-weight: 800; color: var(--muted-2); letter-spacing: .04em;
}
.inv-tile__name {
  width: 100%;
  font-size: 12px; font-weight: 700; color: var(--text);
  text-align: center; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (max-width: 560px) {
  .inv-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
}

/* --- saved bots (cookie + server stored server-side) --- */
.sober-bots {
  margin-top: 22px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 16px 18px;
}
.sober-bots__head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.sober-bots__title { font-size: 15px; font-weight: 800; color: var(--text); letter-spacing: .01em; }
.sober-bots__head .hint { flex: 1 1 240px; line-height: 1.5; }
.sober-bots__form {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr minmax(160px, 240px) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}
.sober-bots__form .field { margin-bottom: 0; }
.sober-bots__form .sober-cookie { min-height: 52px; }
.sober-bots__actions { display: flex; }
.sober-bots__actions .btn { width: 100%; }

.bots-list { display: flex; flex-direction: column; gap: 10px; }
.bots-empty {
  color: var(--muted-2); font-size: 13px; font-weight: 600; font-style: italic;
  padding: 14px 2px;
}
.bot-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-row);
}
.bot-row--active { border-color: rgba(53, 196, 111, .4); }
.bot-row__info { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 240px; }
.bot-row__label { font-size: 14px; font-weight: 800; color: var(--text); }
.bot-row__sub {
  display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
}
.bot-row__name { font-weight: 700; color: var(--muted); }
.bot-row__server {
  font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  font-size: 11.5px; color: var(--muted-2);
  max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bot-row__acts { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }

@media (max-width: 860px) {
  .sober-bots__form { grid-template-columns: 1fr; }
  .sober-bots__actions .btn { width: auto; }
}

/* --- v9 D6: stuck trades (busy/unconfirmed deposits & withdrawals) --- */
.stuck-trades {
  margin-top: 22px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 16px 18px;
}
.stuck-trades__head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.stuck-trades__title { font-size: 15px; font-weight: 800; color: var(--text); letter-spacing: .01em; }
.stuck-trades__head .hint { font-weight: 700; color: var(--gold-2); }
.stuck-trades__head #stuck-refresh { margin-left: auto; }
.stuck-trades > .hint { margin-top: 10px; line-height: 1.5; }
.stuck-note {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.stuck-acts { white-space: nowrap; }
.stuck-acts .btn + .btn { margin-left: 6px; }

/* ============================== v9 D1 crypto tab ============================== */
.cr-h { margin: 20px 0 10px; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.cr-badge {
  font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line, #1a2138);
}
.cr-badge--ok { color: var(--green, #35c46f); border-color: rgba(53,196,111,.5); background: rgba(53,196,111,.1); }
.cr-badge--bad { color: var(--red, #e14b4b); border-color: rgba(225,75,75,.6); background: rgba(225,75,75,.12); }
.cr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cr-card { background: var(--panel-2, #0e1428); border: 1px solid var(--line, #1a2138); border-radius: 10px; padding: 12px 14px; }
.cr-card h4 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #828ca6); }
.cr-card--gold { border-color: rgba(240,162,29,.45); }
.cr-card--red { border-color: rgba(225,75,75,.55); }
.cr-line { font-size: 12.5px; font-weight: 700; padding: 2px 0; word-break: break-all; }
.cr-line--dim { color: var(--muted-2, #5c6584); font-weight: 600; }
.cr-toolbar { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.cr-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-top: 16px; }
.cr-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; word-break: break-all; max-width: 220px; }
.cr-ta { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; margin: 6px 0; }

/* ==========================================================================
   v9 D3 — Support tab + Vault & transfers card + bot rank badges
   ========================================================================== */

.tab-badge {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--red, #e14b4b);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
  vertical-align: 1px;
}

.sup-subj { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sup-table tr.is-current td { background: rgba(47, 123, 246, .08); }

.sup-detail {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: var(--panel-2, #0e1428);
}
.sup-detail__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sup-detail__head h3 { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-detail__spacer { flex: 1; }
.sup-detail__msgs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 10px;
  padding: 2px;
}
.sup-dmsg {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  max-width: 86%;
  background: var(--bubble, #121a2e);
}
.sup-dmsg--user { align-self: flex-start; border-color: rgba(47, 123, 246, .4); }
.sup-dmsg--admin { align-self: flex-end; border-color: rgba(240, 162, 29, .4); }
.sup-dmsg__who { font-size: 10px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.sup-dmsg__text { font-size: 12.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.sup-detail__composer { display: flex; gap: 8px; align-items: flex-end; }
.sup-detail__composer textarea { flex: 1; resize: vertical; }

.vault { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.vault__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.vault__title { font-size: 14px; }
.vault__head .hint { flex: 1; }
#vault-items .tbl, #tf-table .tbl { margin-top: 6px; }

.bot-row__label { display: flex; align-items: center; gap: 8px; }
.bot-row__held { color: var(--muted-2, #5c6584); font-size: 11px; font-weight: 700; }

.soc-label { flex: 0 0 76px; font-size: 11.5px; font-weight: 700; color: var(--muted); }

/* ==========================================================================
   v9 D4 — admin mobile pass (phones administer emergencies too)
   ========================================================================== */
@media (max-width: 880px) {
  .topbar { padding: 12px 14px; gap: 10px; flex-wrap: wrap; }
  .brand-tag { display: none; }
  .tabs { padding: 10px 12px 0; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 11px 13px 13px; font-size: 12.5px; }
  .content { padding: 16px 12px 60px; }
  .panel__head { flex-wrap: wrap; gap: 10px; }
  .panel__tools { margin-left: 0; flex-wrap: wrap; width: 100%; }
  .panel__tools .inp { flex: 1 1 160px; width: auto; min-width: 0; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card__value { font-size: 24px; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topbar__user { padding: 5px 10px; font-size: 12px; }
}

/* ---------------------------------------------------------------- blog CMS */
.blog-editor { margin-top: 16px; max-width: 780px; }
.blog-editor .field { margin-bottom: 12px; }
.blog-body-ta {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.55; min-height: 320px; resize: vertical; white-space: pre;
}
#blog-table code { font-size: 12px; color: var(--muted); }
#blog-view { margin-left: auto; align-self: center; }
