:root {
  color-scheme: dark;
  --bg: #0b0c0e;
  --surface: #111317;
  --surface-2: #16191e;
  --surface-3: #1b1f25;
  --line: #272c34;
  --line-strong: #343a44;
  --text: #f4f4f2;
  --muted: #858b94;
  --gold: #f5b82e;
  --gold-soft: #2b2414;
  --green: #52d18c;
  --red: #f06060;
  --blue: #65a7f7;
  --sidebar: 248px;
  font-family: Inter, Manrope, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font-size: 14px; letter-spacing: -.01em; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 20; display: flex; flex-direction: column; padding: 24px 18px; background: #0e1013; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; background: var(--gold); color: #111; font-size: 24px; font-weight: 900; transform: skew(-7deg); border: 1px solid #ffd76d; box-shadow: 0 8px 26px rgba(245,184,46,.14); }
.brand b, .brand small { display: block; line-height: 1; }
.brand b { font-size: 16px; letter-spacing: .16em; }
.brand small { margin-top: 6px; color: var(--muted); font-size: 9px; letter-spacing: .28em; }

.scope-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #090a0c; border: 1px solid #20242a; }
.scope-switch a { padding: 10px 7px; text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; transition: .18s ease; }
.scope-switch a span { display: none; }
.scope-switch a.active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 -2px var(--gold); }

