:root {
  color-scheme: dark;
  font-family: "Rajdhani", "Arial Narrow", sans-serif;
  font-synthesis: none;
  color: #fff;
  background: #0d0d10;
  --accent: #ff9a3d;
  --ink: #0c0c0e;
  --panel: #141418;
  --line: rgba(255,255,255,.08);
  --muted: rgba(255,255,255,.55);
  --green: #5be584;
  --red: #ff5a67;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: #0d0d10; color: #fff; font-size: 16px; font-weight: 500; }
button, input, select { color: inherit; font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 22px 16px; border-right: 1px solid var(--line); background: var(--panel); }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 16px; text-decoration: none; }
.brand .logo { width: 42px; height: 42px; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 20px; letter-spacing: .04em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.nav-label { margin: 0 12px -16px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .18em; }
.sidebar nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 9px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 16px; font-weight: 600; text-align: left; }
.nav-item i { width: 22px; color: inherit; font-size: 17px; font-style: normal; text-align: center; }
.nav-item b { margin-left: auto; color: inherit; font-size: 13px; font-variant-numeric: tabular-nums; }
.nav-item:hover { background: rgba(255,255,255,.04); color: #fff; }
.nav-item.active { background: rgba(255,154,61,.12); color: var(--accent); box-shadow: inset 3px 0 var(--accent); }
.sidebar-footer { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.sidebar-footer b { margin-left: auto; color: var(--green); }
.live-dot, .status i, .page-footer i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px rgba(91,229,132,.7); }
.workspace { min-width: 0; }
.topbar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 32px; border-bottom: 1px solid var(--line); background: rgba(20,20,24,.72); }
.breadcrumb { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.breadcrumb span { margin: 0 7px; color: var(--accent); }
.account { display: flex; align-items: center; gap: 12px; }
.account > b { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.status i { width: 7px; height: 7px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 9px; background: var(--accent); color: var(--ink); font-weight: 700; }
.logout { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.04); color: var(--muted); }
.logout:hover { border-color: rgba(255,154,61,.5); color: #fff; }
.content { max-width: 1700px; margin: 0 auto; padding: 28px 32px 20px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .2em; }
h1 { margin: 5px 0 0; font-size: 34px; line-height: 1; letter-spacing: .04em; }
h1 em { color: var(--accent); font-style: normal; }
.page-heading p, .panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 15px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 14px; border: 0; border-radius: 9px; background: var(--accent); color: var(--ink); font-size: 14px; font-weight: 700; letter-spacing: .06em; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { border: 1px solid var(--line); background: rgba(255,255,255,.06); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { display: grid; gap: 3px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.kpi small { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.kpi strong { font-size: 34px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 14px; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 21px; letter-spacing: .04em; }
.updated { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.filters { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.045); color: var(--muted); }
.search > span { font-size: 20px; }
.search input { width: 100%; min-width: 0; min-height: 39px; border: 0; outline: 0; background: transparent; color: #fff; }
.search input::placeholder { color: var(--muted); }
.select-wrap select { min-height: 41px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #18181c; color: #fff; }
.table-wrap { max-height: calc(100vh - 390px); min-height: 240px; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { position: sticky; top: 0; z-index: 1; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #17171b; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .13em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 15px; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255,255,255,.025); }
.event-title { display: block; font-size: 16px; font-weight: 700; }
.event-message { display: block; max-width: 680px; margin-top: 2px; color: var(--muted); font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; white-space: pre-wrap; }
.category { display: inline-block; padding: 3px 8px; border-radius: 6px; background: rgba(255,154,61,.12); color: var(--accent); font-size: 12px; font-weight: 700; white-space: nowrap; }
.category.webhook { background: rgba(90,169,255,.13); color: #7cc4ff; }
.category.security { background: rgba(255,90,103,.13); color: var(--red); }
.player { display: block; font-weight: 600; }
.player small { display: block; color: var(--muted); font-size: 12px; }
.time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty-state { display: grid; justify-items: center; gap: 5px; padding: 42px 16px; color: var(--muted); text-align: center; }
.empty-state strong { color: #fff; font-size: 18px; }
.empty-state p { margin: 0; font-size: 14px; }
.panel-footer { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.notice { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; }
.notice.error { border-color: rgba(255,90,103,.4); background: rgba(255,90,103,.08); color: #ffb4bb; }
#load-error { margin: 12px 16px; }
.page-footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.page-footer span:last-child { display: inline-flex; align-items: center; gap: 7px; }
.page-footer i { width: 6px; height: 6px; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 15%, rgba(255,154,61,.13), transparent 42rem), var(--ink); }
.login-card { position: relative; width: min(420px, 100%); padding: 34px 32px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); text-align: center; }
.login-card::before { position: absolute; top: -1px; right: 32px; left: 32px; height: 2px; background: var(--accent); box-shadow: 0 0 14px var(--accent); content: ""; }
.login-card .logo { display: block; width: 60px; height: 60px; margin: 0 auto 12px; object-fit: contain; }
.login-card h1 { margin: 8px 0 10px; font-size: 25px; }
.login-card p { margin: 0 0 20px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.btn.discord { width: 100%; min-height: 46px; }
.btn.disabled { width: 100%; background: rgba(255,255,255,.1); color: var(--muted); cursor: not-allowed; }
.setup-hint { display: block; margin-top: 12px; color: var(--muted); font-size: 13px; }
code { padding: 2px 5px; border-radius: 5px; background: rgba(255,255,255,.08); color: var(--accent); font-family: Consolas, monospace; font-size: .9em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 1050px) {
  .shell { grid-template-columns: 210px minmax(0, 1fr); }
  .content { padding: 22px 20px 16px; }
  .topbar { padding: 12px 20px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-wrap { max-height: none; }
}
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; gap: 12px; padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 4px; }
  .brand .logo { width: 34px; height: 34px; }
  .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar-footer { display: none; }
  .topbar { min-height: 54px; padding: 8px 14px; }
  .breadcrumb { font-size: 10px; }
  .account { gap: 7px; }
  .account .status { display: none; }
  .account > b { max-width: 90px; font-size: 14px; }
  .avatar { width: 30px; height: 30px; }
  .logout { padding: 6px 7px; font-size: 12px; }
  .content { padding: 18px 12px; }
  .page-heading { align-items: flex-start; }
  h1 { font-size: 29px; }
  .page-heading p { max-width: 260px; font-size: 13px; }
  .btn.ghost { padding: 8px 10px; }
  .btn.ghost span { display: none; }
  .stats { gap: 8px; }
  .kpi { padding: 12px; }
  .kpi strong { font-size: 28px; }
  .kpi small { font-size: 10px; letter-spacing: .08em; }
  .kpi span { font-size: 12px; }
  .panel-heading { align-items: flex-start; padding: 13px; }
  .panel-heading h2 { font-size: 19px; }
  .updated { max-width: 130px; text-align: right; }
  .filters { padding: 10px; }
  .select-wrap select { padding: 0 8px; }
  .table-wrap { overflow-x: auto; }
  table { min-width: 680px; }
  th, td { padding: 9px 10px; }
  .panel-footer, .page-footer { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
