:root {
  --bg: #0f1419;
  --panel: #1a212b;
  --panel-2: #222c38;
  --border: #2c3848;
  --text: #e6edf3;
  --muted: #8b98a6;
  --accent: #4c9aff;
  --in: #3fb950;
  --out: #f85149;
  --transfer: #d29922;
  --balance: #58a6ff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

nav.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
nav.topbar .brand { font-weight: 700; color: var(--text); }
nav.topbar .spacer { flex: 1; }
nav.topbar .user { color: var(--muted); }
nav.topbar form { margin: 0; display: inline; }

main { padding: 20px; max-width: 1400px; margin: 0 auto; }
h1, h2, h3 { font-weight: 600; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 18px;
}

form.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
form.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
input, select, button, textarea {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 14px;
}
button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}
button.secondary { background: var(--panel-2); border-color: var(--border); color: var(--text); }
button:hover { filter: brightness(1.08); }

table { border-collapse: collapse; width: 100%; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: right; }
th:first-child, td:first-child { text-align: left; }
thead th { color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--border); position: sticky; top: 0; background: var(--panel); }
tr.subtotal td { font-weight: 600; background: var(--panel-2); }
tr.grand td { font-weight: 700; background: var(--panel-2); border-top: 2px solid var(--accent); }
td.in { color: var(--in); }
td.out { color: var(--out); }
td.transfer { color: var(--transfer); }
td.balance { color: var(--balance); }
.geo-group { border-left: 2px solid var(--border); }

.metric-cols th { font-size: 11px; }
.num { font-variant-numeric: tabular-nums; }

.login-wrap { max-width: 360px; margin: 80px auto; }
.error { color: var(--out); margin: 8px 0; }
.muted { color: var(--muted); }
.badge { padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.badge.ok { background: rgba(63,185,80,.15); color: var(--in); }
.badge.bad { background: rgba(248,81,73,.15); color: var(--out); }
canvas { max-width: 100%; }
.chart-box { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 18px; }
