/* ============================================================
   Docs Online — iManager
   Converted from manual.component.scss (918 lines, Angular portal)
   Vanilla CSS — no ::ng-deep, no :host, no SCSS nesting
   ============================================================ */

/* ─── Reset / Base ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f8fafd;
  color: #374151;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

/* ─── Shell ─────────────────────────────────────────────────── */
.docs-shell {
  display: flex;
  min-height: 100vh;
  background: #f8fafd;
}

/* ─── Mobile Header (hidden on desktop) ─────────────────────── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  z-index: 200;
}

.hamburger-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  transition: background 0.15s;
}

.hamburger-btn:hover {
  background: #f3f4f6;
}

.hamburger-btn i {
  font-size: 18px;
}

.mobile-title {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

/* ─── Sidebar Overlay (mobile) ───────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.25s;
}

.sidebar-overlay.visible {
  display: block;
  opacity: 1;
}

/* ─── Sidebar ────────────────────────────────────────────────── */
.docs-sidebar {
  width: 300px;
  min-height: 100vh;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  flex-shrink: 0;
}

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

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

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

/* ─── Sidebar Header ─────────────────────────────────────────── */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1e293b;
}

.sidebar-brand i {
  font-size: 20px;
  color: #4f46e5;
}

.brand-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* Sidebar close button (mobile only) */
.sidebar-close {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: background 0.15s, color 0.15s;
}

.sidebar-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.sidebar-close i {
  font-size: 14px;
}

/* ─── Search ──────────────────────────────────────────────────── */
.sidebar-search {
  padding: 12px 16px;
}

.search-wrapper {
  width: 100%;
  position: relative;
}

.search-wrapper > i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 13px;
  z-index: 1;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  color: #111827;
  font-size: 13px;
  font-family: inherit;
  padding: 9px 12px 9px 36px;
  transition: all 0.15s;
  outline: none;
}

.search-input::placeholder {
  color: #9ca3af;
}

