:root {
  color-scheme: dark;
  --ink: #f2f6f0;
  --muted: #9ca89f;
  --dim: #68736c;
  --canvas: #0b0f0d;
  --panel: #121815;
  --panel-2: #18201c;
  --panel-3: #202a24;
  --line: rgba(221, 235, 221, 0.12);
  --line-strong: rgba(221, 235, 221, 0.22);
  --signal: #b8ef75;
  --signal-ink: #13200c;
  --info: #7eb7ff;
  --warn: #f4bd64;
  --danger: #ff767f;
  --radius: 10px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 20%, rgba(184,239,117,.1), transparent 28%), linear-gradient(120deg, #0b0f0d 0 60%, #101a14); }
.login-card { width: min(460px, 100%); padding: 34px; border: 1px solid var(--line-strong); border-radius: 14px; background: rgba(18,24,21,.94); box-shadow: var(--shadow); }
.brand-lockup, .staff-card { display: flex; align-items: center; gap: 12px; }
.brand-lockup div, .staff-card div { display: grid; gap: 2px; }
.brand-lockup small, .staff-card small { color: var(--muted); }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 9px; color: var(--signal-ink); background: var(--signal); font-weight: 900; }
.login-card .brand-lockup { margin-bottom: 48px; }
.eyebrow { margin: 0 0 8px; color: var(--signal); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(30px, 4vw, 46px); line-height: 1.04; letter-spacing: -.04em; }
h2 { margin-bottom: 8px; font-size: 23px; letter-spacing: -.025em; }
h3 { font-size: 15px; }
.login-copy { margin-bottom: 28px; color: var(--muted); line-height: 1.55; }
.security-note { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; line-height: 1.5; }
.stack-form { display: grid; gap: 15px; }
label > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 650; }
input, select, textarea { width: 100%; min-height: 43px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; color: var(--ink); background: #0d1210; outline: none; }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--signal); box-shadow: 0 0 0 3px rgba(184,239,117,.1); }

.button { min-height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 14px; background: var(--panel-3); cursor: pointer; font-weight: 720; }
.button:hover { filter: brightness(1.08); }
.button:disabled { cursor: not-allowed; opacity: .42; }
.button.primary { border-color: transparent; color: var(--signal-ink); background: var(--signal); }
.button.subtle { background: transparent; }
.button.danger { border-color: rgba(255,118,127,.42); color: #ffdadd; background: rgba(255,118,127,.1); }
.button.warn { border-color: rgba(244,189,100,.36); color: #ffdda6; background: rgba(244,189,100,.08); }
.form-status { min-height: 20px; margin: 0; color: var(--danger); font-size: 13px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 248px; display: flex; flex-direction: column; border-right: 1px solid var(--line); padding: 22px 14px 16px; background: #0e1311; }
.sidebar-brand { padding: 0 8px 22px; }
.sidebar nav { display: grid; gap: 4px; }
.nav-item { display: grid; gap: 2px; width: 100%; border: 1px solid transparent; border-radius: 8px; padding: 10px 12px; background: transparent; text-align: left; cursor: pointer; }
.nav-item span { font-weight: 720; }
.nav-item small { color: var(--dim); }
.nav-item:hover { background: var(--panel); }
.nav-item.active { border-color: rgba(184,239,117,.18); color: var(--signal); background: rgba(184,239,117,.07); }
.sidebar-footer { margin-top: auto; display: grid; gap: 14px; padding: 16px 8px 0; border-top: 1px solid var(--line); }
.staff-card > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--signal-ink); background: var(--signal); font-weight: 850; }
.workspace { min-height: 100vh; margin-left: 248px; padding: 24px 30px 60px; background: radial-gradient(circle at 84% -10%, rgba(126,183,255,.07), transparent 26%), var(--canvas); }
.workspace-topline { min-height: 30px; display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-bottom: 22px; color: var(--dim); font-size: 12px; }
.health-pill { border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; color: var(--muted); }
.health-pill.ok { color: var(--signal); }
.health-pill.error { color: var(--danger); }
.mobile-header { display: none; }

.page-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.page-header p:not(.eyebrow) { margin: 0; color: var(--muted); }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(145px, 1fr)); gap: 10px; margin-bottom: 22px; }
.metric-card { min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--panel); }
.metric-card strong { font-size: 32px; letter-spacing: -.04em; }
.metric-card span { color: var(--muted); font-size: 12px; }
.metric-card small { color: var(--dim); }
.metric-card.signal { border-color: rgba(184,239,117,.24); background: linear-gradient(140deg, rgba(184,239,117,.11), var(--panel)); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(270px, .8fr); gap: 14px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-header h2, .panel-header h3 { margin: 0; }
.panel-body { padding: 18px; }
.notice { border-left: 3px solid var(--info); padding: 13px 14px; color: var(--muted); background: rgba(126,183,255,.07); line-height: 1.45; }
.notice.warn { border-color: var(--warn); background: rgba(244,189,100,.07); }
.notice.danger { border-color: var(--danger); background: rgba(255,118,127,.07); }

.toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 210px auto; gap: 10px; margin-bottom: 14px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--dim); background: #0f1512; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
td { color: #dce4dd; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: rgba(184,239,117,.035); }
.cell-title { display: grid; gap: 3px; }
.cell-title strong { color: var(--ink); }
.cell-title small { color: var(--dim); }
.badge { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 8px; color: var(--muted); font-size: 11px; }
.badge.role-admin, .badge.role-super { color: var(--warn); border-color: rgba(244,189,100,.3); }
.badge.role-moderator { color: var(--info); border-color: rgba(126,183,255,.3); }
.badge.severity-critical { color: var(--danger); }
.badge.severity-high { color: var(--warn); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; color: var(--muted); font-size: 13px; }
.empty-state { padding: 44px 20px; text-align: center; color: var(--muted); }
.skeleton { min-height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 50%, var(--panel) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.feedback-list, .game-list, .audit-list, .provider-list { display: grid; gap: 9px; }
.feedback-item, .game-item, .audit-item, .provider-item { border: 1px solid var(--line); border-radius: 9px; padding: 14px; background: var(--panel); }
.feedback-top, .game-top, .provider-item { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.feedback-item p { margin: 12px 0; color: #d6ded7; line-height: 1.5; white-space: pre-wrap; }
.feedback-meta, .muted { color: var(--dim); font-size: 12px; }
.game-item { display: grid; gap: 12px; }
.game-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.game-metrics div { padding: 9px; border-radius: 7px; background: var(--panel-2); }
.game-metrics strong, .game-metrics small { display: block; }
.game-metrics small { color: var(--dim); margin-top: 2px; }
.provider-item strong { display: block; }
.provider-item small { color: var(--dim); }
.switch { position: relative; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 20px; background: #344039; cursor: pointer; transition: .18s; }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 50%; background: #d8dfd9; transition: .18s; }
.switch input:checked + span { background: #7aab49; }
.switch input:checked + span::after { transform: translateX(20px); }

.dialog-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(3,6,4,.74); backdrop-filter: blur(7px); }
.dialog { width: min(720px, 100%); max-height: min(860px, calc(100vh - 40px)); overflow: auto; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.dialog > header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 20px; padding: 20px; border-bottom: 1px solid var(--line); background: rgba(18,24,21,.96); }
.dialog > header h2 { margin: 0; }
#dialogBody { padding: 20px; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: transparent; cursor: pointer; font-size: 24px; }
.detail-grid, .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.detail-block { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.detail-block h3 { margin-bottom: 10px; }
.inline-list { display: grid; gap: 7px; }
.inline-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px; border-radius: 7px; background: var(--panel-2); }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.danger-zone { margin-top: 22px; border: 1px solid rgba(255,118,127,.25); border-radius: 9px; padding: 15px; background: rgba(255,118,127,.045); }
.danger-zone h3 { color: #ffdadd; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: grid; gap: 8px; }
.toast { width: min(390px, calc(100vw - 40px)); border: 1px solid var(--line-strong); border-radius: 9px; padding: 13px 15px; background: var(--panel-3); box-shadow: var(--shadow); }
.toast.error { border-color: rgba(255,118,127,.45); }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { position: sticky; top: 0; z-index: 15; height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid var(--line); background: rgba(11,15,13,.94); backdrop-filter: blur(10px); }
  .menu-button { border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; background: transparent; }
  .mobile-header span { color: var(--muted); font-size: 11px; }
  .workspace { margin-left: 0; padding: 18px 14px 44px; }
  .workspace-topline { display: none; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { grid-template-columns: 1fr; }
  .detail-grid, .form-grid { grid-template-columns: 1fr; }
  .table-wrap { border: 0; overflow: visible; }
  table, tbody, tr, td { display: block; }
  thead { display: none; }
  tbody { display: grid; gap: 9px; }
  tbody tr { border: 1px solid var(--line); border-radius: 9px; padding: 12px; background: var(--panel); }
  tbody td { display: flex; justify-content: space-between; gap: 14px; border: 0; padding: 7px 0; white-space: normal; }
  tbody td::before { content: attr(data-label); color: var(--dim); font-size: 11px; text-transform: uppercase; }
}
@media (max-width: 440px) {
  .login-card { padding: 24px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 112px; }
  .metric-card strong { font-size: 27px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
