/* ========================================================================
   Central de Ajuda — drawer lateral (montado dentro do dashboard)
   Acionado pelo botão "?" no menu superior (#btnQuickHelp)
   ======================================================================== */

/* Backdrop */
.help-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.help-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Drawer container — desliza da direita */
.help-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(720px, 100%);
  background: var(--tblr-bg-surface, #fff);
  z-index: 2001;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: -24px 0 60px -20px rgba(15, 23, 42, 0.35);
}
.help-drawer.is-open { transform: translateX(0); }

[data-bs-theme="dark"] .help-drawer {
  background: #1a2234;
  color: #e2e8f0;
}

/* Header do drawer */
.help-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(135deg, #066fd1 0%, #06b6d4 100%);
  color: #fff;
}
.help-drawer__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: calc(1.05rem * var(--aia-text-scale, 1));
  font-weight: 600;
  margin: 0;
}
.help-drawer__title-pill {
  background: rgba(255,255,255,0.18);
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-size: calc(0.7rem * var(--aia-text-scale, 1));
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}
.help-drawer__close {
  background: rgba(255,255,255,0.12);
  border: 0;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}
.help-drawer__close:hover { background: rgba(255,255,255,0.25); }

/* Tabs/abas internas (navegação por seção) */
.help-drawer__tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding: 0 0.5rem;
  gap: 0.25rem;
  background: var(--tblr-bg-surface-tertiary, #f8fafc);
  flex-shrink: 0;
  scrollbar-width: thin;
}
[data-bs-theme="dark"] .help-drawer__tabs {
  background: #232f44;
  border-bottom-color: rgba(255,255,255,0.08);
}
.help-tab {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  padding: 0.6rem 0.85rem;
  font-size: calc(0.825rem * var(--aia-text-scale, 1));
  font-weight: 500;
  color: var(--tblr-secondary, #64748b);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.help-tab:hover { color: #066fd1; }
.help-tab.is-active {
  color: #066fd1;
  border-bottom-color: #066fd1;
  font-weight: 600;
}
[data-bs-theme="dark"] .help-tab { color: #94a3b8; }
[data-bs-theme="dark"] .help-tab.is-active { color: #06b6d4; border-bottom-color: #06b6d4; }

/* Conteúdo scrollável */
.help-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 2rem;
  scroll-behavior: smooth;
}
.help-drawer__body::-webkit-scrollbar { width: 6px; }
.help-drawer__body::-webkit-scrollbar-thumb { background: rgba(15,23,42,0.18); border-radius: 3px; }

/* Seções (cada aba) */
.help-section { display: none; }
.help-section.is-active { display: block; animation: helpFadeIn 0.22s ease; }

@keyframes helpFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Bloco de conteúdo */
.help-section h3 {
  font-size: calc(1.1rem * var(--aia-text-scale, 1));
  font-weight: 700;
  color: var(--tblr-body-color, #0f172a);
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.help-section h4 {
  font-size: calc(0.95rem * var(--aia-text-scale, 1));
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
  color: var(--tblr-body-color, #0f172a);
}
.help-section p,
.help-section li {
  font-size: calc(0.875rem * var(--aia-text-scale, 1));
  line-height: 1.55;
  color: var(--tblr-secondary, #475569);
}
[data-bs-theme="dark"] .help-section h3,
[data-bs-theme="dark"] .help-section h4 { color: #f1f5f9; }
[data-bs-theme="dark"] .help-section p,
[data-bs-theme="dark"] .help-section li { color: #cbd5e1; }

.help-section ul { padding-left: 1.1rem; margin: 0.4rem 0 0.8rem; }
.help-section li { margin-bottom: 0.3rem; }

/* Cards de cards (descrição de métricas) */
.help-card {
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  background: var(--tblr-bg-surface, #fff);
}
[data-bs-theme="dark"] .help-card {
  background: #232f44;
  border-color: rgba(255,255,255,0.08);
}
.help-card__title {
  font-weight: 600;
  font-size: calc(0.875rem * var(--aia-text-scale, 1));
  color: var(--tblr-body-color, #0f172a);
  margin: 0 0 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
[data-bs-theme="dark"] .help-card__title { color: #f1f5f9; }
.help-card__desc {
  font-size: calc(0.825rem * var(--aia-text-scale, 1));
  color: var(--tblr-secondary, #64748b);
  margin: 0;
  line-height: 1.5;
}
.help-card__badge {
  display: inline-block;
  font-size: calc(0.65rem * var(--aia-text-scale, 1));
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #cffafe;
  color: #0e7490;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.help-card__badge--admin { background: #fce7f3; color: #be185d; }

/* Callout */
.help-callout {
  border-left: 3px solid #066fd1;
  background: #eff6ff;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin: 0.75rem 0;
  font-size: calc(0.85rem * var(--aia-text-scale, 1));
}
[data-bs-theme="dark"] .help-callout { background: rgba(6,111,209,0.12); color: #dbeafe; }
.help-callout--warn {
  border-left-color: #f59e0b;
  background: #fef3c7;
}
[data-bs-theme="dark"] .help-callout--warn { background: rgba(245,158,11,0.12); color: #fef3c7; }

/* FAQ accordion */
.help-faq details {
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: var(--tblr-bg-surface, #fff);
}
[data-bs-theme="dark"] .help-faq details {
  background: #232f44;
  border-color: rgba(255,255,255,0.08);
}
.help-faq summary {
  list-style: none;
  cursor: pointer;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: calc(0.875rem * var(--aia-text-scale, 1));
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.help-faq summary::-webkit-details-marker { display: none; }
.help-faq summary::after {
  content: "+";
  font-size: calc(1.15rem * var(--aia-text-scale, 1));
  font-weight: 400;
  color: #066fd1;
  transition: transform 0.2s ease;
}
.help-faq details[open] summary::after { content: "−"; }
.help-faq details p,
.help-faq details ul {
  padding: 0 1rem 0.85rem;
  font-size: calc(0.85rem * var(--aia-text-scale, 1));
  margin: 0;
}

/* Passo a passo numerado */
.help-steps { counter-reset: step; padding: 0; list-style: none; margin: 0.5rem 0 1rem; }
.help-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.25rem;
  margin-bottom: 0.85rem;
  font-size: calc(0.875rem * var(--aia-text-scale, 1));
  line-height: 1.55;
}
.help-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, #066fd1, #06b6d4);
  color: #fff;
  font-weight: 700;
  font-size: calc(0.8rem * var(--aia-text-scale, 1));
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Tag inline (botão/aba reference) */
.help-tag {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: calc(0.78rem * var(--aia-text-scale, 1));
  background: rgba(6,111,209,0.1);
  color: #066fd1;
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}
[data-bs-theme="dark"] .help-tag { background: rgba(6,182,212,0.18); color: #67e8f9; }

/* Responsivo: drawer ocupa quase tela toda em mobile */
@media (max-width: 640px) {
  .help-drawer { width: 100%; }
  .help-drawer__body { padding: 1rem; }
  .help-section h3 { font-size: calc(1rem * var(--aia-text-scale, 1)); }
}
