/* ==========================================================================
   ContabiliTudo - Tema Claro / Escuro / Dispositivo
   O <html> recebe data-theme="light|dark" (aplicado no <head>) e
   data-theme-pref="light|dark|system" (a escolha do usuário).
   Todo o modo escuro fica em @media screen: impressão sai sempre no claro.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Seletor de tema (Claro / Escuro / Dispositivo)
   -------------------------------------------------------------------------- */
.ct-theme-toggle {
  --ct-tt-bg: #f1f5f9;
  --ct-tt-border: #e2e8f0;
  --ct-tt-fg: #64748b;
  --ct-tt-fg-hover: #0f172a;
  --ct-tt-active-bg: #ffffff;
  --ct-tt-active-fg: #4f46e5;
  --ct-tt-active-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  margin: 0;
  background: var(--ct-tt-bg);
  border: 1px solid var(--ct-tt-border);
  border-radius: 8px;
  flex-shrink: 0;
  box-sizing: border-box;
  vertical-align: middle;
}

.ct-theme-toggle__btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 30px;
  height: 28px;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ct-tt-fg);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 150ms ease, color 150ms ease;
}

.ct-theme-toggle__btn svg {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ct-theme-toggle__btn:hover {
  color: var(--ct-tt-fg-hover);
}

.ct-theme-toggle__btn:focus-visible {
  outline: 2px solid var(--color-primary, #4f46e5);
  outline-offset: 1px;
}

/* Estado ativo vem do <html>, então já aparece certo antes do JS carregar */
html[data-theme-pref="light"] .ct-theme-toggle__btn[data-ct-theme-set="light"],
html[data-theme-pref="dark"] .ct-theme-toggle__btn[data-ct-theme-set="dark"],
html[data-theme-pref="system"] .ct-theme-toggle__btn[data-ct-theme-set="system"] {
  background: var(--ct-tt-active-bg);
  color: var(--ct-tt-active-fg);
  box-shadow: var(--ct-tt-active-shadow);
}

/* Variante com rótulos (gaveta mobile, rodapé, login) */
.ct-theme-toggle--labels .ct-theme-toggle__btn {
  width: auto;
  height: 30px;
  padding: 0 10px;
}

/* Variante sobre fundo escuro fixo (rodapé público) */
.ct-theme-toggle--on-dark {
  --ct-tt-bg: rgba(255, 255, 255, 0.05);
  --ct-tt-border: rgba(255, 255, 255, 0.1);
  --ct-tt-fg: #94a3b8;
  --ct-tt-fg-hover: #ffffff;
  --ct-tt-active-bg: rgba(255, 255, 255, 0.14);
  --ct-tt-active-fg: #ffffff;
  --ct-tt-active-shadow: none;
}

/* Posicionamento por área */
.ct-footer-theme {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.ct-mobile-drawer-theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 20px;
  padding: 12px 0 0;
  border-top: 1px solid var(--color-slate-200, #e2e8f0);
}

.ct-mobile-drawer-theme__label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-slate-600, #475569);
}

.ct-auth-theme {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

/* --------------------------------------------------------------------------
   Menu do usuário (painel e portal): avatar + nome; abre tema e links da conta
   -------------------------------------------------------------------------- */
.ct-user-menu {
  --ct-um-bg: #ffffff;
  --ct-um-bg-hover: #f8fafc;
  --ct-um-border: #e2e8f0;
  --ct-um-ink: #0f172a;
  --ct-um-muted: #64748b;
  --ct-um-panel-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.06);
  --ct-um-avatar-bg: #eef2ff;
  --ct-um-avatar-fg: #4f46e5;
  --ct-um-danger: #be123c;
  --ct-um-danger-bg: #fff1f2;
  position: relative;
  display: inline-flex;
  font-family: inherit;
}

.ct-user-menu--admin {
  --ct-um-avatar-bg: #3b82f6;
  --ct-um-avatar-fg: #ffffff;
}

.ct-user-menu__trigger {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0;
  padding: 5px 10px 5px 6px;
  background: var(--ct-um-bg);
  border: 1px solid var(--ct-um-border);
  border-radius: 8px;
  color: var(--ct-um-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: background-color 150ms ease, border-color 150ms ease;
}

.ct-user-menu__trigger:hover,
.ct-user-menu.is-open .ct-user-menu__trigger {
  background: var(--ct-um-bg-hover);
  border-color: #cbd5e1;
}

.ct-user-menu__trigger:focus-visible {
  outline: 2px solid var(--color-primary, #4f46e5);
  outline-offset: 2px;
}

.ct-user-menu__avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--ct-um-avatar-bg);
  color: var(--ct-um-avatar-fg);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ct-user-menu__meta,
.ct-user-menu__head {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.ct-user-menu__name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ct-um-ink);
}

.ct-user-menu__sub {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  color: var(--ct-um-muted);
}

.ct-user-menu__chevron {
  flex-shrink: 0;
  color: var(--ct-um-muted);
  transition: transform 150ms ease;
}

.ct-user-menu.is-open .ct-user-menu__chevron {
  transform: rotate(180deg);
}

/* Lembrete do tema: ponto no avatar + balão, até o menu ser aberto uma vez */
.ct-user-menu__dot {
  display: none;
  position: absolute;
  top: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 2px var(--ct-um-bg);
}

.ct-user-menu__tip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 5;
  width: max-content;
  max-width: 230px;
  padding: 7px 10px;
  border-radius: 6px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 6px 16px -6px rgba(15, 23, 42, 0.4);
  pointer-events: none;
}

.ct-user-menu__tip::before {
  content: "";
  position: absolute;
  top: -4px;
  right: 18px;
  width: 8px;
  height: 8px;
  background: inherit;
  transform: rotate(45deg);
}

.ct-user-menu.has-theme-hint .ct-user-menu__dot,
.ct-user-menu.has-theme-hint:not(.is-open) .ct-user-menu__tip {
  display: block;
}

/* Painel suspenso */
.ct-user-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1000;
  width: 300px;
  max-width: calc(100vw - 32px);
  padding: 12px;
  background: var(--ct-um-bg);
  border: 1px solid var(--ct-um-border);
  border-radius: 8px;
  box-shadow: var(--ct-um-panel-shadow);
  box-sizing: border-box;
}

