/* ============================================================
   Office Mac — Modo noturno (visão noturna)
   Remapeia as classes do Tailwind quando <html class="dark">.
   Carregado em todas as páginas; só atua com a classe .dark.
   ============================================================ */

html.dark { color-scheme: dark; }

/* ---- Fundo da página e superfícies ---- */
/* o body sempre fica no tom mais escuro (mesmo quando tem classe bg-white),
   para que os cartões bg-white tenham contraste */
html.dark body                { background-color: #1c1c1e !important; }
html.dark .bg-haze            { background-color: #1c1c1e; }
html.dark .bg-white           { background-color: #2c2c2e; }
html.dark .bg-gray-50,
html.dark .bg-gray-100        { background-color: #3a3a3c; }

/* superfícies translúcidas (sidebar, header, navs) */
html.dark .bg-haze\/95        { background-color: rgba(28,28,30,0.95); }
html.dark .bg-white\/80       { background-color: rgba(28,28,30,0.80); }
html.dark .bg-white\/95       { background-color: rgba(28,28,30,0.95); }
html.dark .bg-white\/70       { background-color: rgba(28,28,30,0.70); }

/* ---- Texto ---- */
html.dark .text-ink           { color: #f5f5f7; }
html.dark .text-ink\/70       { color: rgba(245,245,247,0.72); }
html.dark .text-ink\/60       { color: rgba(245,245,247,0.65); }
/* hover para texto-tinta (ex.: links do menu do site) → branco no modo noturno */
html.dark .hover\:text-ink:hover { color: #ffffff !important; }
html.dark .text-gray-900,
html.dark .text-gray-800,
html.dark .text-gray-700      { color: #f5f5f7; }
html.dark .text-sub,
html.dark .text-gray-600,
html.dark .text-gray-500      { color: #aeaeb2; }
html.dark .text-gray-400,
html.dark .text-gray-300,
html.dark .text-zinc-400      { color: #8e8e93; }
html.dark .text-\[\#86868b\]  { color: #8e8e93; }
html.dark .text-\[\#b8b8bd\]  { color: #6e6e73; }

/* ---- Bordas ---- */
html.dark .border-line        { border-color: rgba(255,255,255,0.16); }
html.dark .border-black\/10   { border-color: rgba(255,255,255,0.12); }
html.dark .border-black\/5    { border-color: rgba(255,255,255,0.09); }
html.dark .border-black\/\[0\.04\] { border-color: rgba(255,255,255,0.07); }
html.dark .border-gray-100    { border-color: rgba(255,255,255,0.08); }
html.dark .border-gray-200,
html.dark .border-gray-300    { border-color: rgba(255,255,255,0.16); }

/* ---- Hover ---- */
html.dark .hover\:bg-black\/5:hover        { background-color: rgba(255,255,255,0.07); }
html.dark .hover\:bg-black\/\[0\.03\]:hover { background-color: rgba(255,255,255,0.05); }
html.dark .hover\:bg-gray-50:hover         { background-color: rgba(255,255,255,0.07); }
html.dark .hover\:bg-gray-100:hover        { background-color: rgba(255,255,255,0.09); }

/* ---- Navegação ---- */
html.dark .nav-ativa          { background: rgba(227,6,19,0.15) !important; color: #ff4a56 !important; }
html.dark .nav-ativa i        { color: #ff4a56 !important; }

/* ---- Campos de formulário ---- */
html.dark input,
html.dark select,
html.dark textarea            { background-color: #2c2c2e; color: #f5f5f7; border-color: rgba(255,255,255,0.16); }
html.dark input::placeholder,
html.dark textarea::placeholder { color: #8e8e93; }
html.dark .placeholder-\[\#86868b\]::placeholder { color: #8e8e93; }
html.dark select option       { background-color: #2c2c2e; color: #f5f5f7; }

/* ---- Scrollbar ---- */
html.dark ::-webkit-scrollbar-thumb { background: #48484a; }

/* ---- Sombras ---- */
html.dark .shadow-card        { box-shadow: 0 2px 14px rgba(0,0,0,0.45); }
html.dark .shadow-2xl         { box-shadow: 0 20px 50px rgba(0,0,0,0.6); }

/* ---- Marca (vermelho) — fundo claro vira translúcido ---- */
html.dark .bg-brand-light             { background-color: rgba(227,6,19,0.18); }
html.dark .hover\:bg-brand-light:hover { background-color: rgba(227,6,19,0.24); }

/* ============================================================
   Badges / status coloridos (bg-{cor}-100/50, text-{cor}-800)
   No escuro viram fundo translúcido + texto claro.
   ============================================================ */
html.dark .bg-amber-50,   html.dark .bg-amber-100   { background-color: rgba(245,158,11,0.18); }
html.dark .bg-orange-50,  html.dark .bg-orange-100  { background-color: rgba(249,115,22,0.18); }
html.dark .bg-blue-50,    html.dark .bg-blue-100    { background-color: rgba(59,130,246,0.18); }
html.dark .bg-green-50,   html.dark .bg-green-100   { background-color: rgba(34,197,94,0.18); }
html.dark .bg-emerald-50, html.dark .bg-emerald-100 { background-color: rgba(16,185,129,0.18); }
html.dark .bg-violet-50,  html.dark .bg-violet-100  { background-color: rgba(139,92,246,0.20); }
html.dark .bg-red-50,     html.dark .bg-red-100     { background-color: rgba(239,68,68,0.18); }
html.dark .bg-gray-200    { background-color: rgba(255,255,255,0.12); }

html.dark .text-amber-800,   html.dark .text-amber-600   { color: #fcd34d; }
html.dark .text-orange-800,  html.dark .text-orange-600  { color: #fdba74; }
html.dark .text-blue-800,    html.dark .text-blue-600    { color: #93c5fd; }
html.dark .text-green-800,   html.dark .text-green-600   { color: #86efac; }
html.dark .text-emerald-800, html.dark .text-emerald-600 { color: #6ee7b7; }
html.dark .text-violet-800,  html.dark .text-violet-600  { color: #c4b5fd; }
html.dark .text-red-700,     html.dark .text-red-600     { color: #fca5a5; }

html.dark .border-amber-200   { border-color: rgba(245,158,11,0.35); }
html.dark .border-orange-200  { border-color: rgba(249,115,22,0.35); }
html.dark .border-blue-200    { border-color: rgba(59,130,246,0.35); }
html.dark .border-green-200   { border-color: rgba(34,197,94,0.35); }
html.dark .border-emerald-200 { border-color: rgba(16,185,129,0.35); }
html.dark .border-violet-200  { border-color: rgba(139,92,246,0.40); }
html.dark .border-red-200     { border-color: rgba(239,68,68,0.35); }
html.dark .border-gray-300    { border-color: rgba(255,255,255,0.16); }

html.dark .ring-violet-200    { --tw-ring-color: rgba(139,92,246,0.40); }

/* ---- Botão de tema ---- */
.btn-tema { color: #6e6e73; }
html.dark .btn-tema { color: #f5c542; }

/* ---- Hero background (todas as telas) ---- */
body {
  background-image: url('../assets/hero.jpg');
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
}
html.dark body {
  background-image: linear-gradient(rgba(15,15,17,0.82), rgba(15,15,17,0.82)), url('../assets/hero.jpg') !important;
  background-size: cover !important;
  background-position: center top !important;
  background-attachment: fixed !important;
}

/* ============================================================
   Impressão: a via da OS sai sempre clara, mesmo no modo escuro.
   O JS remove a classe .dark antes de imprimir, mas estas regras
   cobrem casos em que o JS não consiga removê-la a tempo.
   ============================================================ */
@media print {
  html, html.dark, body, html.dark body {
    background: #fff !important;
    color: #000 !important;
    color-scheme: light !important;
  }
  html.dark input,
  html.dark select,
  html.dark textarea {
    background-color: #fff !important;
    color: #000 !important;
    border-color: #ccc !important;
  }
  #print-area, #print-area * {
    color: #000 !important;
    background-color: transparent !important;
    border-color: #ddd !important;
  }
}
