:root {
  --docs-sidebar-width: 280px;
  --docs-sidebar-bg: #1a1f36;
  --docs-sidebar-hover: #252b48;
  --docs-accent: #635bff;
  --docs-accent-soft: rgba(99, 91, 255, 0.12);
  --docs-success: #0d9488;
  --docs-warning: #d97706;
  --docs-danger: #dc2626;
  --docs-code-bg: #0f172a;
  --docs-border: #e2e8f0;
  --docs-text: #334155;
  --docs-heading: #0f172a;
  --docs-muted: #64748b;
  --docs-topbar-height: 56px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--docs-text);
  background: #f8fafc;
  line-height: 1.6;
}

.docs-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--docs-topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--docs-border);
  z-index: 1030;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 1rem;
}

.docs-topbar__brand {
  font-weight: 700;
  color: var(--docs-heading);
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.95rem;
}

.docs-topbar__brand span { color: var(--docs-accent); }

.docs-topbar__search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.docs-topbar__search input {
  width: 100%;
  border: 1px solid var(--docs-border);
  border-radius: 999px;
  padding: 0.45rem 1rem 0.45rem 2.25rem;
  font-size: 0.875rem;
}

.docs-topbar__search i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--docs-muted);
}

.docs-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--docs-border);
  border-radius: 0.5rem;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12);
  max-height: 320px;
  overflow-y: auto;
  display: none;
  z-index: 1050;
}

.docs-search-results.is-open { display: block; }

.docs-search-results a {
  display: block;
  padding: 0.6rem 1rem;
  text-decoration: none;
  color: var(--docs-text);
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.875rem;
}

.docs-search-results a:hover { background: #f8fafc; }

.docs-search-results small {
  display: block;
  color: var(--docs-muted);
  font-size: 0.75rem;
}

.docs-layout {
  display: flex;
  padding-top: var(--docs-topbar-height);
  min-height: 100vh;
}

.docs-sidebar {
  width: var(--docs-sidebar-width);
  background: var(--docs-sidebar-bg);
  color: #cbd5e1;
  position: fixed;
  top: var(--docs-topbar-height);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  z-index: 1020;
  transition: transform 0.25s ease;
}

.docs-sidebar__inner { padding: 1rem 0 2rem; }

.docs-sidebar__section {
  padding: 0.5rem 1.25rem 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.docs-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.25rem;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
}

.docs-sidebar__link:hover {
  background: var(--docs-sidebar-hover);
  color: #fff;
}

.docs-sidebar__link.is-active {
  background: var(--docs-sidebar-hover);
  color: #fff;
  border-left-color: var(--docs-accent);
}

.docs-sidebar__toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.35rem;
  color: var(--docs-heading);
  padding: 0.25rem;
}

.docs-main {
  flex: 1;
  margin-left: var(--docs-sidebar-width);
  padding: 2rem 2.5rem 4rem;
  max-width: 960px;
}

.docs-main h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--docs-heading);
  margin-bottom: 0.75rem;
}

.docs-main h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--docs-heading);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--docs-border);
}

.docs-main h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--docs-heading);
  margin-top: 1.75rem;
}

.lead { font-size: 1.05rem; color: var(--docs-muted); }

.docs-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  vertical-align: middle;
}

