:root {
  --bg: #0b0a14; --card: #14131f; --card2: #1d1c29; --line: #2a2937; --text: #f4f4f6; --soft: #c9cad1; --dim: #9899a3;
  --green: #21c95e; --red: #ff622e; --blue: #4f9dff; --accent: #516af6; --yellow: #f5c542;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
[hidden] { display: none !important; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 16px; margin: 0; }
.muted { color: var(--dim); }
.small { font-size: 12px; }
.err { color: var(--red); min-height: 1em; margin: 8px 0 0; }
.err:empty { display: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 0 16px 16px; }
.btn {
  border: 1px solid var(--line); background: var(--card2); color: var(--text); border-radius: 10px; padding: 8px 14px;
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #3a3948; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-green { background: var(--green); border-color: var(--green); color: #06050f; }
.btn-on { color: var(--green); border-color: rgba(33, 201, 94, 0.5); background: rgba(33, 201, 94, 0.1); }
input, select {
  background: var(--card2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; margin: 0; display: flex; flex-direction: column; gap: 12px; padding: 24px; }
.login-logo { width: 72px; height: 72px; align-self: center; }
.login-card h1 { text-align: center; margin-bottom: 8px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; color: var(--soft); font-weight: 600; }
.login-card .btn { padding: 10px; margin-top: 4px; }

/* dashboard */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.brand img { width: 40px; height: 40px; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding: 0 16px 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stat b { display: block; font-size: 24px; }
.stat span { color: var(--dim); font-size: 12px; }
.stat.green b { color: var(--green); }
.stat.red b { color: var(--red); }

.bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.bar h2 { margin-right: auto; }
.bar input[type="search"] { min-width: 0; flex: 1 1 220px; max-width: 360px; }
.check { display: flex; align-items: center; gap: 6px; color: var(--soft); cursor: pointer; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--dim); padding: 8px; border-bottom: 1px solid var(--line); vertical-align: bottom; }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.user { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--card2); object-fit: cover; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--dim); font-weight: 700; }
.user b { display: block; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.b-none { color: var(--red); background: rgba(255, 98, 46, 0.12); }
.b-paid { color: var(--green); background: rgba(33, 201, 94, 0.12); }
.b-free { color: var(--blue); background: rgba(79, 157, 255, 0.12); }
.b-referral { color: var(--yellow); background: rgba(245, 197, 66, 0.12); }
.b-launch { color: var(--soft); background: var(--card2); }
.tg { display: block; white-space: nowrap; }
.empty-row td { color: var(--dim); text-align: center; padding: 24px; }
