:root {
  --bg: #10151d;
  --bg-elev: #1a212b;
  --bg-elev-2: #232c39;
  --border: #2c3644;
  --text: #eef2f6;
  --text-muted: #94a3b4;
  --accent: #05db90;
  --accent-hover: #2ee6a3;
  --accent-ink: #06231a;
  --danger: #f0616d;
  --ok: #05db90;
  --warn: #d29922;
  --radius: 12px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1200px 600px at 50% -200px, #123024 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 "Montserrat", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.center {
  display: grid;
  place-items: center;
  padding: 24px;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  width: 100%;
  max-width: 420px;
}

.card.wide {
  max-width: 1100px;
}

h1 {
  font-size: 20px;
  margin: 0 0 6px;
}
h2 {
  font-size: 15px;
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.muted {
  color: var(--text-muted);
}
.hidden {
  display: none !important;
}
.small {
  font-size: 13px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.brand .dot {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--accent);
}
.brand-logo {
  height: 26px;
  width: auto;
  display: block;
}
.brand b {
  font-size: 16px;
}
.brand.tight {
  margin: 0;
}

label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin: 14px 0 6px;
}

input,
select {
  width: 100%;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  outline: none;
}
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.18);
}

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

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}
button:hover,
.btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
}
button:active {
  transform: translateY(1px);
}
button.secondary,
.btn.secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
button.secondary:hover,
.btn.secondary:hover {
  background: var(--bg-elev-2);
}
button.danger {
  background: transparent;
  border-color: rgba(240, 97, 109, 0.4);
  color: var(--danger);
}
button.danger:hover {
  background: rgba(240, 97, 109, 0.12);
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.submit {
  width: 100%;
  margin-top: 20px;
}

.alert {
  display: none;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 14px;
}
.alert.error {
  display: block;
  background: rgba(240, 97, 109, 0.12);
  border: 1px solid rgba(240, 97, 109, 0.35);
  color: #ffb3ba;
}
.alert.ok {
  display: block;
  background: rgba(63, 185, 80, 0.12);
  border: 1px solid rgba(63, 185, 80, 0.35);
  color: #9be89f;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.badge.ok {
  color: var(--ok);
  border-color: rgba(63, 185, 80, 0.4);
}
.badge.off {
  color: var(--danger);
  border-color: rgba(240, 97, 109, 0.4);
}
.badge.admin {
  color: var(--accent);
  border-color: rgba(79, 140, 255, 0.4);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.topbar .who {
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.target-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.target .meta {
  font-size: 13px;
  color: var(--text-muted);
}

section.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th,
td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
tr:last-child td {
  border-bottom: none;
}
code {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 12.5px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 720px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .row {
    flex-direction: column;
  }
  .target {
    flex-direction: column;
    align-items: flex-start;
  }
}

.inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.inline-form > div {
  flex: 1;
  min-width: 140px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.stat .n {
  font-size: 26px;
  font-weight: 700;
}
.stat .l {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
@media (max-width: 720px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }
}

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.actions button {
  padding: 5px 10px;
  font-size: 13px;
}

label.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  margin-top: 16px;
}
label.checkbox input {
  width: auto;
}

pre.audit {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px;
  max-height: 320px;
  overflow: auto;
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.token-out {
  margin-top: 12px;
  font-size: 13px;
}
.token-out code {
  user-select: all;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h2 {
  margin: 0;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px;
}
