/* V18-DJ — proteção visual global dark para telas fora do Fiscal */

body.flow-global-readable-v18dj {
  --v18dj-text: #f8fafc;
  --v18dj-muted: #cbd5e1;
  --v18dj-soft: #dbeafe;
  --v18dj-card: #0f172a;
  --v18dj-card-2: #111827;
  --v18dj-field: #1e293b;
  --v18dj-border: rgba(148, 163, 184, .28);
}

/* Corrige texto hardcoded escuro fora das telas fiscais */
body.flow-global-readable-v18dj #app [style*="color:#0f172a"],
body.flow-global-readable-v18dj #app [style*="color: #0f172a"],
body.flow-global-readable-v18dj #app [style*="color:#111827"],
body.flow-global-readable-v18dj #app [style*="color: #111827"],
body.flow-global-readable-v18dj #app [style*="color:#1f2937"],
body.flow-global-readable-v18dj #app [style*="color: #1f2937"],
body.flow-global-readable-v18dj #app [style*="color:#334155"],
body.flow-global-readable-v18dj #app [style*="color: #334155"],
body.flow-global-readable-v18dj #app [style*="color:#475569"],
body.flow-global-readable-v18dj #app [style*="color: #475569"],
body.flow-global-readable-v18dj #app [style*="color:#000"],
body.flow-global-readable-v18dj #app [style*="color: #000"],
body.flow-global-readable-v18dj #app [style*="color:black"],
body.flow-global-readable-v18dj #app [style*="color: black"] {
  color: var(--v18dj-text) !important;
  -webkit-text-fill-color: var(--v18dj-text) !important;
  opacity: 1 !important;
}

/* Corrige backgrounds claros hardcoded em app, mas não toca DANFE/impressão */
body.flow-global-readable-v18dj #app [style*="background:#fff"]:not([id*="danfe" i]):not([class*="danfe" i]):not([id*="print" i]):not([class*="print" i]),
body.flow-global-readable-v18dj #app [style*="background: #fff"]:not([id*="danfe" i]):not([class*="danfe" i]):not([id*="print" i]):not([class*="print" i]),
body.flow-global-readable-v18dj #app [style*="background:#ffffff"]:not([id*="danfe" i]):not([class*="danfe" i]):not([id*="print" i]):not([class*="print" i]),
body.flow-global-readable-v18dj #app [style*="background: #ffffff"]:not([id*="danfe" i]):not([class*="danfe" i]):not([id*="print" i]):not([class*="print" i]),
body.flow-global-readable-v18dj #app [style*="background:white"]:not([id*="danfe" i]):not([class*="danfe" i]):not([id*="print" i]):not([class*="print" i]),
body.flow-global-readable-v18dj #app [style*="background: white"]:not([id*="danfe" i]):not([class*="danfe" i]):not([id*="print" i]):not([class*="print" i]),
body.flow-global-readable-v18dj #app [style*="background-color:#fff"]:not([id*="danfe" i]):not([class*="danfe" i]):not([id*="print" i]):not([class*="print" i]),
body.flow-global-readable-v18dj #app [style*="background-color: #fff"]:not([id*="danfe" i]):not([class*="danfe" i]):not([id*="print" i]):not([class*="print" i]),
body.flow-global-readable-v18dj #app [style*="background-color:#ffffff"]:not([id*="danfe" i]):not([class*="danfe" i]):not([id*="print" i]):not([class*="print" i]),
body.flow-global-readable-v18dj #app [style*="background-color: #ffffff"]:not([id*="danfe" i]):not([class*="danfe" i]):not([id*="print" i]):not([class*="print" i]) {
  background: var(--v18dj-card) !important;
  background-color: var(--v18dj-card) !important;
  color: var(--v18dj-text) !important;
  border-color: var(--v18dj-border) !important;
}

/* Classes genéricas muito comuns nas páginas de Integrações/Logística/Financeiro/Relatórios */
body.flow-global-readable-v18dj #app .text-muted,
body.flow-global-readable-v18dj #app .muted,
body.flow-global-readable-v18dj #app small,
body.flow-global-readable-v18dj #app .subtitle,
body.flow-global-readable-v18dj #app .description,
body.flow-global-readable-v18dj #app [class*="muted"],
body.flow-global-readable-v18dj #app [class*="subtitle"],
body.flow-global-readable-v18dj #app [class*="description"] {
  color: var(--v18dj-muted) !important;
  opacity: 1 !important;
}

body.flow-global-readable-v18dj #app .flow-v18dj-readable,
body.flow-global-readable-v18dj #app .flow-v18dj-readable * {
  color: var(--v18dj-text) !important;
  -webkit-text-fill-color: var(--v18dj-text) !important;
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
  mix-blend-mode: normal !important;
}

body.flow-global-readable-v18dj #app .flow-v18dj-muted {
  color: var(--v18dj-muted) !important;
  -webkit-text-fill-color: var(--v18dj-muted) !important;
  opacity: 1 !important;
}

body.flow-global-readable-v18dj #app .flow-v18dj-box {
  color: var(--v18dj-text) !important;
  border-color: var(--v18dj-border) !important;
}

/* Evita quebra em áreas de impressão/DANFE */
body.flow-global-readable-v18dj #app [id*="danfe" i],
body.flow-global-readable-v18dj #app [class*="danfe" i],
body.flow-global-readable-v18dj #app [id*="print" i],
body.flow-global-readable-v18dj #app [class*="print" i] {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
