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

:root {
  --cyan: #00eeff;
  --cyan-dim: rgba(0,238,255,0.08);
  --cyan-border: rgba(0,238,255,0.2);
  --bg: #0b0e18;
  --surface: rgba(18,22,34,0.85);
  --surface-2: rgba(24,29,44,0.7);
  --border: rgba(255,255,255,0.06);
  --border-light: rgba(255,255,255,0.04);
  --text: rgba(255,255,255,0.85);
  --text-dim: rgba(255,255,255,0.45);
  --text-faint: rgba(255,255,255,0.25);
  --green: rgb(74,222,128);
  --red: rgb(248,113,113);
  --purple: rgb(167,139,250);
  --sidebar-w: 230px;
  --header-h: 50px;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- scrollbar ---------- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ---------- layout ---------- */
#app { display: flex; height: 100vh; overflow: hidden; }

/* ---------- sidebar ---------- */
#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-right: 1px solid var(--border);
  background: rgba(10,13,22,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.25s ease;
  z-index: 100;
}

#sidebar-header {
  padding: 20px 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(0,238,255,0.1);
  border: 1px solid rgba(0,238,255,0.22);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.brand-icon svg { width: 16px; height: 16px; color: var(--cyan); }

.brand-dot {
  position: absolute;
  top: -3px; right: -3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
}

.brand-name { font-size: 13px; font-weight: 600; color: var(--cyan); line-height: 1; }
.brand-sub { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

#sidebar-nav {
  padding: 12px 8px;
  flex: 1;
  overflow-y: auto;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  padding: 0 8px;
  margin-bottom: 6px;
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 7px;
  border: none;
  background: none;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
  font-family: inherit;
  position: relative;
  margin-bottom: 2px;
}

.nav-item:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.8); }

.nav-item.active {
  background: rgba(0,238,255,0.08);
  color: var(--cyan);
}

.nav-dot {
  margin-left: auto;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  flex-shrink: 0;
  display: none;
}

.nav-item.active .nav-dot { display: block; }

.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; }

/* status panel */
.status-section { padding: 0 8px 12px; }
.status-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); padding: 0 8px; margin-bottom: 6px; }

.status-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.status-key { color: var(--text-dim); }
.status-val { font-family: var(--font-mono); color: var(--cyan); }
.badge-online {
  background: rgba(34,197,94,0.1);
  color: rgb(74,222,128);
  border: 1px solid rgba(34,197,94,0.2);
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600;
}

/* footer */
#sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.btn-contact {
  width: 100%;
  padding: 8px 12px;
  border-radius: 7px;
  border: 1px solid var(--cyan-border);
  background: rgba(0,238,255,0.07);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
  font-family: inherit;
}

.btn-contact:hover { background: rgba(0,238,255,0.13); }
.btn-contact svg { width: 13px; height: 13px; }

.contact-card {
  margin-top: 8px;
  border-radius: 8px;
  border: 1px solid rgba(0,238,255,0.1);
  background: rgba(255,255,255,0.03);
  padding: 12px;
  display: none;
  flex-direction: column;
  gap: 10px;
}

.contact-card.open { display: flex; }

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.contact-icon {
  width: 26px; height: 26px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.contact-icon svg { width: 14px; height: 14px; }
.contact-label { font-size: 11px; color: rgba(255,255,255,0.6); }
.contact-val { font-family: var(--font-mono); font-size: 11px; color: var(--cyan); }
.contact-divider { height: 1px; background: rgba(255,255,255,0.05); }

/* ---------- main area ---------- */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* header */
#header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(11,14,24,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
}

#menu-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 5px;
  display: none;
  transition: color 0.15s;
}

#menu-toggle:hover { color: var(--text); }
#menu-toggle svg { width: 18px; height: 18px; display: block; }

.header-sep { width: 1px; height: 16px; background: rgba(255,255,255,0.08); }

#header-title { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.8); }

.header-pill {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,238,255,0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 5px rgba(0,238,255,0); }
}

.header-ver { font-size: 11px; color: var(--text-faint); }

/* content */
#content { flex: 1; overflow-y: auto; }

.page { display: none; }
.page.active { display: block; }

/* ---------- dashboard page ---------- */
.page-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* hero */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  color: rgb(74,222,128);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.hero-badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgb(74,222,128);
  animation: pulse-g 2s infinite;
}

@keyframes pulse-g {
  0%,100% { opacity:1; } 50% { opacity:0.5; }
}

h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.3px; }
h1 .cyan { color: var(--cyan); }
.hero-sub { font-size: 13px; color: var(--text-dim); max-width: 480px; margin-top: 4px; }

/* stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  transition: border-color 0.2s, transform 0.2s;
}

.stat-card:hover { border-color: rgba(0,238,255,0.15); transform: translateY(-1px); }

.stat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.stat-label { font-size: 11px; color: var(--text-dim); }
.stat-value { font-size: 22px; font-weight: 700; font-family: var(--font-mono); color: #fff; margin-top: 4px; }
.stat-icon { color: var(--cyan); opacity: 0.6; }
.stat-icon svg { width: 15px; height: 15px; }
.stat-change { font-size: 11px; font-family: var(--font-mono); margin-top: 8px; color: var(--green); }
.stat-change.neutral { color: var(--text-faint); }

/* section label */
.section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 16px;
}

/* feature cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  background: rgba(20,25,38,0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover { border-color: rgba(255,255,255,0.12); transform: translateY(-1px); }

.feature-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}

.feature-icon svg { width: 16px; height: 16px; }
.feature-title { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 6px; }
.feature-desc { font-size: 12px; color: var(--text-dim); line-height: 1.6; }
.feature-metric { font-size: 22px; font-weight: 700; font-family: var(--font-mono); margin-top: 12px; }
.feature-metric-label { font-size: 11px; color: var(--text-faint); margin-left: 6px; }

/* activity table */
.activity-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.activity-header-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  padding: 9px 16px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.activity-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  padding: 11px 16px;
  font-size: 12px;
  border-bottom: 1px solid var(--border-light);
}

