:root {
  --bg: #0b1220;
  --card: #121a2b;
  --text: #eef3fb;
  --muted: #8b9bb3;
  --line: #243049;
  --accent: #4c8dff;
  --good: #3dd68c;
  --bad: #ff6b7a;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; background: radial-gradient(1200px 600px at 10% -10%, #182544, var(--bg)); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.login { width: min(420px, 100%); }
.brand { font-weight: 700; letter-spacing: .04em; color: var(--accent); }
h1, h2, h3 { margin: 8px 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
label { display: block; color: var(--muted); font-size: 13px; }
input, select, button {
  width: 100%; padding: 11px 12px; margin: 6px 0 12px;
  border-radius: 10px; border: 1px solid var(--line);
  background: #0d1524; color: var(--text);
}
button, .btn {
  background: var(--accent); color: #fff; border: 0; cursor: pointer; font-weight: 600;
  width: auto; padding: 11px 16px;
}
button:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.next { background: #21c07a; }
.tiny { padding: 6px 10px; font-size: 12px; margin: 0; }
.alert { padding: 10px 12px; border-radius: 10px; margin: 10px 0; }
.alert.bad { background: #3a1d28; color: #ffd5da; }
.alert.ok { background: #163428; color: #c8f5de; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px; border-bottom: 1px solid var(--line);
  background: rgba(10,16,28,.8); position: sticky; top: 0;
}
.top nav { display: flex; gap: 16px; align-items: center; }
.user-wrap, .admin-wrap { max-width: 1100px; margin: 0 auto; padding: 20px; display: grid; gap: 16px; }
.hero h1 { font-size: clamp(18px, 3vw, 28px); word-break: break-all; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.pill { background: #0d1524; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; font-size: 13px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions form { margin: 0; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { text-align: center; }
.stat b { display: block; font-size: 28px; }
.stat span { color: var(--muted); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; align-items: end; }
.grid button { margin-bottom: 12px; }
.chk { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.chk input { width: auto; margin: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
.otp { font-size: 22px; font-weight: 700; letter-spacing: 2px; color: var(--good); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; }
.row-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.row-btns form { margin: 0; display: flex; gap: 4px; align-items: center; }
.row-btns select { width: auto; margin: 0; padding: 6px; }

.otp-card { margin: 14px 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #0d1524; text-align: center; }
.otp-big { font-size: 42px; font-weight: 800; letter-spacing: 6px; color: var(--good); margin-bottom: 6px; }

.btn.cancel { background: #8b3040; }

.split { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }

.otp-join { font-size: 26px; letter-spacing: 2px; word-break: break-word; }

.api-key { font-size: 12px; word-break: break-all; color: #9aa; }
.api-key code { color: #cde; }

.api-key a { color: #7ec8ff; word-break: break-all; }

#matrix-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  width: 100%; height: 100%;
}
body.admin-body { background: #040a08; }
body.admin-body .top,
body.admin-body .admin-wrap { position: relative; z-index: 1; }
body.admin-body .top { background: rgba(6, 18, 12, .82); backdrop-filter: blur(8px); }
body.admin-body .card { background: rgba(10, 24, 16, .88); border-color: #1e4a32; }

/* Matrix / user-end redesign */
body.neo, body.auth.neo { background: #010805 !important; color: #d7ffe4; }
body.neo #matrix-bg, body.auth.neo #matrix-bg {
  position: fixed !important; inset: 0 !important; z-index: 0 !important;
  pointer-events: none !important;
}
body.neo .top, body.neo .user-wrap, body.neo main,
body.auth.neo .login { position: relative; z-index: 2; }
.neo-brand {
  font-family: Consolas, "Courier New", monospace;
  letter-spacing: .22em;
  color: #39ff14 !important;
  text-shadow: 0 0 12px rgba(57,255,20,.55);
}
.neo-top {
  background: rgba(2,12,6,.62) !important;
  border-bottom: 1px solid rgba(57,255,20,.25) !important;
  backdrop-filter: blur(10px);
}
.neo-card, body.neo .card, body.neo .hero, body.neo .otp-card {
  background: rgba(4, 18, 10, .78) !important;
  border: 1px solid rgba(57,255,20,.28) !important;
  box-shadow: 0 0 24px rgba(57,255,20,.08);
  backdrop-filter: blur(10px);
}
body.auth.neo .login {
  width: min(420px, 100%);
  padding: 28px 26px;
}
body.auth.neo h1 {
  font-family: Consolas, monospace;
  font-size: 22px;
  color: #b7ffc8;
  margin-top: 6px;
}
body.neo input, body.auth.neo input {
  background: rgba(0, 20, 8, .85);
  border-color: rgba(57,255,20,.3);
  color: #e9ffe9;
}
body.neo .btn.next, body.auth.neo .btn.next {
  background: #1db954;
  box-shadow: 0 0 16px rgba(57,255,20,.25);
}
body.neo .otp-big, body.neo .otp { color: #39ff14; text-shadow: 0 0 10px rgba(57,255,20,.4); }
body.neo .muted { color: #7eaa88; }
body.neo .pill { background: rgba(0,20,8,.7); border-color: rgba(57,255,20,.25); }
.pane-col{display:grid;gap:12px}

@media (max-width: 700px) {
  .top { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
  .card { padding: 14px; border-radius: 12px; }
  .user-wrap { padding: 12px; }
  .actions { flex-wrap: wrap; }
  .actions .btn, .actions button { min-height: 44px; }
  h1 { font-size: 18px; word-break: break-all; }
}
#matrix-bg { contain: strict; }
