/* ============================================================
   Modo Escuro (21/09/2026, a pedido do Felipe: "deixar um botão
   pro cliente escolher a versão escura ou clara do sistema").
   Só a área logada (não mexe no site público/login/landing).

   Como funciona: uma classe "dark" no <html> (mesmo mecanismo de
   html.sidebar-collapsed, ver static/css/tailwind-input.css) troca
   as cores POR CIMA das classes do Tailwind que cada template já
   usa — nenhum template foi editado, o layout continua 100% igual,
   só a paleta muda. Alternado por toggleDarkMode() em
   templates/base.html, salvo em localStorage (mesmo padrão do
   "menu simplificado").

   ARQUIVO SEPARADO DE PROPÓSITO (não faz parte de
   tailwind-input.css/base.css, e não passa pelo `npm run
   build:css`): o build minificado (cssnano) embaralhava justamente
   os seletores com colchete/hash escapado (`.border-\[\#cce6f8\]`
   etc — usados pelos valores soltos da barra lateral), perdendo o
   prefixo "html.dark" e vazando a cor escura pro modo claro
   também. Carregado direto por templates/base.html, sem build.

   O bloco entre os marcadores BEGIN/FIM abaixo é gerado por
   scripts/gerar_modo_escuro.py (rode de novo se uma tela nova usar
   uma cor que ainda não está coberta — o script detecta sozinho,
   não precisa listar nada à mão, e não precisa de `npm run
   build:css` depois, já que este arquivo não passa pelo Tailwind).
   O resto deste bloco (sidebar, .card, inputs...) é manual, porque
   vive em @layer components (tailwind-input.css) e o scan não
   alcança esses. */
