:root {
  --red: #E50914;
  --bg: #0F1117;
  --surface: #1A1D24;
  --surface2: #22252E;
  --line: #2b2f3a;
  --text: #F8F9FA;
  --muted: #8E95A3;
  --green: #2ecc71;
  --amber: #f1c40f;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-decoration: none; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.center { max-width: 420px; margin: 8vh auto; padding: 0 16px; }

.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; letter-spacing: .3px; }
.brand .dot { width: 12px; height: 12px; border-radius: 3px; background: var(--red); }
.brand .logo { height: 34px; width: auto; display: block; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.card + .card { margin-top: 16px; }

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 14px; }
.sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }

label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 5px; }
input, select {
  width: 100%;
  padding: 11px 12px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
input:focus, select:focus { border-color: var(--red); }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

button {
  cursor: pointer;
  border: none;
  border-radius: 9px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  background: var(--surface2);
  color: var(--text);
  transition: filter .15s, opacity .15s;
}
button:hover { filter: brightness(1.15); }
button:disabled { opacity: .5; cursor: default; }
button.primary {
  background: linear-gradient(180deg, #ff2b36, var(--red));
  color: #fff;
  box-shadow: 0 6px 18px -6px rgba(229, 9, 20, .7);
}
button.primary:hover { box-shadow: 0 8px 22px -6px rgba(229, 9, 20, .85); }
button.ghost { background: transparent; border: 1px solid var(--line); }
button.sm { padding: 6px 10px; font-size: 12px; }
button.danger { background: transparent; border: 1px solid #5a2b2f; color: #ff6b6b; }

.btnbar { display: flex; gap: 10px; margin-top: 18px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.topbar .right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat {
  background: linear-gradient(160deg, var(--surface2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 20px;
  transition: transform .15s, border-color .15s;
}
.stat:hover { transform: translateY(-2px); border-color: #3a3f4d; }
.stat .l { font-size: 12px; color: var(--muted); margin: 0 0 6px; text-transform: none; letter-spacing: .2px; }
.stat .n { font-size: 32px; font-weight: 800; line-height: 1; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
td .mac { font-family: ui-monospace, monospace; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.pill.active { background: rgba(46,204,113,.15); color: var(--green); }
.pill.expired { background: rgba(241,196,15,.15); color: var(--amber); }
.pill.banned { background: rgba(231,76,60,.15); color: #ff6b6b; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input { max-width: 280px; }
.grow { flex: 1; }

.msg { font-size: 13px; margin-top: 12px; min-height: 18px; }
.msg.ok { color: var(--green); }
.msg.err { color: #ff6b6b; }

.hidden { display: none !important; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button.active { background: var(--red); color: #fff; box-shadow: 0 6px 18px -8px rgba(229, 9, 20, .8); }

dialog {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; width: 90%; max-width: 420px;
}
dialog::backdrop { background: rgba(0,0,0,.6); }

@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .row { flex-direction: column; }
}
