:root {
  --bg: #0f172a;
  --card: #111827;
  --card2: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --line: #334155;
  --accent: #38bdf8;
  --danger: #f87171;
  --ok: #34d399;
  --warn: #fbbf24;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
.wrapper { display: flex; min-height: 100vh; }
.sidebar { width: 245px; background: #020617; padding: 22px; border-right: 1px solid var(--line); }
.sidebar h1 { font-size: 19px; margin: 0 0 24px; }
.nav a { display: block; padding: 12px 14px; margin: 8px 0; border-radius: 10px; color: var(--text); background: transparent; }
.nav a:hover { background: var(--card2); }
.main { flex: 1; padding: 24px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.lang a { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; margin-left: 6px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 18px; box-shadow: 0 12px 28px rgba(0,0,0,.18); }
.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat { background: var(--card2); border-radius: 14px; padding: 16px; }
.stat .num { font-size: 28px; font-weight: 700; }
.stat .label { color: var(--muted); font-size: 13px; }
input, select, button { font: inherit; }
input, select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #020617; color: var(--text); }
label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 12px; }
button, .btn { border: none; background: var(--accent); color: #00111c; padding: 10px 14px; border-radius: 10px; cursor: pointer; font-weight: 700; display: inline-block; }
button.secondary, .btn.secondary { background: var(--card2); color: var(--text); border: 1px solid var(--line); }
button.danger { background: var(--danger); color: #2b0505; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: var(--card2); color: var(--text); font-size: 12px; }
.badge.added, .badge.authorized, .badge.listener_running { background: rgba(52,211,153,.16); color: var(--ok); }
.badge.failed, .badge.privacy_restricted, .badge.not_found, .badge.login_error { background: rgba(248,113,113,.16); color: var(--danger); }
.badge.paused, .badge.temporary_failed, .badge.otp_sent, .badge.2fa_required { background: rgba(251,191,36,.16); color: var(--warn); }
.notice { padding: 12px; border: 1px solid var(--line); background: var(--card2); border-radius: 12px; margin-bottom: 12px; }
.login-box { max-width: 420px; margin: 12vh auto; }
.small { color: var(--muted); font-size: 12px; }
.inline-form { display: inline; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.mt-12 { margin-top: 12px; }
.compact-table { margin-bottom: 12px; }
.compact-table th:first-child, .compact-table td:first-child { width: 52px; }
.compact-table th:last-child, .compact-table td:last-child { width: 140px; }
.status-badge {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  margin-bottom: 8px;
}

.status-badge.success {
  background: rgba(50, 220, 120, 0.15);
  color: #42ff91;
  border: 1px solid rgba(66, 255, 145, 0.35);
}

.status-badge.muted {
  background: rgba(160, 160, 160, 0.12);
  color: #d0d0d0;
  border: 1px solid rgba(160, 160, 160, 0.25);
}