html.dark body { color-scheme: dark; }
html.dark body.bg-slate-50 { background-color: #0f172a !important; }

/* Superfícies "brancas" (cards, dropdowns do topo, modais) viram
   cinza-azulado escuro — um tom mais claro que o fundo da página,
   pra continuar dando a sensação de "cartão por cima do fundo". */
html.dark .bg-white { background-color: #1e293b; }
html.dark .bg-white\/65 { background-color: rgba(30, 41, 59, 0.85); }
html.dark .bg-white\/95 { background-color: rgba(30, 41, 59, 0.95); }

/* Barra lateral (cor customizada "sidebar" do tailwind.config.js +
   valores soltos em hexadecimal usados só ali, ver <aside> em
   templates/base.html) — os ícones/cards de menu (.menu-card) já
   têm contraste próprio (fundo clarinho translúcido + texto navy)
   e não precisam mudar; só o fundo da barra e o texto solto por
   cima dele (nome da loja, usuário logado, botão simplificar). */
html.dark .bg-sidebar { background-color: #0f2438; }
html.dark .border-\[\#cce6f8\] { border-color: #1c3c54; }
html.dark .hover\:bg-\[\#d8eaf7\]:hover { background-color: #16324a; }
html.dark .text-\[\#173b57\] { color: #dce9f2; }
html.dark .hover\:text-\[\#173b57\]:hover { color: #dce9f2; }
html.dark .text-\[\#4a6b87\] { color: #9fb8cc; }

/* Logo (22/09/2026, a pedido do Felipe: "mudar a logo tbm pra versão
   escura") — templates/base.html tem 4 <img>: banner/ícone × clara/escura,
   todas com a classe "hidden" por padrão. As versões "-dark" são geradas
   por scripts/gerar_logo_escuro.py (fundo transparente, texto clareado) a
   partir dos PNGs originais (fundo sólido). Usa seletor por #id de
   propósito (ganha de qualquer regra por classe, inclusive as !important
   de expandir/simplificar menu em tailwind-input.css, sem depender da
   ordem das regras no arquivo). */
html.dark #logoFullLight,
html.dark #logoIconLight { display: none !important; }
html.dark:not(.sidebar-collapsed) #logoFullDark { display: block !important; }
html.dark.sidebar-collapsed #logoIconDark { display: flex !important; }

/* Papel de parede atrás do conteúdo (foto clara) — pedido do Felipe é
   manter a imagem visível mesmo no modo escuro (antes virava cor sólida).
   Escurece com um véu translúcido por cima em vez de esconder, senão a
   foto clara brigava com o resto da tela escurecida. */
html.dark div[style*="wallpaper.jpg"] {
  background-image: linear-gradient(rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.82)), url('wallpaper.jpg') !important;
}

/* Componentes reutilizáveis de @layer components (acima nesse mesmo
   arquivo) — usam bg-/text- só dentro do @apply, então o scan feito
   nos templates HTML não os alcança; precisam de ajuste manual. */
html.dark .card { background-color: rgba(30, 41, 59, 0.7); border-color: #334155; }
html.dark input, html.dark select, html.dark textarea { background-color: #1e293b; border-color: #475569; color: #e2e8f0; }
html.dark input::placeholder, html.dark textarea::placeholder { color: #64748b; }
html.dark label { color: #cbd5e1; }
html.dark .btn-secondary { background-color: #334155; color: #e2e8f0; }
html.dark .btn-secondary:hover { background-color: #475569; }

/* ==== INÍCIO bloco gerado (gerar_modo_escuro.py) ==== */
html.dark .bg-amber-100 { background-color: #b45309; }
html.dark .bg-amber-50 { background-color: #92400e; }
html.dark .bg-blue-100 { background-color: #1d4ed8; }
html.dark .bg-emerald-100 { background-color: #047857; }
html.dark .bg-emerald-50 { background-color: #065f46; }
html.dark .bg-green-100 { background-color: #15803d; }
html.dark .bg-green-50 { background-color: #166534; }
html.dark .bg-indigo-100 { background-color: #4338ca; }
html.dark .bg-indigo-50 { background-color: #3730a3; }
html.dark .bg-indigo-50\/60 { background-color: rgba(55, 48, 163, 0.6); }
html.dark .bg-orange-100 { background-color: #c2410c; }
html.dark .bg-pink-100 { background-color: #be185d; }
html.dark .bg-pink-50 { background-color: #9d174d; }
html.dark .bg-purple-100 { background-color: #7e22ce; }
html.dark .bg-purple-50 { background-color: #6b21a8; }
html.dark .bg-red-100 { background-color: #b91c1c; }
html.dark .bg-red-50 { background-color: #991b1b; }
html.dark .bg-rose-100 { background-color: #be123c; }
html.dark .bg-rose-50 { background-color: #9f1239; }
html.dark .bg-sky-100 { background-color: #0369a1; }
html.dark .bg-sky-50 { background-color: #075985; }
html.dark .bg-sky-50\/60 { background-color: rgba(7, 89, 133, 0.6); }
html.dark .bg-slate-100 { background-color: #334155; }
html.dark .bg-slate-200 { background-color: #334155; }
html.dark .bg-slate-50 { background-color: #1e293b; }
html.dark .bg-violet-100 { background-color: #6d28d9; }
html.dark .bg-violet-50 { background-color: #5b21b6; }
html.dark .border-amber-200 { border-color: #b45309; }
html.dark .border-amber-300 { border-color: #d97706; }
html.dark .border-emerald-200 { border-color: #047857; }
html.dark .border-indigo-100 { border-color: #4338ca; }
html.dark .border-indigo-200 { border-color: #4338ca; }
html.dark .border-red-200 { border-color: #b91c1c; }
html.dark .border-sky-100 { border-color: #0369a1; }
html.dark .border-sky-200 { border-color: #0369a1; }
html.dark .border-sky-300 { border-color: #0284c7; }
html.dark .border-slate-100 { border-color: #334155; }
html.dark .border-slate-200 { border-color: #334155; }
html.dark .border-slate-300 { border-color: #475569; }
html.dark .border-slate-50 { border-color: #1e293b; }
html.dark .divide-slate-100 { border-color: #334155; }
html.dark .divide-slate-50 { border-color: #1e293b; }
html.dark .hover\:bg-amber-100 { background-color: #b45309 !important; }
html.dark .hover\:bg-amber-50 { background-color: #92400e !important; }
html.dark .hover\:bg-pink-100 { background-color: #be185d !important; }
html.dark .hover\:bg-pink-50 { background-color: #9d174d !important; }
html.dark .hover\:bg-purple-100 { background-color: #7e22ce !important; }
html.dark .hover\:bg-red-100 { background-color: #b91c1c !important; }
html.dark .hover\:bg-red-50 { background-color: #991b1b !important; }
html.dark .hover\:bg-sky-100 { background-color: #0369a1 !important; }
html.dark .hover\:bg-sky-50 { background-color: #075985 !important; }
html.dark .hover\:bg-sky-50\/50 { background-color: rgba(7, 89, 133, 0.5) !important; }
html.dark .hover\:bg-slate-200 { background-color: #334155 !important; }
html.dark .hover\:bg-slate-50 { background-color: #1e293b !important; }
html.dark .hover\:border-sky-300 { border-color: #0284c7 !important; }
html.dark .hover\:text-amber-800 { color: #fef3c7 !important; }
html.dark .hover\:text-blue-900 { color: #eff6ff !important; }
html.dark .hover\:text-emerald-800 { color: #d1fae5 !important; }
html.dark .hover\:text-green-800 { color: #dcfce7 !important; }
html.dark .hover\:text-orange-800 { color: #ffedd5 !important; }
html.dark .hover\:text-red-400 { color: #f87171 !important; }
html.dark .hover\:text-red-500 { color: #fca5a5 !important; }
html.dark .hover\:text-red-600 { color: #fca5a5 !important; }
html.dark .hover\:text-red-700 { color: #fecaca !important; }
html.dark .hover\:text-red-800 { color: #fee2e2 !important; }
html.dark .hover\:text-rose-700 { color: #fecdd3 !important; }
html.dark .hover\:text-sky-400 { color: #38bdf8 !important; }
html.dark .hover\:text-sky-600 { color: #7dd3fc !important; }
html.dark .hover\:text-sky-700 { color: #bae6fd !important; }
html.dark .hover\:text-sky-800 { color: #e0f2fe !important; }
html.dark .hover\:text-sky-900 { color: #f0f9ff !important; }
html.dark .hover\:text-slate-600 { color: #cbd5e1 !important; }
html.dark .hover\:text-slate-700 { color: #e2e8f0 !important; }
html.dark .hover\:text-slate-800 { color: #f1f5f9 !important; }
html.dark .hover\:text-slate-900 { color: #f8fafc !important; }
html.dark .hover\:text-violet-800 { color: #ede9fe !important; }
html.dark .text-amber-500 { color: #fcd34d; }
html.dark .text-amber-600 { color: #fcd34d; }
html.dark .text-amber-700 { color: #fde68a; }
html.dark .text-amber-800 { color: #fef3c7; }
html.dark .text-blue-600 { color: #93c5fd; }
html.dark .text-blue-700 { color: #bfdbfe; }
html.dark .text-emerald-500 { color: #6ee7b7; }
html.dark .text-emerald-600 { color: #6ee7b7; }
html.dark .text-emerald-700 { color: #a7f3d0; }
html.dark .text-emerald-800 { color: #d1fae5; }
html.dark .text-green-500 { color: #86efac; }
html.dark .text-green-600 { color: #86efac; }
html.dark .text-green-700 { color: #bbf7d0; }
html.dark .text-indigo-600 { color: #a5b4fc; }
html.dark .text-indigo-700 { color: #c7d2fe; }
html.dark .text-orange-600 { color: #fdba74; }
html.dark .text-orange-700 { color: #fed7aa; }
html.dark .text-pink-500 { color: #f9a8d4; }
html.dark .text-pink-700 { color: #fbcfe8; }
html.dark .text-pink-800 { color: #fce7f3; }
html.dark .text-purple-700 { color: #e9d5ff; }
html.dark .text-purple-800 { color: #f3e8ff; }
html.dark .text-red-400 { color: #f87171; }
html.dark .text-red-500 { color: #fca5a5; }
html.dark .text-red-600 { color: #fca5a5; }
html.dark .text-red-700 { color: #fecaca; }
html.dark .text-red-800 { color: #fee2e2; }
html.dark .text-rose-500 { color: #fda4af; }
html.dark .text-rose-600 { color: #fda4af; }
html.dark .text-rose-700 { color: #fecdd3; }
html.dark .text-sky-400 { color: #38bdf8; }
html.dark .text-sky-500 { color: #7dd3fc; }
html.dark .text-sky-600 { color: #7dd3fc; }
html.dark .text-sky-700 { color: #bae6fd; }
html.dark .text-sky-800 { color: #e0f2fe; }
html.dark .text-slate-400 { color: #94a3b8; }
html.dark .text-slate-500 { color: #cbd5e1; }
html.dark .text-slate-600 { color: #cbd5e1; }
html.dark .text-slate-700 { color: #e2e8f0; }
html.dark .text-slate-800 { color: #f1f5f9; }
html.dark .text-violet-600 { color: #c4b5fd; }
html.dark .text-violet-700 { color: #ddd6fe; }
/* ==== FIM bloco gerado (gerar_modo_escuro.py) ==== */
