:root {
  --bg: #0f172a;
  --panel: #111827;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --danger: #ef4444;
  --border: #1f2937;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 16px; background: var(--panel); border-bottom:1px solid var(--border);
}
.brand { font-weight: 700; }
.api-base input { width: 340px; }

.container { max-width: 1200px; margin: 24px auto; padding: 0 16px; }
.panel { background: var(--panel); border:1px solid var(--border); border-radius: 8px; padding: 16px; }

/* Tabs */
.tabbar { display:flex; gap:8px; margin-bottom:12px; border-bottom:1px solid var(--border); padding-bottom:8px; }
.tabbar .tab { background:#0b1220; color:var(--text); border:1px solid var(--border); border-radius:6px; padding:8px 12px; cursor:pointer; }
.tabbar .tab.active { background: var(--primary); color:#fff; border-color: var(--primary); }
.tab-content.hidden { display:none; }

.toolbar { display:flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { padding:6px 8px; }
.toolbar button { padding:8px 12px; }
.primary { background: var(--primary); color:#fff; border:0; border-radius:6px; }
button.danger { background: var(--danger); color:#fff; border:0; border-radius:6px; }

.create-panel { margin-top: 12px; border:1px dashed var(--border); padding: 12px; border-radius: 8px; }
.hidden { display: none; }
.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
textarea, input[type="text"], input[type="search"], input[type="datetime-local"] {
  width: 100%; padding: 8px; background:#0b1220; color:var(--text); border:1px solid var(--border); border-radius:6px;
}
.fieldset { border:1px solid var(--border); border-radius:8px; padding: 8px; }
.fieldset .legend { color: var(--muted); margin-bottom:6px; }
.inline { display:inline-flex; gap:6px; margin-right:12px; align-items:center; }
.repeater { display:flex; flex-direction:column; gap: 8px; }
.repeater .row { display:grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.repeater .row input { width: 100%; }
.repeater .row .type { width: 120px; }
.repeater-actions { display:flex; gap:8px; }
.actions { display:flex; gap:8px; }

.table-wrap { overflow:auto; }
table { width:100%; border-collapse: collapse; }
thead th { text-align:left; font-weight:600; color:var(--muted); border-bottom:1px solid var(--border); padding:8px; }
tbody td { border-bottom:1px solid var(--border); padding:8px; vertical-align: top; }
tbody tr:hover { background:#0b1220; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

.pager { display:flex; gap: 8px; align-items:center; padding:8px 0; }

.toast { position: fixed; right: 16px; bottom: 16px; background:#0b1220; border:1px solid var(--border); padding: 10px 12px; border-radius:8px; }

/* Services */
.services-grid { display:grid; grid-template-columns: 1fr; gap:12px; }
@media (min-width: 800px) { .services-grid { grid-template-columns: 1fr 1fr; } }
.service-card { border:1px solid var(--border); border-radius:8px; padding:12px; background:#0b1220; }
.service-header { display:flex; align-items:center; gap:8px; justify-content:space-between; }
.service-header .icon { font-size:18px; }
.service-header .name { flex:1; font-weight:600; }
.badge { border:1px solid var(--border); border-radius:999px; padding:4px 8px; font-size:12px; text-transform:uppercase; letter-spacing:0.03em; color:#fff; background:#374151; }
.badge.green { background:#166534; }
.badge.red { background:#991b1b; }
.badge.yellow { background:#92400e; }
.service-actions { display:flex; gap:8px; margin-top:8px; flex-wrap:wrap; }
.service-output { margin-top:8px; background:#0b1220; border:1px solid var(--border); border-radius:6px; padding:8px; max-height:120px; overflow:auto; color:var(--muted); }
