/* ============================
   Docs Page
   ============================ */

:root {
  --docs-panel-bg: rgba(255, 255, 255, 0.9);
  --docs-panel-border: rgba(15, 23, 42, 0.08);
  --docs-panel-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --docs-soft-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  --docs-accent: var(--bs-primary);
  --docs-accent-soft: rgba(0, 102, 204, 0.08);
  --docs-text-strong: #0f172a;
  --docs-text: #334155;
  --docs-text-muted: #64748b;
  --docs-border: #e2e8f0;
  --docs-bg-soft: #ffffff;
}

.docs-content {
  position: relative;
}

/* Sidebar */
.docs-sidebar {
  border-right: none;
  padding-right: 1rem;
}

.docs-sidebar .sticky-top {
  top: calc(var(--header-height) + 18px);
  z-index: 20;
  max-height: calc(100vh - var(--header-height) - 20px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  border: 1px solid var(--docs-panel-border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: var(--docs-panel-shadow);
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}

.docs-sidebar .sticky-top::-webkit-scrollbar {
  width: 4px;
}

.docs-sidebar .sticky-top::-webkit-scrollbar-track {
  background: transparent;
}

.docs-sidebar .sticky-top::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 4px;
}

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

.docs-nav-group-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #94a3b8;
  padding: 1.1rem 0.85rem 0.4rem;
  margin: 0;
}

.docs-nav li a {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--docs-text);
  padding: 0.52rem 0.85rem;
  border-left: 0;
  border-radius: 12px;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  line-height: 1.45;
}

.docs-nav li a:hover {
  color: var(--docs-accent);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
  transform: translateX(2px);
}

.docs-nav li a.active {
  color: var(--docs-accent);
  background: rgba(0, 102, 204, 0.1);
  box-shadow: inset 0 0 0 1px rgba(0, 102, 204, 0.14);
  font-weight: 600;
}

/* Content typography */
.docs-section {
  scroll-margin-top: calc(var(--header-height) + 30px);
  position: relative;
  padding: clamp(1.35rem, 1.1rem + 1vw, 2rem);
  margin-bottom: 1.75rem;
  border: 1px solid var(--docs-panel-border);
  border-radius: 24px;
  background: var(--docs-bg-soft);
  box-shadow: var(--docs-soft-shadow);
  overflow: hidden;
}

.docs-section::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: var(--docs-accent);
  opacity: 0.85;
}

.docs-content h2 {
  position: relative;
  font-size: clamp(1.7rem, 1.45rem + 1.15vw, 2.35rem);
  font-weight: 700;
  color: var(--docs-text-strong);
  border-top: none;
  padding-top: 0;
  margin-top: 0;
  margin-bottom: 0.95rem;
  padding-bottom: 0.85rem;
}

.docs-content h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 72px;
  height: 3px;
  border-radius: 999px;
  background: var(--docs-accent);
}

.docs-content h3 {
  font-weight: 600;
  color: var(--docs-text-strong);
  margin-top: 2.1rem;
  margin-bottom: 0.7rem;
}

.docs-content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.4rem;
  color: #1e293b;
}

.docs-content p,
.docs-content li {
  color: var(--docs-text);
  line-height: 1.7;
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}

.docs-content ul,
.docs-content ol {
  padding-left: 1.2rem;
  margin-bottom: 1.2rem;
}

.docs-content a:not(.btn) {
  color: var(--docs-accent);
  text-decoration: underline;
  text-decoration-color: rgba(0, 102, 204, 0.22);
  text-underline-offset: 0.16em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.docs-content a:not(.btn):hover {
  color: #004f9f;
  text-decoration-color: rgba(0, 79, 159, 0.38);
}

.docs-content code {
  background: #f8fafc;
  border: 1px solid #dbe3ef;
  padding: 0.14em 0.46em;
  border-radius: 7px;
  font-size: 0.8125em;
  color: #be185d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Step list */
.docs-step {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  margin-bottom: 0.95rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--docs-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.docs-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0059b3;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  margin-top: 1px;
  box-shadow: 0 8px 18px rgba(0, 89, 179, 0.22);
}

/* Pro badge */
.docs-badge-pro {
  display: inline-block;
  padding: 0.1em 0.5em;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
  margin-left: 4px;
  background: #7c3aed;
  color: #fff;
  line-height: 1.5;
}

/* Docs badges */
.docs-content .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.34rem 0.56rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  vertical-align: middle;
}

.docs-content .badge.bg-danger,
.docs-content .badge.bg-primary,
.docs-content .badge.bg-success,
.docs-content .badge.bg-secondary {
  color: #fff;
}

.docs-content .badge.bg-warning,
.docs-content .badge.bg-info {
  color: #0f172a;
}

/* Alert callouts — use Bootstrap alert base + custom left border */
.docs-callout {
  border-left-width: 4px;
  border-radius: 16px;
  font-size: 0.9375rem;
  padding: 1rem 1.15rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* Tables */
.docs-content .table {
  width: 100%;
  table-layout: auto;
  font-size: 0.875rem;
  margin: 1rem 0 1.4rem;
  border: 1px solid var(--docs-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.docs-content .table th {
  background: #f8fafc;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  border-bottom-color: #dbe3ef;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.docs-content .table td {
  vertical-align: top;
  color: var(--docs-text);
  line-height: 1.55;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 0.95rem;
  padding-bottom: 0.95rem;
  border-color: #eef2f7;
}

#audit-log .table thead th:nth-child(1),
#audit-log .table tbody td:nth-child(1) {
  min-width: 14rem;
}

#audit-log .table thead th:nth-child(2),
#audit-log .table tbody td:nth-child(2) {
  min-width: 7rem;
  white-space: nowrap;
}

#audit-log .table td:nth-child(2) .badge {
  display: inline-block;
  min-width: 4.5rem;
  text-align: center;
}

.docs-content figure {
  margin: 1.4rem 0 1.7rem;
}

.docs-content figure img {
  border-radius: 18px;
  box-shadow: var(--docs-soft-shadow);
}

.docs-content figcaption {
  color: var(--docs-text-muted);
  margin-top: 0.7rem;
}

/* Help CTA box */
.docs-cta {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--docs-panel-border);
  border-radius: 24px;
  box-shadow: var(--docs-panel-shadow);
  overflow: hidden;
}

.docs-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: none;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 991px) {
  .docs-sidebar {
    border-right: none;
    margin-bottom: 2rem;
    padding-right: 0;
  }

  .docs-sidebar .sticky-top {
    position: static !important;
    max-height: none;
  }

  .docs-section {
    padding: 1.15rem;
    border-radius: 20px;
  }
}


.docs-search-wrap {
  position: relative;
  margin-bottom: 8px
}

.docs-search-wrap svg {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: #9ca3af;
  pointer-events: none
}

#docs-search {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 30px 9px 34px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  font-size: .8125rem;
  color: #374151;
  background: rgba(248, 250, 252, 0.95);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none
}

#docs-search:focus {
  border-color: #3b82f6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12)
}

#docs-search::placeholder {
  color: #9ca3af
}

#docs-search-clear {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center
}

#docs-search-clear:hover {
  color: #374151
}

#docs-search-count {
  font-size: .7rem;
  color: #64748b;
  min-height: 14px;
  padding: 0.15rem 0.15rem 0 0.2rem;
  font-weight: 600;
}

.docs-section--hidden {
  display: none !important
}