.ct-user-menu__panel[hidden] {
  display: none;
}

.ct-user-menu__head {
  padding: 2px 4px 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--ct-um-border);
}

.ct-user-menu__head .ct-user-menu__name,
.ct-user-menu__head .ct-user-menu__sub {
  max-width: 100%;
}

.ct-user-menu__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ct-user-menu__label {
  padding: 0 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ct-um-muted);
}

.ct-user-menu .ct-user-menu__theme {
  display: flex;
  width: 100%;
}

.ct-user-menu .ct-user-menu__theme .ct-theme-toggle__btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 8px;
  gap: 5px;
}

.ct-user-menu__links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--ct-um-border);
}

.ct-user-menu__link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--ct-um-ink);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 130ms ease, color 130ms ease;
}

.ct-user-menu__link:hover,
.ct-user-menu__link:focus-visible {
  background: var(--ct-um-bg-hover);
  color: var(--ct-um-ink);
}

.ct-user-menu__link svg,
.ct-user-menu__link .dashicons {
  width: 16px;
  height: 16px;
  font-size: 16px;
  flex-shrink: 0;
}

.ct-user-menu__link.is-danger,
.ct-user-menu__link.is-danger:hover {
  color: var(--ct-um-danger);
}

.ct-user-menu__link.is-danger:hover {
  background: var(--ct-um-danger-bg);
}

/* Só o avatar (header do painel no celular) */
.ct-user-menu--compact .ct-user-menu__trigger {
  gap: 6px;
  padding-right: 8px;
}

/* Painel: o menu da conta fica no canto direito do cabeçalho de cada tela */
.ct-ap .ct-topbar__user-menu {
  display: inline-flex;
  flex-shrink: 0;
  margin-left: auto;
}

/* Portal no celular: o botão do menu ocupa a linha toda */
@media (max-width: 900px) {
  .ct-portal-topbar-actions .ct-user-menu,
  .ct-portal-topbar-actions .ct-user-menu__trigger {
    width: 100%;
  }

  .ct-portal-topbar-actions .ct-user-menu__meta {
    flex: 1;
  }

  .ct-portal-topbar-actions .ct-user-menu__name,
  .ct-portal-topbar-actions .ct-user-menu__sub {
    max-width: 100%;
  }
}

