:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 0.75rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: var(--surface);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-right: 1px solid #334155;
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.sidebar a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}

.sidebar a:hover, .sidebar a.active {
  background: var(--surface-hover);
  color: var(--text);
}

.content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

h1 { margin-top: 0; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.3);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}

.metric {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.label {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

button, .btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.15s;
}

button:hover, .btn-primary:hover {
  background: var(--accent-hover);
}

.result-box {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 0.875rem;
  white-space: pre-wrap;
  min-height: 2rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th, .table td {
  text-align: left;
  padding: 0.625rem 0.5rem;
  border-bottom: 1px solid #334155;
}

.table th {
  color: var(--text-secondary);
  font-weight: 600;
}

.truncate {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-pending { background: #1e3a8a; color: #93c5fd; }
.badge-published { background: #064e3b; color: #6ee7b7; }
.badge-failed { background: #7f1d1d; color: #fca5a5; }
.badge-info { background: #1e3a8a; color: #93c5fd; }
.badge-warn { background: #78350f; color: #fcd34d; }
.badge-error { background: #7f1d1d; color: #fca5a5; }

.filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filters a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.875rem;
}

.filters a.active, .filters a:hover {
  background: var(--accent);
  color: white;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form-row label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.form-row input {
  background: var(--bg);
  border: 1px solid #334155;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
}

.form-row input:focus {
  outline: 2px solid var(--accent);
}

.code-block {
  background: var(--bg);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.8rem;
}
