:root {
  --bg: #0b0f14;
  --panel: #131a22;
  --panel-2: #1a232e;
  --line: #243040;
  --text: #e8eef5;
  --muted: #8a9aae;
  --accent: #34d399;
  --accent-ink: #052e1f;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 50% -200px, #12302a 0%, var(--bg) 60%) fixed;
  color: var(--text);
  font: 16px/1.45 var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.wrap { max-width: 920px; margin: 0 auto; padding: 20px 18px 60px; }
.narrow { max-width: 460px; }

/* top bar */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: .2px; }
.brand svg { width: 28px; height: 28px; color: var(--accent); }
.brand img { width: 30px; height: 30px; border-radius: 8px; display: block; }
.brand small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--line);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--accent); box-shadow: 0 0 10px var(--accent); }

/* panels */
.card {
  background: linear-gradient(180deg, var(--panel) 0%, #10161d 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card + .card { margin-top: 14px; }
.grid > .card { margin-top: 0; }
h1 { font-size: 28px; margin: 0 0 6px; letter-spacing: -.3px; }
h2 { font-size: 15px; margin: 0 0 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* forms */
input, select {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  font: inherit; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }

button, .btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  padding: 11px 16px; border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
button:hover, .btn:hover { border-color: #38506a; }
button:active, .btn:active { transform: scale(.97); }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.primary:hover { border-color: #6ee7b7; background: #4ade9f; }
.danger { color: var(--bad); }
.sm { padding: 6px 10px; font-size: 13px; border-radius: 10px; }

/* tables / lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 2px; border-bottom: 1px solid var(--line);
}
.list li:last-child { border-bottom: 0; }
.amt { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.amt.plus { color: var(--accent); }
.amt.minus { color: var(--text); }
.tag {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
  white-space: nowrap;
}
.tag.ok { color: var(--accent); border-color: #1f5a45; }
.tag.bad { color: var(--bad); border-color: #5a2626; }
.tag.wait { color: var(--warn); border-color: #5a4a1f; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tile { text-decoration: none; display: block; transition: border-color .15s ease, transform .1s ease; }
.tile:hover { border-color: #2f6b55; transform: translateY(-2px); }
.tile .ico { font-size: 26px; margin-bottom: 8px; }
.tile b { display: block; font-size: 18px; margin-bottom: 4px; }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: #1f2a36; border: 1px solid var(--line); color: var(--text);
  padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.toast.show { opacity: 1; }
.toast.err { border-color: #7f2a2a; color: #fecaca; }

.empty { padding: 24px 0; text-align: center; color: var(--muted); }

@media (max-width: 520px) {
  .wrap { padding: 14px 12px 40px; }
  h1 { font-size: 24px; }
}
