:root {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-card: #22252f;
  --bg-code: #181b24;
  --border: #2d3040;
  --text-primary: #e4e6ed;
  --text-secondary: #9ca0b0;
  --text-muted: #6b7084;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-subtle: rgba(99, 102, 241, 0.12);
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --blue: #3b82f6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: 'Roboto', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
  font-family: 'Roboto Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.sidebar-header .version {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.sidebar nav {
  padding: 16px 0;
}

.nav-section {
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 8px 12px;
}

.nav-link {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s ease;
}

.nav-link:hover {
  background: var(--accent-subtle);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 500;
}

/* Main Content */
.main {
  flex: 1;
  margin-left: 280px;
  max-width: 900px;
  padding: 48px 56px 120px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 32px; margin: 48px 0 16px; }
h2 {
  font-size: 24px;
  margin: 48px 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
h3 { font-size: 18px; margin: 32px 0 12px; }
h4 { font-size: 16px; margin: 24px 0 8px; color: var(--text-secondary); }

p { margin-bottom: 16px; color: var(--text-secondary); }

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

strong { color: var(--text-primary); font-weight: 600; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14px;
}

thead th {
  background: var(--bg-secondary);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

tbody tr:hover { background: var(--bg-secondary); }

/* Code */
code {
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
  border: 1px solid var(--border);
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  overflow-x: auto;
  margin: 16px 0 24px;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge-green { background: rgba(34,197,94,0.12); color: var(--green); }
.badge-yellow { background: rgba(234,179,8,0.12); color: var(--yellow); }
.badge-red { background: rgba(239,68,68,0.12); color: var(--red); }
.badge-blue { background: rgba(59,130,246,0.12); color: var(--blue); }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin: 16px 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 16px 0 24px;
}

.card h4 {
  margin: 0 0 8px;
  color: var(--text-primary);
  font-size: 15px;
}

.card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.card .card-icon {
  font-size: 20px;
  margin-bottom: 8px;
}

/* Mermaid diagrams */
.mermaid {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin: 16px 0 24px;
  text-align: center;
  overflow-x: auto;
}

/* Service list */
.service-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}

.service-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.service-item .status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.service-item .name {
  font-family: 'Roboto Mono', monospace;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 220px;
}

.service-item .image {
  color: var(--text-muted);
  font-size: 12px;
}

/* File tree */
.file-tree {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre;
}

.file-tree .dir { color: var(--blue); font-weight: 500; }
.file-tree .comment { color: var(--text-muted); }

/* Endpoint table */
.endpoint-method {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Roboto Mono', monospace;
  min-width: 50px;
  text-align: center;
}

.method-get { background: rgba(34,197,94,0.15); color: var(--green); }
.method-post { background: rgba(59,130,246,0.15); color: var(--blue); }
.method-patch { background: rgba(234,179,8,0.15); color: var(--yellow); }
.method-delete { background: rgba(239,68,68,0.15); color: var(--red); }

/* Responsive */
.menu-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 18px;
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 32px 20px 80px; }
  .menu-toggle { display: block; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Section anchors */
section { scroll-margin-top: 24px; }