.search-input:focus {
  border-color: #4f46e5;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

/* ─── Nav Items (Accordion) ──────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-group {
  margin-bottom: 4px;
}

.nav-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.nav-group-header:hover {
  background: #f8fafc;
}

.nav-group-header:hover .nav-group-label {
  color: #1e293b;
}

.nav-group-header:hover .nav-group-icon {
  color: #4f46e5;
}

.nav-group-header.active .nav-group-icon {
  color: #4f46e5;
}

.nav-group-header.active .nav-group-label {
  color: #1e293b;
}

.nav-group-icon {
  font-size: 15px;
  color: #94a3b8;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  transition: color 0.15s;
}

.nav-group-label {
  flex: 1;
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}

.nav-group-chevron {
  font-size: 11px;
  color: #9ca3af;
  flex-shrink: 0;
  transition: transform 0.2s;
}

/* Children */
.nav-group-children {
  padding: 2px 0 4px 20px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.nav-item:hover {
  background: #f8fafc;
}

.nav-item:hover .nav-label {
  color: #1e293b;
}

.nav-item.active {
  background: #eef2ff;
}

.nav-item.active .nav-indicator {
  opacity: 1;
  transform: scaleY(1);
}

.nav-item.active .nav-label {
  color: #4f46e5;
  font-weight: 500;
}

.nav-indicator {
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #4f46e5;
  opacity: 0;
  transform: scaleY(0.5);
  transition: all 0.2s;
}

.nav-label {
  font-size: 12.5px;
  font-weight: 400;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}

/* ─── Sidebar Footer ─────────────────────────────────────────── */
.sidebar-footer {
  padding: 16px 20px 20px;
  border-top: 1px solid #f1f5f9;
}

.progress-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-label {
  font-size: 12px;
  color: #94a3b8;
}

.progress-bar {
  height: 4px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #4f46e5;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ─── Content ─────────────────────────────────────────────────── */
.docs-content {
  flex: 1;
  min-width: 0;
  padding: 28px 40px 60px;
  overflow-y: auto;
  height: 100vh;
}

/* ─── Content Header ─────────────────────────────────────────── */
.content-header {
  max-width: 820px;
  margin: 0 0 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid #edf0f4;
}

.header-meta {
  margin-bottom: 12px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: #eef2ff;
  color: #4f46e5;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.header-badge i {
  font-size: 12px;
}

.content-title {
  font-size: 32px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.5px;
  margin: 0 0 6px;
  line-height: 1.2;
}

.content-subtitle {
  font-size: 16px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

/* ─── Content Body — Rich HTML Styles ────────────────────────── */
.content-body {
  max-width: 820px;
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: #374151;
}

/* Headings */
.content-body h2 {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin: 36px 0 14px;
  letter-spacing: -0.3px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f3f4f6;
}

.content-body h2:first-child {
  margin-top: 0;
}

.content-body h3 {
  font-size: 17px;
  font-weight: 600;
  color: #1f2937;
  margin: 28px 0 10px;
}

.content-body p {
  margin: 0 0 14px;
  color: #4b5563;
}

.content-body strong {
  color: #1f2937;
  font-weight: 600;
}

.content-body code {
  background: #f3f4f6;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: #4f46e5;
}

.content-body ul,
.content-body ol {
  padding-left: 20px;
  margin: 0 0 14px;
}

.content-body li {
  margin-bottom: 6px;
  color: #4b5563;
}

/* Tables */
.content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.content-body thead {
  background: #f8fafc;
}

.content-body th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 2px solid #e5e7eb;
}

.content-body td {
  padding: 11px 16px;
  border-bottom: 1px solid #f3f4f6;
  color: #4b5563;
}

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

.content-body tr:hover td {
  background: #f9fafb;
}

/* ─── Highlight Box ──────────────────────────────────────────── */
.content-body .highlight-box {
  background: #f0f4ff;
  border: 1px solid #c7d2fe;
  border-radius: 14px;
  padding: 20px 24px;
  margin: 20px 0;
}

.content-body .highlight-box .highlight-title {
  font-size: 15px;
  font-weight: 600;
  color: #3730a3;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.content-body .highlight-box p,
.content-body .highlight-box li {
  color: #3730a3;
}

.content-body .highlight-box ul {
  margin-bottom: 0;
}

.content-body .highlight-box--danger {
  border-color: #fecaca;
  background: #fef2f2;
}

.content-body .highlight-box--danger p,
.content-body .highlight-box--danger li {
  color: #991b1b;
}

/* ─── Feature Grid ───────────────────────────────────────────── */
.content-body .features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.content-body .feature-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px;
  transition: all 0.15s;
}

.content-body .feature-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.08);
}

.content-body .feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.content-body .feature-icon i {
  font-size: 18px;
  color: #ffffff;
}

.content-body .feature-icon.blue { background: #2563eb; }
.content-body .feature-icon.indigo { background: #4f46e5; }
.content-body .feature-icon.orange { background: #ea580c; }
.content-body .feature-icon.green { background: #16a34a; }
.content-body .feature-icon.purple { background: #7c3aed; }

.content-body .feature-label {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.content-body .feature-desc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

/* ─── Steps List ─────────────────────────────────────────────── */
.content-body .steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.content-body .step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  transition: all 0.15s;
}

.content-body .step-item:hover {
  border-color: #c7d2fe;
  background: #fafafe;
}

.content-body .step-number {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #4f46e5;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.content-body .step-text {
  font-size: 14.5px;
  color: #374151;
  line-height: 1.5;
  padding-top: 4px;
}

/* ─── Callout ────────────────────────────────────────────────── */
.content-body .callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  margin: 20px 0;
  font-size: 14px;
}

.content-body .callout i {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.content-body .callout.info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.content-body .callout.info i {
  color: #2563eb;
}

.content-body .callout.warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.content-body .callout.warning i {
  color: #d97706;
}

/* ─── Image Placeholder ──────────────────────────────────────── */
.content-body .image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 24px;
  background: #f9fafb;
  border: 2px dashed #d1d5db;
  border-radius: 14px;
  margin: 20px 0;
  color: #9ca3af;
  text-align: center;
}

.content-body .image-placeholder i {
  font-size: 32px;
}

.content-body .image-placeholder span {
  font-size: 13px;
  font-weight: 500;
}

/* Manual Image */
.content-body .manual-image {
  margin: 20px 0;
  text-align: center;
}

.content-body .manual-image img {
  max-width: 100%;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Inline Mockups */
.content-body .mockup-container {
  margin: 24px 0;
  text-align: center;
}

.content-body .mockup-frame {
  display: inline-block;
  width: 100%;
  max-width: 600px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  background: #ffffff;
}

.content-body .mockup-caption {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.content-body .image-caption {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

/* ─── Navigation Path ────────────────────────────────────────── */
.content-body .nav-path {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 16px;
  flex-wrap: wrap;
}

.content-body .nav-step {
  padding: 4px 12px;
  background: #f3f4f6;
  border-radius: 8px;
  font-size: 13px;
  color: #4b5563;
  font-weight: 500;
}

.content-body .nav-step.active {
  background: #eef2ff;
  color: #4f46e5;
  font-weight: 600;
}

.content-body .nav-path > i {
  font-size: 11px;
  color: #9ca3af;
}

/* ─── Comparison Grid ────────────────────────────────────────── */
.content-body .comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.content-body .comparison-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
}

.content-body .comparison-header {
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.content-body .comparison-header i {
  font-size: 16px;
}

.content-body .comparison-header.gestor {
  color: #4f46e5;
}

.content-body .comparison-header.gestor i {
  color: #4f46e5;
}

.content-body .comparison-header.colaborador {
  color: #475569;
}

.content-body .comparison-header.colaborador i {
  color: #475569;
}

.content-body .comparison-header.success {
  color: #166534;
  background: #f0fdf4;
  border-bottom-color: #bbf7d0;
}

.content-body .comparison-header.success i {
  color: #22c55e;
}

.content-body .comparison-header.danger {
  color: #991b1b;
  background: #fef2f2;
  border-bottom-color: #fecaca;
}

.content-body .comparison-header.danger i {
  color: #ef4444;
}

.content-body .comparison-header.warning {
  color: #92400e;
  background: #fffbeb;
  border-bottom-color: #fde68a;
}

.content-body .comparison-header.warning i {
  color: #eab308;
}

.content-body .comparison-header.neutral {
  color: #374151;
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

.content-body .comparison-header.neutral i {
  color: #6b7280;
}

.content-body .comparison-body {
  padding: 16px 18px;
  background: #ffffff;
}

.content-body .comparison-body p,
.content-body .comparison-body li {
  font-size: 14px;
  color: #4b5563;
}

.content-body .comparison-body ul {
  margin: 0;
  padding-left: 18px;
}

/* ─── FAQ List (accordion com details/summary) ───────────────── */
.content-body .faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 20px 0;
}

.content-body .faq-item {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.content-body .faq-item summary {
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  background: #f9fafb;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  transition: background 0.15s;
}

.content-body .faq-item summary::-webkit-details-marker {
  display: none;
}

.content-body .faq-item summary i {
  color: #6b7280;
  font-size: 14px;
}

.content-body .faq-item summary::after {
  content: '\e901';
  font-family: 'primeicons';
  margin-left: auto;
  font-size: 11px;
  color: #9ca3af;
  transition: transform 0.2s;
}

.content-body .faq-item summary:hover {
  background: #f1f5f9;
}

.content-body .faq-item[open] summary::after {
  transform: rotate(90deg);
}

.content-body .faq-answer {
  padding: 14px 18px;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.6;
  border-top: 1px solid #f1f5f9;
}

/* ─── Small Note ─────────────────────────────────────────────── */
.content-body .small-note {
  font-size: 12px;
  color: #6b7280;
}

/* ─── Requirements Grid ──────────────────────────────────────── */
.content-body .requirements-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 16px 0;
}

.content-body .req-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #f0fdf4;
  border-radius: 10px;
  font-size: 13.5px;
  color: #166534;
}

.content-body .req-item i {
  color: #22c55e;
  font-size: 14px;
}

/* ─── Checklist ──────────────────────────────────────────────── */
.content-body .checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}

.content-body .check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  font-size: 14px;
  color: #166534;
}

.content-body .check-item i {
  color: #22c55e;
  font-size: 16px;
}

/* ─── Org Tree Visual ────────────────────────────────────────── */
.content-body .org-tree-example {
  padding: 24px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  margin: 20px 0;
}

.content-body .tree-node {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}

.content-body .tree-node.ceo { background: #4f46e5; color: #ffffff; }
.content-body .tree-node.director { background: #818cf8; color: #ffffff; }
.content-body .tree-node.manager { background: #c7d2fe; color: #3730a3; }
.content-body .tree-node.member { background: #e0e7ff; color: #4338ca; }

.content-body .tree-branch {
  padding-left: 28px;
  margin-top: 4px;
  border-left: 2px solid #d1d5db;
}

/* ─── Content Navigation (prev/next) ────────────────────────── */
.content-nav {
  max-width: 820px;
  margin: 48px 0 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid #edf0f4;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s;
  max-width: 48%;
}

.nav-btn:hover {
  border-color: #c7d2fe;
  background: #fafafe;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.06);
}

.nav-btn i {
  font-size: 16px;
  color: #4f46e5;
  flex-shrink: 0;
}

.nav-btn.next {
  margin-left: auto;
  text-align: right;
}

.nav-btn-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nav-btn-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-btn-title {
  font-size: 14px;
  color: #1f2937;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Responsive: Tablet (max-width: 1024px) ─────────────────── */
@media (max-width: 1024px) {
  .docs-content {
    padding: 32px 28px 48px;
  }
}

/* ─── Tablet Sidebar — Icons Only (768px < w <= 1024px) ─────── */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Overlay also shown on tablet when sidebar expands via click */
  .sidebar-overlay {
    display: none;
  }
  .sidebar-overlay.visible {
    display: block;
    opacity: 1;
  }

  /* Collapsed state — icons only */
  .docs-sidebar.tablet-collapsed {
    width: 68px;
    overflow: hidden;
    cursor: pointer;
    transition: width 0.3s ease;
  }

  /* Hover expands the sidebar without needing a click */
  .docs-sidebar.tablet-collapsed:hover {
    width: 300px;
    overflow-y: auto;
    cursor: default;
  }

  /* Hide text/secondary elements when collapsed and NOT hovered */
  .docs-sidebar.tablet-collapsed:not(:hover) .brand-text,
  .docs-sidebar.tablet-collapsed:not(:hover) .nav-group-label,
  .docs-sidebar.tablet-collapsed:not(:hover) .nav-group-chevron,
  .docs-sidebar.tablet-collapsed:not(:hover) .nav-group-children,
  .docs-sidebar.tablet-collapsed:not(:hover) .sidebar-search,
  .docs-sidebar.tablet-collapsed:not(:hover) .sidebar-footer {
    display: none;
  }

  /* When collapsed AND hovered, show full sidebar contents */
  .docs-sidebar.tablet-collapsed:hover .brand-text,
  .docs-sidebar.tablet-collapsed:hover .nav-group-label,
  .docs-sidebar.tablet-collapsed:hover .nav-group-chevron,
  .docs-sidebar.tablet-collapsed:hover .sidebar-search,
  .docs-sidebar.tablet-collapsed:hover .sidebar-footer {
    display: revert;
  }

  .docs-sidebar.tablet-collapsed .sidebar-header {
    justify-content: center;
    padding: 20px 0 16px;
    transition: justify-content 0.3s, padding 0.3s;
  }

  .docs-sidebar.tablet-collapsed:hover .sidebar-header {
    justify-content: space-between;
    padding: 20px 20px 16px;
  }

  .docs-sidebar.tablet-collapsed .sidebar-brand i {
    font-size: 22px;
    margin: 0;
  }

  .docs-sidebar.tablet-collapsed .sidebar-close {
    display: none;
  }

  .docs-sidebar.tablet-collapsed .sidebar-nav {
    padding: 8px 0;
    align-items: center;
    transition: padding 0.3s;
  }

  .docs-sidebar.tablet-collapsed:hover .sidebar-nav {
    padding: 8px 10px;
    align-items: stretch;
  }

  .docs-sidebar.tablet-collapsed .nav-group {
    width: 100%;
  }

  .docs-sidebar.tablet-collapsed .nav-group-header {
    justify-content: center;
    padding: 12px 0;
    position: relative;
    transition: justify-content 0.3s, padding 0.3s;
  }

  .docs-sidebar.tablet-collapsed:hover .nav-group-header {
    justify-content: flex-start;
    padding: 10px 14px;
  }

  /* Tooltip on hover for icons — only visible when NOT expanding (narrow state) */
  .docs-sidebar.tablet-collapsed:not(:hover) .nav-group-header::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 300;
    opacity: 0;
    transition: opacity 0.15s;
  }

  /* Show tooltip only on hover of each icon row (when sidebar itself is not hovered yet) */
  /* This state won't trigger because :not(:hover) on parent blocks it — intentional */
  .docs-sidebar.tablet-collapsed .nav-group-icon {
    font-size: 18px;
    width: auto;
  }

  /* Expanded state — full sidebar (via JS click, becomes overlay) */
  .docs-sidebar.tablet-expanded {
    width: 300px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 160;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    transition: width 0.3s ease;
  }
}

/* ─── Responsive: Mobile (max-width: 768px) ──────────────────── */
@media (max-width: 768px) {
  /* Show mobile header */
  .mobile-header {
    display: flex;
  }

  /* Show overlay when active */
  .sidebar-overlay {
    display: block;
  }

  /* Push content down to not be covered by mobile header */
  .docs-shell {
    flex-direction: column;
  }

  /* Sidebar becomes a fixed overlay on mobile */
  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 160;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

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

  /* Show close button */
  .sidebar-close {
    display: flex;
  }

  /* Sidebar brand hidden on very small screens */
  .sidebar-header {
    padding: 20px 16px 14px;
  }

  /* Content takes full width and starts below mobile header */
  .docs-content {
    padding: 20px 20px 40px;
    margin-top: 56px; /* height of .mobile-header */
    height: calc(100vh - 56px);
    width: 100%;
  }

  .content-title {
    font-size: 24px;
  }

  /* Stack nav buttons */
  .content-nav {
    flex-direction: column;
  }

  .nav-btn {
    max-width: 100%;
  }

  .nav-btn.next {
    margin-left: 0;
    text-align: left;
  }

  /* Single column grids */
  .content-body .features-grid {
    grid-template-columns: 1fr;
  }

  .content-body .comparison-grid {
    grid-template-columns: 1fr;
  }

  /* Table: allow horizontal scroll */
  .content-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