.docs-badge--get { background: #dbeafe; color: #1d4ed8; }
.docs-badge--post { background: #dcfce7; color: #15803d; }
.docs-badge--patch { background: #fef3c7; color: #b45309; }
.docs-badge--delete { background: #fee2e2; color: #b91c1c; }
.docs-badge--master { background: var(--docs-accent-soft); color: var(--docs-accent); }
.docs-badge--client { background: #ecfdf5; color: var(--docs-success); }

.docs-callout {
  border-radius: 0.5rem;
  padding: 1rem 1.15rem;
  margin: 1.25rem 0;
  border-left: 4px solid;
  font-size: 0.925rem;
}

.docs-callout--info { background: #eff6ff; border-color: #3b82f6; }
.docs-callout--warning { background: #fffbeb; border-color: #f59e0b; }
.docs-callout--danger { background: #fef2f2; border-color: #ef4444; }
.docs-callout--success { background: #ecfdf5; border-color: #10b981; }

.docs-endpoint {
  background: #fff;
  border: 1px solid var(--docs-border);
  border-radius: 0.5rem;
  padding: 1rem 1.15rem;
  margin: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.docs-endpoint code {
  font-size: 0.95rem;
  color: var(--docs-heading);
  font-weight: 600;
}

.docs-table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--docs-border);
  border-radius: 0.5rem;
  background: #fff;
}

.docs-table {
  width: 100%;
  margin: 0;
  font-size: 0.875rem;
}

.docs-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--docs-heading);
  white-space: nowrap;
}

.docs-table td, .docs-table th {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

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

.docs-table code {
  font-size: 0.8rem;
  background: #f1f5f9;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
}

.docs-code-block {
  position: relative;
  margin: 1rem 0 1.5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--docs-code-bg);
}

.docs-code-block__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.85rem;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}

.docs-code-block__label {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.docs-code-block__copy {
  background: transparent;
  border: 1px solid #475569;
  color: #e2e8f0;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 0.25rem;
  cursor: pointer;
}

.docs-code-block__copy:hover { background: #334155; }

.docs-code-block pre {
  margin: 0;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  color: #e2e8f0;
  font-size: 0.8125rem;
  line-height: 1.55;
}

.docs-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 2rem 0;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--docs-border);
  border-radius: 0.75rem;
}

.docs-flow__box {
  background: linear-gradient(135deg, #1a1f36, #252b48);
  color: #fff;
  padding: 0.85rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-align: center;
  min-width: 200px;
}

.docs-flow__box--pos { background: linear-gradient(135deg, #635bff, #7c3aed); }
.docs-flow__box--api { background: linear-gradient(135deg, #0f766e, #0d9488); }
.docs-flow__box--web { background: linear-gradient(135deg, #1d4ed8, #2563eb); }

.docs-flow__arrow {
  color: var(--docs-muted);
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.35rem 0;
}

.docs-flow--horizontal {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}

.docs-flow--horizontal .docs-flow__arrow {
  transform: rotate(-90deg);
  padding: 0 0.5rem;
}

.docs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.docs-card {
  background: #fff;
  border: 1px solid var(--docs-border);
  border-radius: 0.5rem;
  padding: 1.15rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.docs-card:hover {
  border-color: var(--docs-accent);
  box-shadow: 0 4px 20px rgba(99, 91, 255, 0.12);
}

.docs-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--docs-heading);
}

.docs-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--docs-muted);
}

.docs-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--docs-border);
  font-size: 0.8rem;
  color: var(--docs-muted);
}

.docs-search-results a small {
  display: block;
  color: var(--docs-muted);
  font-size: 0.75rem;
}

.docs-topbar__lang {
  flex-shrink: 0;
}

.docs-lang {
  display: flex;
  gap: 0.35rem;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 0.2rem;
}

.docs-lang__btn {
  border: none;
  background: transparent;
  color: var(--docs-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
}

.docs-lang__btn:hover {
  color: var(--docs-heading);
  background: rgba(255, 255, 255, 0.7);
}

.docs-lang__btn.is-active {
  background: #fff;
  color: var(--docs-heading);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.docs-lang__flag {
  margin-right: 0.2rem;
}

@media (max-width: 991px) {
  .docs-sidebar {
    transform: translateX(-100%);
  }

  .docs-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
  }

  .docs-main {
    margin-left: 0;
    padding: 1.5rem 1rem 3rem;
  }

  .docs-sidebar__toggle { display: block; }

  .docs-flow--horizontal {
    flex-direction: column;
  }

  .docs-flow--horizontal .docs-flow__arrow {
    transform: none;
  }
}

@media (max-width: 575px) {
  .docs-topbar__brand span { display: none; }
  .docs-main h1 { font-size: 1.5rem; }
  .docs-lang__btn { padding: 0.35rem 0.5rem; }
  .docs-lang__label { display: none; }
  .docs-lang__flag { margin-right: 0; font-size: 0.95rem; }
}