.nav-list { margin-top: 28px; display: grid; gap: 5px; }
.nav-label { padding: 0 10px 8px; color: #60656d; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.nav-list a { position: relative; padding: 13px 12px; color: #a6abb2; border: 1px solid transparent; font-weight: 650; transition: .16s ease; }
.nav-list a small { float: right; color: #555b64; font-size: 10px; font-weight: 600; text-transform: uppercase; }
.nav-list a:hover { background: #14171b; color: #fff; }
.nav-list a.active { color: #fff; background: var(--surface-2); border-color: var(--line); }
.nav-list a.active::before { content: ""; position: absolute; left: -19px; top: 10px; bottom: 10px; width: 3px; background: var(--gold); }
.nav-list a.active small { color: var(--gold); }
.sidebar-foot { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid var(--line); }
.connection-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.connection-state i, .status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(82,209,140,.6); }
.logout-button { width: 100%; margin-top: 14px; padding: 10px; color: #a9adb4; background: transparent; border: 1px solid var(--line); cursor: pointer; }
.logout-button:hover { color: #fff; border-color: var(--line-strong); }

.content { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 38px; border-bottom: 1px solid var(--line); background: rgba(11,12,14,.94); }
.topbar strong, .topbar .context-label { display: block; }
.topbar strong { margin-top: 3px; font-size: 14px; }
.context-label { color: var(--gold); font-size: 9px; font-weight: 850; letter-spacing: .16em; }
.operator { display: flex; align-items: center; gap: 12px; color: #b7bbc1; font-size: 12px; }
.operator i { width: 34px; height: 34px; display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--line-strong); color: var(--gold); font-style: normal; font-weight: 800; }
.mobile-menu { display: none; color: #fff; background: transparent; border: 0; font-size: 23px; cursor: pointer; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 44px 38px 28px; }
.eyebrow { display: block; margin-bottom: 10px; color: var(--gold); font-size: 10px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
.page-head h1 { margin-bottom: 8px; font-size: clamp(28px, 3vw, 44px); line-height: 1; letter-spacing: -.045em; }
.page-head p, .panel-head p, .modal-card > p { margin-bottom: 0; color: var(--muted); }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 0 38px 18px; }
.stat-card { position: relative; min-height: 146px; padding: 22px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.stat-card::after { content: ""; position: absolute; right: -24px; bottom: -36px; width: 100px; height: 100px; border: 18px solid currentColor; opacity: .035; transform: rotate(18deg); }
.stat-card > span { color: #555b64; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.stat-card strong { display: block; margin-top: 20px; font-size: 29px; line-height: 1; letter-spacing: -.035em; }
.stat-card p { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.tone-gold { color: var(--gold); } .tone-green { color: var(--green); } .tone-red { color: var(--red); } .tone-blue { color: var(--blue); }
.stat-card strong, .stat-card p { color: var(--text); }
.stat-card p { color: var(--muted); }

.panel { margin: 0 38px 38px; background: var(--surface); border: 1px solid var(--line); }
.panel-head, .panel-tools { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin-bottom: 4px; font-size: 17px; }
.panel-head p { font-size: 11px; }
.panel-head a { color: var(--gold); font-size: 12px; font-weight: 700; }
.search-form { display: flex; align-items: center; gap: 8px; width: min(620px, 100%); }
.search-form input { flex: 1; min-width: 150px; height: 40px; padding: 0 13px; color: #fff; background: #0d0f12; border: 1px solid var(--line); outline: 0; }
.search-form input:focus { border-color: #806522; box-shadow: 0 0 0 3px rgba(245,184,46,.07); }
.search-form button, .search-form a { height: 40px; display: inline-grid; place-items: center; padding: 0 15px; border: 1px solid var(--line-strong); background: var(--surface-3); color: #ddd; cursor: pointer; }
.search-form a { color: var(--muted); }
.record-count { flex: 0 0 auto; color: var(--muted); font-size: 11px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 13px 16px; color: #737982; background: #0e1013; border-bottom: 1px solid var(--line); text-align: left; font-size: 9px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
td { max-width: 340px; padding: 14px 16px; color: #c9ccd1; border-bottom: 1px solid #20242a; font-size: 12px; }
td > span:not(.badge) { display: block; max-width: 330px; overflow: hidden; text-overflow: ellipsis; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #15181c; }
.cell-text { min-width: 360px; }
.cell-u_b_reason { min-width: 200px; }
.muted { color: #565c64; }
.numeric { color: #fff; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid; font-size: 10px; font-weight: 750; }
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-positive { color: var(--green); border-color: rgba(82,209,140,.25); background: rgba(82,209,140,.06); }
.badge-danger { color: var(--red); border-color: rgba(240,96,96,.28); background: rgba(240,96,96,.06); }
.badge-neutral { color: #838a94; border-color: #30353d; background: #181b20; }
.empty-state { height: 180px; color: var(--muted); text-align: center; }

.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--line); }
.pagination a { padding: 8px 12px; background: var(--surface-3); border: 1px solid var(--line-strong); font-size: 11px; }
.pagination span { color: var(--muted); font-size: 11px; }
.pagination .disabled { pointer-events: none; opacity: .35; }

.button { min-height: 42px; padding: 0 18px; border: 1px solid; font-weight: 800; cursor: pointer; transition: transform .15s ease, filter .15s ease; }
.button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.button-primary { color: #17130a; background: var(--gold); border-color: #ffd263; }
.button-danger { color: #fff; background: #c53f43; border-color: #e26165; }
.button-wide { width: 100%; }
.alert { margin: 0 38px 18px; padding: 13px 16px; border: 1px solid; font-size: 12px; }
.alert-error { color: #ff9c9c; background: #211214; border-color: #54282b; }
.alert-success { color: #87e3ae; background: #102019; border-color: #23513a; }

.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 20px; }
.modal.open { display: grid; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.78); backdrop-filter: blur(4px); }
.modal-card { position: relative; z-index: 1; width: min(590px, 100%); padding: 28px; background: #121419; border: 1px solid #353b44; box-shadow: 0 30px 90px rgba(0,0,0,.52); }
.modal-card h2 { margin-bottom: 8px; font-size: 26px; letter-spacing: -.03em; }
.modal-card > p { max-width: 500px; line-height: 1.55; }
.modal-card code { color: var(--gold); }
.modal-close { position: absolute; top: 15px; right: 15px; width: 34px; height: 34px; color: var(--muted); background: #191c21; border: 1px solid var(--line); cursor: pointer; font-size: 22px; }
.ban-form { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 24px; }
.ban-form label, .login-form label { display: grid; gap: 8px; color: #aeb2b9; font-size: 11px; font-weight: 700; }
.ban-form input, .login-form input { width: 100%; height: 45px; padding: 0 13px; color: #fff; background: #0c0e11; border: 1px solid var(--line-strong); outline: 0; }
.ban-form input:focus, .login-form input:focus { border-color: #957322; box-shadow: 0 0 0 3px rgba(245,184,46,.07); }
.field-wide { grid-column: 1 / -1; }
.date-preview { align-self: end; height: 45px; display: flex; align-items: center; justify-content: space-between; padding: 0 13px; background: #171a1f; border: 1px solid var(--line); }
.date-preview span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.date-preview strong { color: var(--gold); font-size: 11px; }
.modal-open { overflow: hidden; }

.login-page { min-height: 100vh; background: #090a0c; }
.login-page::before { content: ""; position: fixed; inset: 0; pointer-events: none; background-image: linear-gradient(#17191d 1px, transparent 1px), linear-gradient(90deg, #17191d 1px, transparent 1px); background-size: 54px 54px; mask-image: linear-gradient(to bottom, rgba(0,0,0,.38), transparent 76%); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { position: relative; width: min(430px, 100%); padding: 34px; background: #111317; border: 1px solid #2a2f36; box-shadow: 0 28px 80px rgba(0,0,0,.38); }
.brand-login { padding: 0 0 38px; border-bottom: 1px solid var(--line); }
.login-copy { padding: 34px 0 24px; }
.login-copy h1 { margin-bottom: 10px; font-size: 31px; letter-spacing: -.04em; }
.login-copy p { color: var(--muted); line-height: 1.55; }
.login-form { display: grid; gap: 16px; }
.login-page .alert { margin: 0 0 18px; }
.security-note { margin-top: 22px; color: #656b74; font-size: 10px; text-align: center; }
.security-note .status-dot { margin-right: 6px; }

@media (max-width: 1050px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 50px rgba(0,0,0,.45); }
  .sidebar.open { transform: translateX(0); }
  .content { margin-left: 0; }
  .topbar { height: 66px; padding: 0 18px; }
  .mobile-menu { display: block; }
  .topbar > div:first-of-type { margin-right: auto; margin-left: 12px; }
  .operator span { display: none; }
  .page-head { align-items: flex-start; padding: 32px 18px 22px; }
  .stats-grid { padding: 0 18px 14px; }
  .panel { margin: 0 18px 24px; }
  .alert { margin-left: 18px; margin-right: 18px; }
  .panel-tools { align-items: flex-start; flex-direction: column; }
  .record-count { align-self: flex-end; }
}
@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 120px; }
  .page-head { flex-direction: column; }
  .page-head .button { width: 100%; }
  .search-form { flex-wrap: wrap; }
  .search-form input { flex-basis: 100%; }
  .ban-form { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .modal-card { padding: 24px 18px 20px; }
  .login-card { padding: 26px 22px; }
}

/* ---------- Reports / game logs (views tickets, gamelogs) ---------- */
.badge-warn { color: var(--gold); border-color: rgba(245,184,46,.28); background: rgba(245,184,46,.07); }
.badge-info { color: var(--blue); border-color: rgba(101,167,247,.28); background: rgba(101,167,247,.07); }
.badge-violet { color: #b99cf7; border-color: rgba(185,156,247,.28); background: rgba(185,156,247,.07); }
.rl-nav-label { margin-top: 18px; }
.rl-nav-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-style: normal; font-weight: 800; vertical-align: 1px; }
.search-form select, .rl-reply select { height: 40px; padding: 0 10px; color: #ddd; background: #0d0f12; border: 1px solid var(--line); outline: 0; font: inherit; }
.search-form select:focus { border-color: #806522; }
.rl-filters { width: min(860px, 100%); }
.rl-table tbody tr[data-href] { cursor: pointer; }
.rl-table tr.rl-unanswered td:first-child { box-shadow: inset 3px 0 var(--gold); }
.rl-id { color: var(--gold); font-weight: 800; }
.rl-open { color: var(--gold); font-size: 11px; font-weight: 700; }
.rl-offender { color: #ff9c9c; font-weight: 700; }
.rl-dot { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 8px; border-radius: 50%; background: var(--red); color: #fff; font-size: 10px; font-weight: 900; }
td.rl-reason-cell { max-width: 280px; }
td.rl-reason-cell > span { max-width: 270px; color: #8e949c; font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 11px; }
.rl-cats { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 38px 18px; }
.rl-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; color: #b7bbc1; background: var(--surface); border: 1px solid var(--line); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: .15s ease; }
.rl-chip b { color: #fff; font-variant-numeric: tabular-nums; }
.rl-chip:hover { border-color: var(--line-strong); color: #fff; }
.rl-chip.active { color: #fff; background: var(--surface-3); border-color: var(--gold); box-shadow: inset 0 -2px var(--gold); }
.rl-chip[disabled] { cursor: default; }
.rl-chip-crash b { color: var(--red); } .rl-chip-freeze b { color: var(--blue); } .rl-chip-control b { color: var(--gold); } .rl-chip-bug b { color: #b99cf7; }
.rl-back { padding: 0 38px 14px; }
.rl-back a { color: var(--gold); font-size: 12px; font-weight: 700; }
.rl-detail { display: grid; grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); gap: 0; margin: 0 38px 38px; align-items: start; }
.rl-detail > .panel { margin: 0; min-width: 0; }
.rl-detail > .panel + .panel { border-left: 0; }
.rl-meta { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; margin: 0; padding: 18px 20px; border-bottom: 1px solid var(--line); font-size: 12px; }
.rl-meta dt { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding-top: 2px; }
.rl-meta dd { margin: 0; color: #d6d9dd; overflow-wrap: anywhere; }
.rl-reason { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 11px; color: #f3d48a; }
.rl-reason a { margin-left: 6px; color: var(--gold); font-family: inherit; text-decoration: underline; }
.rl-block { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.rl-block:last-child { border-bottom: 0; }
.rl-text { margin: 0; color: #d6d9dd; line-height: 1.55; overflow-wrap: anywhere; }
.rl-photo { display: block; border: 1px solid var(--line); background: #0d0f12; }
.rl-photo img { display: block; width: 100%; max-height: 320px; object-fit: contain; background: #090a0c; }
.rl-photo span { display: block; padding: 8px 10px; color: var(--gold); font-size: 11px; font-weight: 700; }
.rl-status-row, .rl-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rl-status-row form, .rl-actions form { margin: 0; }
.rl-btn-link { display: inline-grid; place-items: center; }
.rl-inline-alert { margin: 0; }
.rl-thread { display: grid; gap: 10px; padding: 18px 20px; max-height: 560px; overflow-y: auto; border-bottom: 1px solid var(--line); }
.rl-msg { max-width: 82%; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); }
.rl-msg header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; font-size: 12px; }
.rl-msg header time { margin-left: auto; color: #5f656d; font-size: 10px; }
.rl-msg p { margin: 0; color: #d6d9dd; line-height: 1.5; overflow-wrap: anywhere; }
.rl-msg-admin { justify-self: end; background: var(--gold-soft); border-color: rgba(245,184,46,.35); }
.rl-msg-admin header b { color: var(--gold); }
.rl-role { color: var(--gold); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.rl-sys { justify-self: center; padding: 5px 10px; color: var(--muted); font-size: 10px; border: 1px dashed var(--line-strong); }
.rl-reply { display: grid; gap: 12px; padding: 18px 20px; }
.rl-reply label { display: grid; gap: 8px; color: #aeb2b9; font-size: 11px; font-weight: 700; }
.rl-reply textarea { width: 100%; padding: 11px 13px; color: #fff; background: #0c0e11; border: 1px solid var(--line-strong); outline: 0; font: inherit; resize: vertical; }
.rl-reply textarea:focus { border-color: #957322; box-shadow: 0 0 0 3px rgba(245,184,46,.07); }
.rl-reply-row { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rl-reply-row label { min-width: 220px; }
.rl-log-label { padding: 12px 20px 0; color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.rl-log { position: relative; margin: 0; padding: 12px 0; max-height: 720px; overflow: auto; background: #0a0b0d; color: #c3c7cc; font: 11px/1.55 Consolas, "SFMono-Regular", Menlo, monospace; white-space: pre; }
.rl-line { display: block; padding: 0 16px 0 0; }
.rl-line i { display: inline-block; width: 56px; margin-right: 12px; padding-right: 8px; color: #4a4f57; font-style: normal; text-align: right; border-right: 1px solid #1d2026; user-select: none; }
.rl-line.rl-head { color: #8e949c; }
.rl-line.rl-hl { background: rgba(240,96,96,.16); color: #fff; box-shadow: inset 3px 0 var(--red); }
.rl-line.rl-hl i { color: var(--red); }
@media (max-width: 1100px) {
  .rl-detail { grid-template-columns: minmax(0, 1fr); }
  .rl-detail > .panel + .panel { border-left: 1px solid var(--line); border-top: 0; }
}
@media (max-width: 760px) {
  .rl-cats, .rl-back { padding-left: 18px; padding-right: 18px; }
  .rl-detail { margin: 0 18px 24px; }
  .rl-meta { grid-template-columns: 1fr; gap: 4px; }
  .rl-meta dd { margin-bottom: 8px; }
  .rl-msg { max-width: 100%; }
}
td > span.rl-dot { display: inline-grid; vertical-align: 1px; }
