:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --card: #1e293b;
  --text: #e2e8f0;
  --muted: #93a3b8;
  --line: #334155;
  --ok: #16a34a;
  --err: #dc2626;
  --btn: #2563eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    sans-serif;
  background: radial-gradient(circle at top right, #1d4ed8 0%, var(--bg) 45%);
  color: var(--text);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(2, 6, 23, 0.8);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.container {
  max-width: 1400px;
  margin: 18px auto;
  padding: 0 16px 32px;
}

.card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.narrow {
  max-width: 420px;
  margin: 10vh auto 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.compact {
  gap: 10px;
}

@media (max-width: 1100px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inline {
  display: inline;
}

.form-grid {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

input,
textarea,
select {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.95rem;
}

button {
  cursor: pointer;
}

.btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  background: var(--btn);
  font-weight: 600;
}

.btn-muted {
  background: #475569;
}

.badge {
  display: inline-block;
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.badge-ok {
  background: rgba(22, 163, 74, 0.18);
  color: #86efac;
  border-color: rgba(22, 163, 74, 0.4);
}

.badge-error {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
  border-color: rgba(220, 38, 38, 0.4);
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.small {
  font-size: 0.8rem;
}

.flash {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(22, 163, 74, 0.45);
  background: rgba(22, 163, 74, 0.18);
}

.flash-error {
  border-color: rgba(220, 38, 38, 0.45);
  background: rgba(220, 38, 38, 0.18);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #cbd5e1;
  font-size: 0.85rem;
}

.table-wrap {
  overflow: auto;
}

details pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(15, 23, 42, 0.75);
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
}
