/* Dark mode da Central — overrides da paleta Tailwind (slate/white) sob html.dark.
   Especificidade html.dark .x (0,2,1) vence as utilities .x (0,1,0), independente da ordem.
   Tudo em @media screen pra NÃO afetar a impressão (proposta/contrato saem em folha branca). */
@media screen {
  /* Paleta NEUTRA (cinza/preto Cowmed), sem azul. */
  html.dark body { background-color: #141414; color: #e6e6e6; }

  /* fundos */
  html.dark .bg-slate-100 { background-color: #141414; }
  html.dark .bg-white     { background-color: #202020; }
  html.dark .bg-slate-50  { background-color: #2a2a2a; }

  /* bordas (default do preflight + classes explícitas) */
  html.dark *, html.dark ::before, html.dark ::after { border-color: #383838; }
  html.dark .border-slate-200 { border-color: #383838; }
  html.dark .border-slate-300 { border-color: #4a4a4a; }

  /* textos (cinzas neutros) */
  html.dark .text-slate-900 { color: #f4f4f5; }
  html.dark .text-slate-800 { color: #e8e8e8; }
  html.dark .text-slate-700 { color: #dcdcdc; }
  html.dark .text-slate-600 { color: #c2c2c2; }
  html.dark .text-slate-500 { color: #9c9c9c; }
  html.dark .text-slate-400 { color: #808080; }

  /* links / acentos verdes Cowmed (claros pra ler no escuro) */
  html.dark .text-emerald-700 { color: #a5d96a; }
  html.dark .text-emerald-600 { color: #a5d96a; }
  html.dark .text-red-600 { color: #f87171; }
  html.dark .text-red-700 { color: #f87171; }
  html.dark .text-amber-700 { color: #fbbf24; }

  /* tints "-50" (semáforo de metas, avisos) escurecidos p/ não ficar claro-no-claro no dark */
  html.dark .bg-emerald-50 { background-color: #1f3318; }
  html.dark .bg-amber-50   { background-color: #3a2e12; }
  html.dark .bg-red-50     { background-color: #3a1f1f; }

  /* botões verdes: verde mais profundo no escuro p/ o texto branco ficar legível e o botão "saltar" */
  html.dark .bg-emerald-600 { background-color: #5e9a33; }
  html.dark .hover\:bg-emerald-700:hover { background-color: #74a83f; }
  html.dark .bg-emerald-700 { background-color: #527f30; }

  /* botões/abas escuros (bg-slate-900 some no fundo escuro) -> cinza neutro */
  html.dark .bg-slate-900 { background-color: #3a3a3a; }
  html.dark .hover\:bg-slate-700:hover { background-color: #505050; }
  html.dark .hover\:bg-slate-100:hover { background-color: #2e2e2e; }
  html.dark .hover\:bg-slate-50:hover  { background-color: #262626; }

  /* campos de formulário */
  html.dark input, html.dark select, html.dark textarea {
    background-color: #1a1a1a !important; color: #ededed; border-color: #4a4a4a;
  }
  html.dark input::placeholder, html.dark textarea::placeholder { color: #7a7a7a; }
  html.dark select option { background-color: #202020; color: #ededed; }
}

/* Botão flutuante de alternância (estilo em ambos os temas; escondido na impressão) */
.cc-theme-toggle {
  position: fixed; right: 14px; bottom: 14px; z-index: 50;
  width: 42px; height: 42px; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1; cursor: pointer;
  background: #fff; border: 1px solid #cbd5e1; box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
html.dark .cc-theme-toggle { background: #202020; border-color: #4a4a4a; }
@media print { .cc-theme-toggle { display: none !important; } }
