/* JakePlay Admin — standalone styles (no inline styles or scripts; the site CSP forbids inline script) */
:root {
  --bg: #0c0e16;
  --surface: #161926;
  --surface-hi: #1f2438;
  --border: #363e5c;
  --text: #f1f4fa;
  --muted: #9aa6c4;
  --red: #e5564a;
  --gold: #ffd166;
  --green: #52e069;
  --blue: #6ea8ff;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.err { color: var(--red); margin: 8px 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
h1, h2, h3, h4 { margin: 0 0 8px; }
h1 { font-size: 20px; } h2 { font-size: 18px; } h3 { font-size: 16px; }
h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 22px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.brand { color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: .04em; }
.brand span { color: var(--red); }
.brand em { font-style: normal; color: var(--gold); font-size: 11px; border: 1px solid var(--gold); border-radius: 4px; padding: 1px 6px; margin-left: 6px; }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); }

.btn { font: inherit; color: var(--text); background: var(--surface-hi); border: 1px solid var(--border); border-radius: 6px; padding: 7px 12px; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: #2b5fd9; border-color: #2b5fd9; }
.btn.danger { background: #7a211b; border-color: var(--red); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 3px 8px; font-size: 12px; }

input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 7px 9px; min-width: 0; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
textarea { width: 100%; resize: vertical; min-height: 60px; }
label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 10px; }
label input, label select, label textarea { display: block; width: 100%; margin-top: 4px; font-size: 14px; }

.gate { display: grid; place-items: center; padding: 48px 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; }
.gate-card { width: 100%; max-width: 380px; }

.app { max-width: 1200px; margin: 0 auto; padding: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.tile b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 12px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tab { font: inherit; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 9px 12px; cursor: pointer; white-space: nowrap; }
.tab.active { color: var(--text); border-bottom-color: var(--gold); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters input[type="search"] { flex: 1 1 220px; }
.filters input[type="number"] { width: 90px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th.num, td.num { text-align: right; }
th { color: var(--muted); font-size: 12px; font-weight: 600; background: var(--surface-hi); }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-hi); }
td.empty { text-align: center; color: var(--muted); padding: 24px; }
td.wrap { white-space: normal; }

.pill { display: inline-block; border-radius: 99px; padding: 1px 8px; font-size: 12px; border: 1px solid var(--border); color: var(--muted); }
.pill.active { color: var(--green); border-color: #2f7a3c; }
.pill.suspended { color: var(--gold); border-color: #8a7230; }
.pill.banned { color: var(--red); border-color: #8a3028; }
.pill.premium { color: var(--gold); border-color: #8a7230; }
.pill.admin { color: var(--blue); border-color: #35548a; }

.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 10px; color: var(--muted); }

.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 9; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--surface); border-left: 1px solid var(--border); z-index: 10; display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; }
.drawer-body { padding: 16px; overflow-y: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; margin-top: 14px; }
.meta { color: var(--muted); font-size: 12px; margin-bottom: 12px; overflow-wrap: anywhere; }
.danger-zone { border: 1px solid #8a3028; border-radius: 10px; padding: 12px; margin-top: 8px; }

dialog { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 20px; width: min(420px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--surface-hi); border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; z-index: 30; max-width: calc(100vw - 32px); }
.toast.bad { border-color: var(--red); }

@media (max-width: 560px) {
  .grid2 { grid-template-columns: 1fr; }
}
