:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --card: #1e293b;
  --card-2: #172033;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.2);
  --primary: #38bdf8;
  --success: #22c55e;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg), #020617);
  color: var(--text);
}

.topbar {
  padding: 32px 20px 12px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--primary);
  font-size: 12px;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
}

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

.small {
  font-size: 12px;
}

.stats,
.grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.stat-card {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
}

.stat-card {
  padding: 18px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 32px;
}

.card {
  padding: 18px;
}

.card-header {
  margin-bottom: 16px;
}

.card-header.inline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

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

label span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

input,
select,
textarea,
button {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}

select[multiple] {
  min-height: 140px;
}

textarea {
  resize: vertical;
}

button {
  cursor: pointer;
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  border: 0;
  font-weight: 600;
}

button.ghost,
button.mini {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--line);
}

button.danger {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.35);
}

.actions {
  display: flex;
  gap: 10px;
}

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

.switch-row input {
  width: auto;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: rgba(255,255,255,0.02);
  color: var(--muted);
  position: sticky;
  top: 0;
}

.empty {
  text-align: center;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.success {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

.badge.danger {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

.table-actions,
.filters,
.url-block {
  display: flex;
  gap: 8px;
  align-items: center;
}

.url-block {
  min-width: 320px;
}

code,
.console {
  font-family: "Cascadia Code", Consolas, monospace;
}

.console {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: #020617;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  min-height: 64px;
}

.log-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.log-table-wrap {
  max-height: 520px;
}

@media (max-width: 980px) {
  .stats,
  .two-col,
  .log-detail {
    grid-template-columns: 1fr;
  }

  .card-header.inline,
  .filters,
  .actions,
  .url-block,
  .table-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