.activity-row:last-child { border-bottom: none; }
.activity-endpoint { font-family: var(--font-mono); color: rgba(255,255,255,0.65); }
.activity-status-200 { font-family: var(--font-mono); font-weight: 600; color: var(--green); }
.activity-status-429 { font-family: var(--font-mono); font-weight: 600; color: var(--red); }
.activity-time { font-family: var(--font-mono); color: var(--text-dim); }
.activity-when { color: var(--text-faint); text-align: right; }

.activity-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.live-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0,238,255,0.08);
  color: var(--cyan);
  border: 1px solid var(--cyan-border);
}

/* ---------- docs page ---------- */
.docs-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.breadcrumb span.active { color: var(--cyan); }
.breadcrumb svg { width: 10px; height: 10px; }

h2.docs-title { font-size: 24px; font-weight: 700; color: #fff; }
.docs-sub { font-size: 13px; color: var(--text-dim); margin-top: 4px; max-width: 480px; }

.doc-card {
  background: rgba(20,25,38,0.7);
  border: 1px solid rgba(0,238,255,0.1);
  border-radius: 10px;
  padding: 20px;
}

.doc-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.doc-card-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: rgba(0,238,255,0.1);
  display: flex; align-items: center; justify-content: center;
}

.doc-card-icon svg { width: 14px; height: 14px; color: var(--cyan); }
.doc-card-title span { font-size: 14px; font-weight: 600; color: #fff; }
.doc-desc { font-size: 12px; color: var(--text-dim); margin-bottom: 12px; }

/* code block */
.code-block {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 12px 14px;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.code-lang { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(0,238,255,0.5); }

.btn-copy {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.35);
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
  font-family: inherit;
}

.btn-copy:hover { color: rgba(255,255,255,0.7); }
.btn-copy.copied { color: var(--green); }
.btn-copy svg { width: 12px; height: 12px; }

pre, code {
  font-family: var(--font-mono);
  font-size: 12px;
}

.code-line { display: block; }
.code-prompt { color: rgba(255,255,255,0.3); }
.code-cmd { color: var(--cyan); }
.code-arg { color: rgba(255,255,255,0.65); }

.code-pre {
  overflow-x: auto;
  line-height: 1.7;
  color: rgba(255,255,255,0.7);
  white-space: pre;
}

.json-key { color: var(--cyan); }
.json-str { color: rgba(255,255,255,0.6); }
.json-num { color: var(--purple); }
.json-bracket { color: rgba(255,255,255,0.35); }

/* endpoint block */
.endpoint-block {
  background: rgba(20,25,38,0.7);
  border: 1px solid rgba(0,238,255,0.1);
  border-radius: 10px;
  overflow: hidden;
}

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

.endpoint-method-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.badge-method {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 5px;
  background: rgba(0,238,255,0.12);
  color: var(--cyan);
  border: 1px solid rgba(0,238,255,0.25);
  letter-spacing: 0.05em;
}

.endpoint-path { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: #fff; }
.endpoint-desc { font-size: 12px; color: var(--text-dim); }

.endpoint-body { padding: 20px; display: flex; flex-direction: column; gap: 20px; }

.sub-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 10px;
}

/* params table */
.params-table {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.params-header, .params-row {
  display: grid;
  grid-template-columns: 1fr 1fr 80px 2fr;
  font-size: 11px;
  gap: 8px;
}

.params-header {
  padding: 8px 14px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.params-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  align-items: start;
}

.params-row:last-child { border-bottom: none; }
.param-name { font-family: var(--font-mono); font-weight: 600; color: var(--cyan); }
.param-type { font-family: var(--font-mono); color: var(--purple); }
.param-req-yes { color: var(--red); }
.param-req-no { color: var(--text-faint); }
.param-desc { color: var(--text-dim); }

/* status cards */
.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 13px;
  transition: border-color 0.2s;
}

.status-card:hover { border-color: rgba(255,255,255,0.1); }
.status-code { font-family: var(--font-mono); font-size: 18px; font-weight: 700; }
.status-name { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.65); margin-top: 2px; }
.status-desc { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

/* bottom info cards */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.info-card {
  background: rgba(20,25,38,0.7);
  border-radius: 10px;
  padding: 18px;
}

.info-card.purple-border { border: 1px solid rgba(167,139,250,0.15); }
.info-card.cyan-border { border: 1px solid rgba(0,238,255,0.1); }

.info-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.info-card-title svg { width: 15px; height: 15px; }
.info-card-title span { font-size: 13px; font-weight: 600; color: #fff; }

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 8px;
}

.info-row:last-child { margin-bottom: 0; }
.info-key { color: var(--text-dim); }
.info-val { font-family: var(--font-mono); color: var(--purple); }
.info-val.cyan { color: var(--cyan); }

/* ---------- responsive ---------- */
@media (max-width: 768px) {
  #menu-toggle { display: flex; }

  #sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
  }

  #sidebar.open { transform: translateX(0); }

  #overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
  }

  #overlay.open { display: block; }

  .stat-grid { grid-template-columns: 1fr 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .status-grid { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .params-header, .params-row { grid-template-columns: 1fr 1fr 60px 1.5fr; }

  .page-inner, .docs-inner { padding: 20px 16px; }
}

@media (max-width: 500px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .activity-header-row, .activity-row { grid-template-columns: 2fr 1fr 1fr; }
  .activity-when { display: none; }
}
