:root {
  --background: #f1f5f9;
  --foreground: #0f172a;
  --card: #ffffff;
  --muted: #64748b;
  --border: rgba(15, 23, 42, 0.1);
  --sidebar: #0f172a;
  --sidebar-muted: #94a3b8;
  --sidebar-active: #1e293b;
  --primary: #0284c7;
  --accent: #0891b2;
  --ok: #10b981;
  --bad: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  background: var(--background);
  color: var(--foreground);
  font-family: "Plus Jakarta Sans", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  color: #e2e8f0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-icon,
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #38bdf8;
  color: #0f172a;
  font-size: 11px;
  font-weight: 800;
}

.brand strong,
.profile strong {
  display: block;
  font-size: 13px;
}

.brand span,
.profile span {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: var(--sidebar-muted);
}

nav {
  padding: 14px 10px;
  flex: 1;
}

.nav {
  width: 100%;
  height: 36px;
  margin-bottom: 4px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-muted);
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}

.nav:hover,
.nav.active {
  background: var(--sidebar-active);
  color: #f8fafc;
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.profile .avatar {
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
}

.shell {
  min-width: 0;
  flex: 1;
}

.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  background: var(--background);
  border-bottom: 1px solid var(--border);
}

.search {
  width: min(460px, 55vw);
  height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.search span {
  color: var(--muted);
  font-size: 12px;
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live,
.actions button,
.endpoint {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--foreground);
  font-size: 12px;
}

.live i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ok);
}

.actions button {
  cursor: pointer;
}

.content {
  padding: 22px;
}

.headline {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
  margin-bottom: 16px;
}

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

h1 {
  font-size: 24px;
  line-height: 1.25;
}

.headline p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
}

.endpoint {
  flex-direction: column;
  align-items: flex-start;
  height: auto;
  padding: 9px 12px;
}

.endpoint span {
  color: var(--muted);
  font-size: 11px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.category-form,
.clear-form,
.log-filter {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}

.category-form label,
.clear-form label,
.log-filter label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.category-form div {
  display: flex;
  gap: 8px;
}

.category-form input,
.clear-form input,
.clear-form select,
.log-filter input,
.log-filter select {
  min-width: 0;
  flex: 1;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  background: #fff;
}

.category-form input:focus,
.clear-form input:focus,
.clear-form select:focus,
.log-filter input:focus,
.log-filter select:focus {
  border-color: rgba(2, 132, 199, .45);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, .12);
}

.category-form button,
.clear-form button,
.log-filter button {
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.clear-form button.danger {
  background: var(--bad);
}

.category-form p,
.clear-form p {
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
}

.form-title {
  display: grid;
  gap: 3px;
}

.form-title strong {
  font-size: 14px;
}

.form-title span {
  color: var(--muted);
  font-size: 12px;
}

.clear-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr .9fr .9fr auto auto;
  gap: 8px;
  align-items: end;
}

.clear-grid label {
  display: grid;
  gap: 5px;
}

.log-filter {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
}

.log-filter label {
  display: grid;
  gap: 5px;
}

.stats article,
.category {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.stats article {
  padding: 16px;
}

.stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stats strong {
  display: block;
  margin-top: 7px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 28px;
}

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

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

.categories {
  display: grid;
  gap: 12px;
}

.category {
  overflow: hidden;
}

.category-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.category h2 {
  font-size: 16px;
}

.category-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.category-head strong {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--primary);
}

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

.log-groups h3 {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
}

.logs {
  display: grid;
  gap: 7px;
}

.log-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: inherit;
}

.log-row:hover {
  border-color: rgba(2, 132, 199, .35);
  background: #f8fafc;
}

.log-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
}

.log-meta {
  margin-top: 3px;
  color: var(--muted);
  font: 11px "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.badge {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
}

.badge.success {
  color: #047857;
  background: rgba(16, 185, 129, .1);
}

.badge.failed {
  color: #b91c1c;
  background: rgba(239, 68, 68, .1);
}

.log-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.log-actions a {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--primary);
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}

.log-actions a:hover {
  background: rgba(2, 132, 199, .08);
}

.empty {
  padding: 12px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 12px;
}

@media (max-width: 900px) {
  body {
    display: block;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
  }

  nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex: none;
  }

  .nav {
    width: auto;
    white-space: nowrap;
  }

  .profile {
    display: none;
  }

  .headline,
  .topbar {
    align-items: stretch;
    flex-direction: column;
    height: auto;
    padding: 14px;
  }

  .search {
    width: 100%;
  }

  .stats,
  .category-form div,
  .clear-grid,
  .log-filter,
  .log-groups {
    grid-template-columns: 1fr;
  }

  .category-form div {
    display: grid;
  }
}
