:root {
  color-scheme: dark;
  --bg: #07100d;
  --panel: #0d1915;
  --panel-2: #12211b;
  --line: #21362d;
  --text: #f2f8f4;
  --muted: #8fa69a;
  --green: #50e3a4;
  --amber: #f5c45b;
  --red: #ff7777;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% 0, rgba(80,227,164,.12), transparent 30rem),
    linear-gradient(145deg, #050b09, var(--bg));
  color: var(--text);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
.hidden { display: none !important; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(13,25,21,.92);
  box-shadow: 0 28px 80px rgba(0,0,0,.35);
}
.brand-mark {
  display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 28px;
  border-radius: 14px; background: var(--green); color: #052417; font-weight: 900;
}
h1 { margin: 0; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.04em; }
.eyebrow { margin: 0 0 7px; color: var(--green); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 800; }
.muted { color: var(--muted); }
label { display: grid; gap: 8px; margin-top: 18px; color: #bed0c6; font-weight: 700; }
input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; background: #09120f; color: var(--text); outline: none;
}
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(80,227,164,.12); }
button {
  border: 0; border-radius: 10px; padding: 11px 15px; cursor: pointer;
  background: var(--green); color: #062017; font-weight: 800;
}
.login-card button { width: 100%; margin-top: 24px; }
.error { min-height: 20px; color: var(--red); }
.dashboard { max-width: 1600px; margin: auto; padding: 34px; }
header { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.secondary { border: 1px solid var(--line); background: transparent; color: var(--text); }
.connection { display: flex; align-items: center; gap: 8px; margin-right: 8px; color: #b9d6c7; }
.connection i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); }
.connection.offline i { background: var(--red); box-shadow: none; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 30px 0 18px; }
.stats article { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.stats span { display: block; color: var(--muted); font-weight: 650; }
.stats strong { display: block; margin-top: 8px; font-size: 27px; letter-spacing: -.04em; }
.table-card { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--panel); }
.history-card { margin-top: 18px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.history-table { min-width: 800px; }
.toolbar { display: flex; justify-content: space-between; gap: 18px; padding: 16px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 6px; }
.tab { padding: 9px 13px; background: transparent; color: var(--muted); }
.tab.active { background: var(--panel-2); color: var(--text); }
.toolbar input { max-width: 360px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 1180px; border-collapse: collapse; }
th { padding: 12px 16px; text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; background: #0a1511; }
td { padding: 17px 16px; border-top: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: rgba(255,255,255,.018); }
.user-name { display: block; font-weight: 800; }
.subtle { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; background: #17271f; color: #b9d6c7; font-size: 11px; font-weight: 800; }
.badge.online { background: rgba(80,227,164,.12); color: var(--green); }
.badge.blocked { background: rgba(255,119,119,.12); color: var(--red); }
.badge.warn { color: var(--amber); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.money { color: var(--green); font-weight: 800; }
.empty { padding: 60px; text-align: center; color: var(--muted); }
footer { display: flex; justify-content: space-between; padding: 13px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
@media (max-width: 850px) {
  .dashboard { padding: 20px; }
  header, .toolbar { align-items: stretch; flex-direction: column; }
  .header-actions { flex-wrap: wrap; }
  .stats { grid-template-columns: 1fr 1fr; }
  .toolbar input { max-width: none; }
}