/* --------------------------------------------------------------------------
   2. Logos: versão para fundo claro x fundo escuro
   -------------------------------------------------------------------------- */
.ct-logo-on-dark {
  display: none !important;
}

/* Sem transições enquanto o tema troca (evita cores "arrastando") */
html.ct-theme-switching *,
html.ct-theme-switching *::before,
html.ct-theme-switching *::after {
  transition: none !important;
}

@media screen {
  /* ------------------------------------------------------------------------
     3. Cores fixas convertidas em var(--ctdk-*) (no claro vale o valor original)
     ------------------------------------------------------------------------ */
  :root[data-theme="dark"] {
    --ctdk-bd-a7f3d0: hsl(152 40% 30%);
    --ctdk-bd-bae6fd: hsl(201 40% 30%);
    --ctdk-bd-bbf7d0: hsl(141 40% 30%);
    --ctdk-bd-bfdbfe: hsl(213 40% 30%);
    --ctdk-bd-c7d2fe: hsl(228 40% 30%);
    --ctdk-bd-cbd5e1: #3b4a63;
    --ctdk-bd-cccccc: #3b4a63;
    --ctdk-bd-cfd7e6: #3b4a63;
    --ctdk-bd-d1fae5: hsl(149 40% 30%);
    --ctdk-bd-d7dde8: #3b4a63;
    --ctdk-bd-dbeafe: hsl(214 40% 30%);
    --ctdk-bd-ddd6fe: hsl(251 40% 30%);
    --ctdk-bd-e0e7ff: hsl(226 40% 30%);
    --ctdk-bd-e2e8f0: #2a3750;
    --ctdk-bd-f1f5f9: #2a3750;
    --ctdk-bd-f6c9d3: hsl(347 40% 30%);
    --ctdk-bd-f8fafc: #2a3750;
    --ctdk-bd-fca5a5: hsl(0 40% 30%);
    --ctdk-bd-fde68a: hsl(48 40% 30%);
    --ctdk-bd-fecaca: hsl(0 40% 30%);
    --ctdk-bd-fecdd3: hsl(353 40% 30%);
    --ctdk-bd-fed7aa: hsl(32 40% 30%);
    --ctdk-bg-d1fae5: hsl(149 45% 19%);
    --ctdk-bg-dcfce7: hsl(141 45% 15%);
    --ctdk-bg-e0e7ff: hsl(226 45% 15%);
    --ctdk-bg-e0f2fe: hsl(204 45% 15%);
    --ctdk-bg-e2e8f0: #243049;
    --ctdk-bg-ecfdf5: hsl(152 45% 15%);
    --ctdk-bg-ede9fe: hsl(251 45% 15%);
    --ctdk-bg-eef2ff: hsl(226 45% 15%);
    --ctdk-bg-eff6ff: hsl(214 45% 15%);
    --ctdk-bg-f0f7ff: hsl(212 45% 15%);
    --ctdk-bg-f0f9ff: hsl(204 45% 15%);
    --ctdk-bg-f0fdf4: hsl(138 45% 15%);
    --ctdk-bg-f1f5f9: #162033;
    --ctdk-bg-f8fafc: #162033;
    --ctdk-bg-f8faff: hsl(223 45% 15%);
    --ctdk-bg-fafaff: hsl(240 45% 15%);
    --ctdk-bg-fbdde3: hsl(348 45% 15%);
    --ctdk-bg-fcfdfe: #111a2b;
    --ctdk-bg-fee2e2: hsl(0 45% 15%);
    --ctdk-bg-fef2f2: hsl(0 45% 15%);
    --ctdk-bg-fef3c7: hsl(48 45% 19%);
    --ctdk-bg-ffe4e6: hsl(356 45% 15%);
    --ctdk-bg-ffedd5: hsl(34 45% 15%);
    --ctdk-bg-fff1f2: hsl(356 45% 15%);
    --ctdk-bg-fff7ed: hsl(33 45% 15%);
    --ctdk-bg-fffaf5: hsl(30 45% 15%);
    --ctdk-bg-fffbeb: hsl(48 45% 15%);
    --ctdk-bg-ffffff: #111a2b;
    --ctdk-fg-0369a1: hsl(201 85% 72%);
    --ctdk-fg-047857: hsl(163 85% 76%);
    --ctdk-fg-059669: hsl(161 85% 72%);
    --ctdk-fg-065f46: hsl(163 85% 80%);
    --ctdk-fg-0f172a: #f1f5f9;
    --ctdk-fg-10b981: hsl(160 84% 72%);
    --ctdk-fg-14532d: hsl(144 61% 80%);
    --ctdk-fg-15803d: hsl(142 72% 72%);
    --ctdk-fg-166534: hsl(143 64% 76%);
    --ctdk-fg-1d4ed8: hsl(224 76% 72%);
    --ctdk-fg-1e293b: #e2e8f0;
    --ctdk-fg-1e40af: hsl(226 71% 72%);
    --ctdk-fg-2563eb: hsl(221 83% 72%);
    --ctdk-fg-334155: #cbd5e1;
    --ctdk-fg-3730a3: hsl(244 55% 72%);
    --ctdk-fg-431407: hsl(13 81% 85%);
    --ctdk-fg-475569: #cbd5e1;
    --ctdk-fg-4f46e5: hsl(243 75% 72%);
    --ctdk-fg-64748b: #94a3b8;
    --ctdk-fg-6d28d9: hsl(263 70% 72%);
    --ctdk-fg-92400e: hsl(23 83% 72%);
    --ctdk-fg-991b1b: hsl(0 70% 72%);
    --ctdk-fg-9a3412: hsl(15 79% 72%);
    --ctdk-fg-9f1239: hsl(343 80% 72%);
    --ctdk-fg-a16207: hsl(35 85% 72%);
    --ctdk-fg-b4324c: hsl(348 57% 72%);
    --ctdk-fg-b45309: hsl(26 85% 72%);
    --ctdk-fg-b91c1c: hsl(0 74% 72%);
    --ctdk-fg-be123c: hsl(345 83% 72%);
    --ctdk-fg-c2410c: hsl(17 85% 72%);
    --ctdk-fg-d97706: hsl(32 85% 72%);
    --ctdk-fg-dc2626: hsl(0 72% 72%);
    --ctdk-fg-e11d48: hsl(347 77% 72%);
    --ctdk-fg-ea580c: hsl(21 85% 72%);
  }

  /* ------------------------------------------------------------------------
     4. Tokens do modo escuro (site público, checkout, LPs e portal)
     A escala slate é invertida: texto escuro vira claro, fundo claro vira escuro.
     ------------------------------------------------------------------------ */
  :root[data-theme="dark"] {
    color-scheme: dark;
    --color-slate-950: #f8fafc;
    --color-slate-900: #f1f5f9 !important; /* vence a cor secundária das Opções do Tema */
    --color-slate-800: #e2e8f0;
    --color-slate-700: #cbd5e1;
    --color-slate-600: #a8b5c7;
    --color-slate-500: #8d9bb0;
    --color-slate-400: #7d8ca3;
    --color-slate-300: #3b4a63;
    --color-slate-200: #2a3750;
    --color-slate-100: #1a2438;
    --color-slate-50: #162033;

    /* Texto na cor da marca: versão mais clara para ler sobre fundo escuro */
    --ct-primary-text: color-mix(in srgb, var(--color-primary) 50%, #ffffff);
    --color-primary-light: rgba(99, 102, 241, 0.16);
    --color-primary-subtle: rgba(99, 102, 241, 0.24);

    --color-success-bg: rgba(16, 185, 129, 0.14);
    --color-success-text: #6ee7b7;
    --color-warning-bg: rgba(245, 158, 11, 0.14);
    --color-warning-text: #fcd34d;
    --color-danger-bg: rgba(244, 63, 94, 0.14);
    --color-danger-text: #fda4af;
    --color-info-bg: rgba(14, 165, 233, 0.14);
    --color-info-text: #7dd3fc;

    --bg-app: #0b1220 !important;
    --color-neutral: #0b1220 !important;
    --bg-surface: #111a2b;
    --bg-surface-elevated: #162033;
    --bg-subtle: #1a2438;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 20px -4px rgba(0, 0, 0, 0.45);
    --shadow-xl: 0 12px 28px -6px rgba(0, 0, 0, 0.5);
  }

  [data-theme="dark"] body {
    background-color: var(--bg-app);
  }

  /* Logos */
  [data-theme="dark"] .ct-logo-on-light {
    display: none !important;
  }

  [data-theme="dark"] .ct-logo-on-dark {
    display: block !important;
  }

  /* Menu do usuário no escuro */
  [data-theme="dark"] .ct-user-menu {
    --ct-um-bg: #111a2b;
    --ct-um-bg-hover: #1a2438;
    --ct-um-border: #26324a;
    --ct-um-ink: #f1f5f9;
    --ct-um-muted: #94a3b8;
    --ct-um-panel-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.7);
    --ct-um-avatar-bg: rgba(99, 102, 241, 0.2);
    --ct-um-avatar-fg: #c7d2fe;
    --ct-um-danger: #fda4af;
    --ct-um-danger-bg: rgba(244, 63, 94, 0.14);
  }

  [data-theme="dark"] .ct-user-menu--admin {
    --ct-um-avatar-bg: #3b82f6;
    --ct-um-avatar-fg: #ffffff;
  }

  [data-theme="dark"] .ct-user-menu__trigger:hover,
  [data-theme="dark"] .ct-user-menu.is-open .ct-user-menu__trigger {
    border-color: #3b4a63;
  }

  [data-theme="dark"] .ct-user-menu__tip {
    background: #e2e8f0;
    color: #0f172a;
  }

  /* Seletor no escuro */
  [data-theme="dark"] .ct-theme-toggle {
    --ct-tt-bg: #162033;
    --ct-tt-border: #26324a;
    --ct-tt-fg: #94a3b8;
    --ct-tt-fg-hover: #f1f5f9;
    --ct-tt-active-bg: #2a3750;
    --ct-tt-active-fg: #ffffff;
    --ct-tt-active-shadow: none;
  }

  [data-theme="dark"] .ct-theme-toggle--on-dark {
    --ct-tt-bg: rgba(255, 255, 255, 0.05);
    --ct-tt-border: rgba(255, 255, 255, 0.1);
    --ct-tt-active-bg: rgba(255, 255, 255, 0.14);
  }

  /* ------------------------------------------------------------------------
     5. Componentes base (main.css)
     ------------------------------------------------------------------------ */
  [data-theme="dark"] .ct-btn-dark {
    background-color: #e2e8f0;
    border-color: #e2e8f0;
    color: #0f172a !important;
  }

  [data-theme="dark"] .ct-btn-dark:hover {
    background-color: #ffffff;
    border-color: #ffffff;
  }

  [data-theme="dark"] .ct-input::placeholder,
  [data-theme="dark"] .ct-form-input::placeholder,
  [data-theme="dark"] textarea::placeholder {
    color: #64748b;
  }

  /* ------------------------------------------------------------------------
     6. Site público (landing.css)
     ------------------------------------------------------------------------ */
  [data-theme="dark"] .ct-header {
    background-color: rgba(11, 18, 32, 0.92);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  [data-theme="dark"] .ct-hero-section {
    background: radial-gradient(100% 100% at 50% 0%, rgba(99, 102, 241, 0.16) 0%, rgba(11, 18, 32, 0) 100%);
  }

  [data-theme="dark"] .ct-floating-card {
    background: rgba(17, 26, 43, 0.96);
    border: 1px solid #26324a;
  }

  [data-theme="dark"] .ct-ticker-section {
    background-color: #070b14;
    color: #cbd5e1;
  }

  [data-theme="dark"] .ct-carousel-section {
    background: linear-gradient(180deg, #0b1220 0%, #111a2b 100%);
  }

  [data-theme="dark"] .ct-story-section {
    background: linear-gradient(180deg, #111a2b 0%, #0b1220 100%);
  }

  [data-theme="dark"] .ct-metrics-section {
    background: linear-gradient(135deg, #070b14 0%, #1e1b4b 100%);
  }

  [data-theme="dark"] .ct-comparison-table td.ct-col-featured {
    background-color: rgba(99, 102, 241, 0.1);
  }

  [data-theme="dark"] .ct-pricing-section {
    background: radial-gradient(100% 70% at 50% 0%, rgba(99, 102, 241, 0.14) 0%, #0b1220 100%) !important;
  }

  [data-theme="dark"] .ct-pricing-card-featured {
    background: linear-gradient(180deg, #111a2b 0%, #171f3d 100%);
  }

  [data-theme="dark"] .ct-footer {
    background-color: #070b14;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  [data-theme="dark"] .ct-footer a {
    color: #94a3b8 !important;
  }

  [data-theme="dark"] .ct-footer a:hover {
    color: #ffffff !important;
  }

  /* Landing pages de segmento */
  [data-theme="dark"] .ct-lp-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(11, 18, 32, 0.97) 0%, rgba(11, 18, 32, 0.9) 48%, rgba(11, 18, 32, 0.45) 100%);
    z-index: 1;
  }

  [data-theme="dark"] .ct-lp-dark-carousel-section {
    background-color: #070b14;
  }

  /* ------------------------------------------------------------------------
     7. Checkout
     ------------------------------------------------------------------------ */
  [data-theme="dark"] .ct-checkout-page-root .blockUI.blockOverlay {
    background: rgba(11, 18, 32, 0.7) !important;
  }

  /* Ícones de status (pedido em análise / aprovado / recusado) */
  [data-theme="dark"] .ct-status-icon-wrap--review {
    background: linear-gradient(135deg, hsl(48 45% 15%) 0%, hsl(48 45% 19%) 100%);
  }

  [data-theme="dark"] .ct-status-icon-wrap--success {
    background: linear-gradient(135deg, hsl(152 45% 15%) 0%, hsl(149 45% 19%) 100%);
  }

  [data-theme="dark"] .ct-status-icon-wrap--error {
    background: linear-gradient(135deg, hsl(356 45% 15%) 0%, hsl(356 45% 19%) 100%);
  }

  [data-theme="dark"] .ct-addons-modal-card {
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 0 1px #26324a;
  }

  /* ------------------------------------------------------------------------
     8. Portal do cliente
     ------------------------------------------------------------------------ */
  /* Sidebar e barras que já eram escuras continuam como no tema claro */
  [data-theme="dark"] .ct-portal-sidebar {
    --color-slate-900: #0a101d !important;
    --color-slate-800: #1a2438;
    --color-slate-400: #94a3b8;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
  }

  [data-theme="dark"] .ct-portal-sidebar .ct-btn-secondary {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e2e8f0 !important;
  }

  [data-theme="dark"] .ct-portal-sidebar .ct-btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #ffffff !important;
  }

  [data-theme="dark"] .ct-portal-mobile-header {
    background-color: #0a101d;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  [data-theme="dark"] .ct-portal-mobile-dock {
    background: rgba(17, 26, 43, 0.96);
    border-color: rgba(255, 255, 255, 0.1);
  }

  [data-theme="dark"] .ct-nfe-filter-tab.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
  }

  [data-theme="dark"] .ct-modal-overlay {
    background: rgba(2, 6, 15, 0.75);
  }

  /* ------------------------------------------------------------------------
     9. Painel Contabilitudo (wp-admin, só a tela SaaS recebe data-theme)
     ------------------------------------------------------------------------ */
  html[data-theme="dark"] body.ct-ap {
    --ct-bg: #0b1220;
    --ct-surface: #111a2b;
    --ct-surface-2: #162033;
    --ct-surface-3: #1a2438;
    --ct-ink: #f1f5f9;
    --ct-ink-2: #cbd5e1;
    --ct-muted: #94a3b8;
    --ct-faint: #7d8ca3;
    --ct-line: #26324a;
    --ct-line-2: #1e293d;
    --ct-primary-text: color-mix(in srgb, var(--ct-primary) 50%, #ffffff);
    --ct-primary-soft: rgba(99, 102, 241, 0.16);
    --ct-primary-ring: rgba(129, 140, 248, 0.3);
    --ct-navy: #070b14;
    --ct-navy-2: #0d1426;
    --ct-success: #34d399;
    --ct-success-soft: rgba(16, 185, 129, 0.14);
    --ct-warning: #fbbf24;
    --ct-warning-soft: rgba(245, 158, 11, 0.14);
    --ct-danger: #fb7185;
    --ct-danger-soft: rgba(244, 63, 94, 0.14);
    --ct-info: #7dd3fc;
    --ct-info-soft: rgba(14, 165, 233, 0.14);
    --ct-sh-1: 0 1px 2px rgba(0, 0, 0, 0.3);
    --ct-sh-2: 0 1px 3px rgba(0, 0, 0, 0.4);
    --ct-sh-3: 0 6px 16px -10px rgba(0, 0, 0, 0.6);
    background: var(--ct-bg);
  }

  html[data-theme="dark"],
  html[data-theme="dark"] body.ct-ap #wpwrap {
    background: #0b1220;
  }

  /* Campos nativos do WP dentro do painel (sem classe própria) */
  html[data-theme="dark"] body.ct-ap-saas #wpbody-content input[type="text"],
  html[data-theme="dark"] body.ct-ap-saas #wpbody-content input[type="email"],
  html[data-theme="dark"] body.ct-ap-saas #wpbody-content input[type="number"],
  html[data-theme="dark"] body.ct-ap-saas #wpbody-content input[type="password"],
  html[data-theme="dark"] body.ct-ap-saas #wpbody-content input[type="search"],
  html[data-theme="dark"] body.ct-ap-saas #wpbody-content input[type="url"],
  html[data-theme="dark"] body.ct-ap-saas #wpbody-content input[type="tel"],
  html[data-theme="dark"] body.ct-ap-saas #wpbody-content input[type="date"],
  html[data-theme="dark"] body.ct-ap-saas #wpbody-content input[type="datetime-local"],
  html[data-theme="dark"] body.ct-ap-saas #wpbody-content input[type="time"],
  html[data-theme="dark"] body.ct-ap-saas #wpbody-content select,
  html[data-theme="dark"] body.ct-ap-saas #wpbody-content textarea,
  html[data-theme="dark"] body.ct-ap-saas .ct-admin-modal-backdrop input[type="text"],
  html[data-theme="dark"] body.ct-ap-saas .ct-admin-modal-backdrop select,
  html[data-theme="dark"] body.ct-ap-saas .ct-admin-modal-backdrop textarea {
    background-color: #162033;
    border-color: #2a3750;
    color: #f1f5f9;
  }

  html[data-theme="dark"] body.ct-ap-saas input[type="checkbox"],
  html[data-theme="dark"] body.ct-ap-saas input[type="radio"] {
    accent-color: #6366f1;
  }

  /* Prévia de logo para fundo claro continua clara */
  html[data-theme="dark"] .ct-ap .ct-logo-preview-box {
    background: #ffffff;
  }

  html[data-theme="dark"] .ct-ap .ct-panel-tile--dark .ct-logo-preview-box {
    background: #05070d;
  }

  /* Botão "salvar" navy e spinner escuro: contorno visível sobre o fundo escuro */
  html[data-theme="dark"] .ct-ap .ct-btn-save-clean {
    border-color: #475569;
    background: #1e293b;
  }

  html[data-theme="dark"] .ct-ap .ct-btn-save-clean:hover {
    background: #334155;
    border-color: #64748b;
  }

  html[data-theme="dark"] .ct-ap .ct-spinner-clean {
    border-color: #475569;
    border-top-color: #e2e8f0;
  }

  html[data-theme="dark"] .ct-ap .ct-admin-mobile-dock {
    background: rgba(17, 26, 43, 0.97);
    box-shadow: 0 10px 26px -12px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  }
}

/* Gaveta mobile: seletor ocupa a largura toda (não vaza a borda em 320–375px) */
.ct-mobile-drawer-theme {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.ct-mobile-drawer-theme .ct-theme-toggle {
  display: flex;
  width: 100%;
}

.ct-mobile-drawer-theme .ct-theme-toggle__btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 6px;
}

/* Cabeçalho público: botões nunca quebram em 2 linhas; entre 993px e 1180px
   (menu ainda visível) logo, links e botões ficam mais compactos para caber o seletor */
.ct-header-actions .ct-btn {
  white-space: nowrap;
}

@media (min-width: 993px) and (max-width: 1180px) {
  .ct-header .ct-logo-link img {
    width: 170px;
    height: auto;
  }

  .ct-header .ct-nav-link {
    padding: 8px 10px;
  }

  .ct-header-actions .ct-btn {
    padding-left: 14px;
    padding-right: 14px;
  }
}
