:root {
  --bg: #1e1e1e;
  --bg-elevated: #262626;
  --bg-hover: #2f2f2f;
  --border: #363636;
  --text: #dcddde;
  --text-muted: #999;
  --accent: #7f6df2;
  --accent-dim: #483699;
  --success: #3dd68c;
  --warning: #e5a84b;
  --danger: #e54d4d;
  --radius: 8px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code,
pre {
  font-family: var(--mono);
  font-size: 0.88em;
}

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}

.brand h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.brand p {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1.25rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 2px solid transparent;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
  background: var(--bg-hover);
  border-left-color: var(--accent);
  text-decoration: none;
}

.nav-icon {
  width: 1.1rem;
  opacity: 0.7;
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem 1.25rem 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.main {
  padding: 2rem 2.5rem 3rem;
  max-width: 960px;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h2 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 600;
}

.page-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

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

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

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

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
}

.card h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.card-header h3 {
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-ok {
  background: rgba(61, 214, 140, 0.15);
  color: var(--success);
}

.badge-ok::before {
  background: var(--success);
}

.badge-warn {
  background: rgba(229, 168, 75, 0.15);
  color: var(--warning);
}

.badge-warn::before {
  background: var(--warning);
}

.badge-off {
  background: rgba(153, 153, 153, 0.12);
  color: var(--text-muted);
}

.badge-off::before {
  background: var(--text-muted);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0.25rem 0 0;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr:last-child td {
  border-bottom: none;
}

.mono {
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #6f5ee8;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-hover);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

pre.endpoint {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  overflow-x: auto;
  margin: 0.5rem 0 0;
  color: var(--text-muted);
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
}

.steps li {
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1.25rem;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  width: 1.6rem;
  height: 1.6rem;
  background: var(--accent-dim);
  color: #fff;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.alert-info {
  background: rgba(127, 109, 242, 0.12);
  border: 1px solid rgba(127, 109, 242, 0.35);
  color: var(--text);
}

.alert-success {
  background: rgba(61, 214, 140, 0.1);
  border: 1px solid rgba(61, 214, 140, 0.3);
}

.alert-danger {
  background: rgba(229, 77, 77, 0.1);
  border: 1px solid rgba(229, 77, 77, 0.35);
  color: var(--text);
}

.hidden {
  display: none !important;
}

.section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: radial-gradient(ellipse at top, #2a2540 0%, var(--bg) 55%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
}

.login-card .brand {
  border: none;
  padding: 0;
  margin-bottom: 1.5rem;
  justify-content: center;
}

.login-card h2 {
  text-align: center;
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.login-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0 0 1.5rem;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.gap-1 { gap: 1rem; display: flex; flex-wrap: wrap; }
