/* Tema escuro do Primux Omni. Carregado depois do Tailwind e do primux.css. */
html[data-tema="escuro"] {
    color-scheme: dark;
    --px-bg: #08111F;
    --px-surface: #0F1B2D;
    --px-surface-2: #16243A;
    --px-text: #E6EDF5;
    --px-text-2: #9FB0C4;
    --px-border: #24354D;
    --px-link: #7DD3F5;
    --px-accent: #2FB9EA;
    --px-success: #6EE7B7;
    --px-warning: #FCD34D;
    --px-error: #FDA4AF;
}

html[data-tema="escuro"] body,
html[data-tema="escuro"] #tela-app {
    background: #08111F !important;
    color: #E6EDF5 !important;
}

html[data-tema="escuro"] ::selection {
    background: #0A76A3;
    color: #FFFFFF;
}

/* Estrutura principal */
html[data-tema="escuro"] header {
    background: #0F1B2D !important;
    border-color: #24354D !important;
}

html[data-tema="escuro"] #menu-lateral {
    background: #0F1B2D !important;
    border-color: #24354D !important;
}

html[data-tema="escuro"] #menu-lateral .workspace,
html[data-tema="escuro"] #menu-lateral .menu-busca,
html[data-tema="escuro"] #menu-lateral .border-b,
html[data-tema="escuro"] #menu-lateral .border-t,
html[data-tema="escuro"] #menu-lateral .border-slate-100,
html[data-tema="escuro"] #menu-lateral .border-slate-200 {
    border-color: #24354D !important;
}

html[data-tema="escuro"] #menu-lateral .menu-grupo + .menu-grupo {
    border-top-color: #24354D !important;
}

html[data-tema="escuro"] #menu-lateral .menu-grupo-botao {
    color: #71869D !important;
}

html[data-tema="escuro"] #menu-lateral .menu-grupo-botao:hover {
    color: #7DD3F5 !important;
}

html[data-tema="escuro"] #menu-lateral .menu-item {
    color: #AFC0D2 !important;
}

html[data-tema="escuro"] #menu-lateral .menu-item:hover {
    background: #16243A !important;
    color: #F1F5F9 !important;
}

html[data-tema="escuro"] #menu-lateral .menu-item.ativo {
    background: rgba(12, 152, 207, 0.16) !important;
    color: #7DD3F5 !important;
    border-left-color: #2FB9EA !important;
}

html[data-tema="escuro"] #menu-lateral .menu-item .menu-icone {
    color: #71869D !important;
}

html[data-tema="escuro"] #menu-lateral .menu-item:hover .menu-icone,
html[data-tema="escuro"] #menu-lateral .menu-item.ativo .menu-icone {
    color: #2FB9EA !important;
}

html[data-tema="escuro"] #menu-lateral.menu-recolhido .menu-item.ativo {
    background: rgba(12, 152, 207, 0.16) !important;
}

/* Superfícies */
html[data-tema="escuro"] .bg-white {
    background-color: #0F1B2D !important;
}

html[data-tema="escuro"] .bg-white\/80 {
    background-color: rgba(15, 27, 45, 0.82) !important;
}

html[data-tema="escuro"] .bg-white\/90 {
    background-color: rgba(15, 27, 45, 0.92) !important;
}

html[data-tema="escuro"] .bg-slate-50 {
    background-color: #0B1524 !important;
}

html[data-tema="escuro"] .bg-slate-50\/60 {
    background-color: rgba(11, 21, 36, 0.62) !important;
}

html[data-tema="escuro"] .bg-slate-50\/70 {
    background-color: rgba(11, 21, 36, 0.72) !important;
}

html[data-tema="escuro"] .bg-slate-50\/80 {
    background-color: rgba(11, 21, 36, 0.82) !important;
}

html[data-tema="escuro"] .bg-slate-100 {
    background-color: #16243A !important;
}

html[data-tema="escuro"] .bg-slate-200 {
    background-color: #1C2C44 !important;
}

html[data-tema="escuro"] .bg-slate-200\/70 {
    background-color: rgba(28, 44, 68, 0.72) !important;
}

html[data-tema="escuro"] .bg-slate-300 {
    background-color: #31445E !important;
}

html[data-tema="escuro"] .bg-slate-800 {
    background-color: #1B304B !important;
}

html[data-tema="escuro"] .bg-slate-900 {
    background-color: #101D2E !important;
}

/* Texto */
html[data-tema="escuro"] .text-slate-900,
html[data-tema="escuro"] .text-slate-800 {
    color: #F1F5F9 !important;
}

html[data-tema="escuro"] .text-slate-700 {
    color: #D7E1EC !important;
}

html[data-tema="escuro"] .text-slate-600 {
    color: #B7C7D9 !important;
}

html[data-tema="escuro"] .text-slate-500 {
    color: #93A7BC !important;
}

html[data-tema="escuro"] .text-slate-400 {
    color: #71869D !important;
}

html[data-tema="escuro"] .text-slate-300 {
    color: #5A6E84 !important;
}

html[data-tema="escuro"] .placeholder\:text-slate-400::placeholder {
    color: #64748B !important;
}

/* Bordas e divisores */
html[data-tema="escuro"] .border-slate-100 {
    border-color: #1B2A40 !important;
}

html[data-tema="escuro"] .border-slate-200,
html[data-tema="escuro"] .border-slate-200\/80 {
    border-color: #24354D !important;
}

html[data-tema="escuro"] .border-slate-300 {
    border-color: #31445E !important;
}

html[data-tema="escuro"] .divide-slate-100 > :not([hidden]) ~ :not([hidden]) {
    border-color: #1B2A40 !important;
}

html[data-tema="escuro"] .divide-slate-200 > :not([hidden]) ~ :not([hidden]) {
    border-color: #24354D !important;
}

/* Formulários */
html[data-tema="escuro"] input:not([type="checkbox"]):not([type="radio"]),
html[data-tema="escuro"] select,
html[data-tema="escuro"] textarea {
    background-color: #0B1524 !important;
    border-color: #24354D !important;
    color: #E6EDF5 !important;
}

html[data-tema="escuro"] input:not([type="checkbox"]):not([type="radio"]):focus,
html[data-tema="escuro"] select:focus,
html[data-tema="escuro"] textarea:focus {
    background-color: #101D2E !important;
    border-color: #2FB9EA !important;
}

html[data-tema="escuro"] input[type="checkbox"],
html[data-tema="escuro"] input[type="radio"] {
    accent-color: #2FB9EA;
}

html[data-tema="escuro"] input[type="color"] {
    background-color: #0B1524 !important;
}

html[data-tema="escuro"] #usuario-status {
    background: transparent !important;
    border: 0 !important;
    color: #93A7BC !important;
}

/* Hovers */
html[data-tema="escuro"] .hover\:bg-slate-50:hover,
html[data-tema="escuro"] .hover\:bg-slate-50\/80:hover,
html[data-tema="escuro"] .hover\:bg-slate-100:hover,
html[data-tema="escuro"] .hover\:bg-white:hover {
    background-color: #16243A !important;
}

html[data-tema="escuro"] .hover\:bg-slate-200:hover {
    background-color: #1C2C44 !important;
}

html[data-tema="escuro"] .hover\:text-slate-700:hover,
html[data-tema="escuro"] .hover\:text-slate-800:hover {
    color: #F1F5F9 !important;
}

/* Cores suaves: fundos */
html[data-tema="escuro"] .bg-indigo-50,
html[data-tema="escuro"] .bg-indigo-50\/50,
html[data-tema="escuro"] .bg-indigo-100 {
    background-color: rgba(79, 88, 201, 0.18) !important;
}

html[data-tema="escuro"] .bg-sky-50,
html[data-tema="escuro"] .bg-sky-100 {
    background-color: rgba(12, 152, 207, 0.17) !important;
}

html[data-tema="escuro"] .bg-emerald-50,
html[data-tema="escuro"] .bg-emerald-100 {
    background-color: rgba(21, 127, 85, 0.20) !important;
}

html[data-tema="escuro"] .bg-amber-50,
html[data-tema="escuro"] .bg-amber-100 {
    background-color: rgba(245, 158, 11, 0.17) !important;
}

html[data-tema="escuro"] .bg-rose-50,
html[data-tema="escuro"] .bg-rose-100 {
    background-color: rgba(194, 55, 59, 0.20) !important;
}

html[data-tema="escuro"] .bg-violet-50,
html[data-tema="escuro"] .bg-violet-100 {
    background-color: rgba(139, 92, 246, 0.18) !important;
}

html[data-tema="escuro"] .bg-purple-50,
html[data-tema="escuro"] .bg-purple-100 {
    background-color: rgba(168, 85, 247, 0.18) !important;
}

html[data-tema="escuro"] .bg-blue-50,
html[data-tema="escuro"] .bg-blue-100 {
    background-color: rgba(59, 130, 246, 0.18) !important;
}

html[data-tema="escuro"] .bg-orange-50,
html[data-tema="escuro"] .bg-orange-100 {
    background-color: rgba(249, 115, 22, 0.18) !important;
}

/* Cores suaves: texto */
html[data-tema="escuro"] .text-indigo-600,
html[data-tema="escuro"] .text-indigo-700,
html[data-tema="escuro"] .text-indigo-800 {
    color: #B9C0FF !important;
}

html[data-tema="escuro"] .text-sky-600,
html[data-tema="escuro"] .text-sky-700,
html[data-tema="escuro"] .text-sky-800,
html[data-tema="escuro"] .text-sky-900 {
    color: #7DD3F5 !important;
}

html[data-tema="escuro"] .text-emerald-600,
html[data-tema="escuro"] .text-emerald-700,
html[data-tema="escuro"] .text-emerald-800,
html[data-tema="escuro"] .text-emerald-900 {
    color: #6EE7B7 !important;
}

html[data-tema="escuro"] .text-amber-600,
html[data-tema="escuro"] .text-amber-700,
html[data-tema="escuro"] .text-amber-800,
html[data-tema="escuro"] .text-amber-900 {
    color: #FCD34D !important;
}

html[data-tema="escuro"] .text-rose-500,
html[data-tema="escuro"] .text-rose-600,
html[data-tema="escuro"] .text-rose-700,
html[data-tema="escuro"] .text-rose-800,
html[data-tema="escuro"] .text-rose-900 {
    color: #FDA4AF !important;
}

html[data-tema="escuro"] .text-violet-600,
html[data-tema="escuro"] .text-violet-700 {
    color: #C4B5FD !important;
}

html[data-tema="escuro"] .text-purple-600,
html[data-tema="escuro"] .text-purple-700 {
    color: #D8B4FE !important;
}

html[data-tema="escuro"] .text-blue-600,
html[data-tema="escuro"] .text-blue-700 {
    color: #93C5FD !important;
}

/* Cores suaves: bordas */
html[data-tema="escuro"] .border-indigo-100,
html[data-tema="escuro"] .border-indigo-200 {
    border-color: rgba(79, 88, 201, 0.35) !important;
}

html[data-tema="escuro"] .border-sky-100,
html[data-tema="escuro"] .border-sky-200 {
    border-color: rgba(12, 152, 207, 0.35) !important;
}

html[data-tema="escuro"] .border-emerald-100,
html[data-tema="escuro"] .border-emerald-200 {
    border-color: rgba(21, 127, 85, 0.40) !important;
}

html[data-tema="escuro"] .border-amber-100,
html[data-tema="escuro"] .border-amber-200 {
    border-color: rgba(245, 158, 11, 0.35) !important;
}

html[data-tema="escuro"] .border-rose-100,
html[data-tema="escuro"] .border-rose-200 {
    border-color: rgba(194, 55, 59, 0.40) !important;
}

html[data-tema="escuro"] .border-violet-100,
html[data-tema="escuro"] .border-violet-200 {
    border-color: rgba(139, 92, 246, 0.35) !important;
}

html[data-tema="escuro"] .hover\:bg-indigo-50:hover,
html[data-tema="escuro"] .hover\:bg-indigo-100:hover {
    background-color: rgba(79, 88, 201, 0.26) !important;
}

html[data-tema="escuro"] .hover\:bg-sky-50:hover,
html[data-tema="escuro"] .hover\:bg-sky-100:hover {
    background-color: rgba(12, 152, 207, 0.24) !important;
}

html[data-tema="escuro"] .hover\:bg-emerald-100:hover {
    background-color: rgba(21, 127, 85, 0.28) !important;
}

html[data-tema="escuro"] .hover\:bg-amber-100:hover {
    background-color: rgba(245, 158, 11, 0.25) !important;
}

html[data-tema="escuro"] .hover\:bg-rose-50:hover,
html[data-tema="escuro"] .hover\:bg-rose-100:hover {
    background-color: rgba(194, 55, 59, 0.26) !important;
}

html[data-tema="escuro"] .hover\:bg-violet-100:hover {
    background-color: rgba(139, 92, 246, 0.26) !important;
}

/* Chat e notas internas */
html[data-tema="escuro"] .bg-chat-pattern {
    background-color: #08111F !important;
    background-image: radial-gradient(#1E3350 1px, transparent 1px) !important;
}

html[data-tema="escuro"] .bg-nota-interna {
    background-color: #2A2315 !important;
    background-image: radial-gradient(rgba(242, 179, 61, 0.22) 1px, transparent 1px) !important;
}

html[data-tema="escuro"] .coluna-kanban.arrastando {
    background-color: #16243A !important;
}

/* Editor de fluxos */
html[data-tema="escuro"] .drawflow {
    background-color: #0B1524 !important;
}

html[data-tema="escuro"] .drawflow-node {
    background: #16243A !important;
    border-color: #31445E !important;
    color: #E6EDF5 !important;
}

/* Cabeçalho */
html[data-tema="escuro"] #aviso-assinatura {
    border-color: #2A5B48 !important;
}

html[data-tema="escuro"] #menu-lateral .motor-card {
    background: #0B1524 !important;
    border-color: #24354D !important;
}

html[data-tema="escuro"] #menu-lateral .motor-card .bg-slate-200 {
    background-color: #1C2C44 !important;
}

/* Scrollbar */
html[data-tema="escuro"] ::-webkit-scrollbar-thumb {
    background: #31445E !important;
}

html[data-tema="escuro"] ::-webkit-scrollbar-thumb:hover {
    background: #3F5673 !important;
}

/* Tabelas e linhas */
html[data-tema="escuro"] thead.bg-slate-50,
html[data-tema="escuro"] tr.bg-slate-50 {
    background-color: #0B1524 !important;
}

html[data-tema="escuro"] .shadow-sm,
html[data-tema="escuro"] .shadow,
html[data-tema="escuro"] .shadow-2xl {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28) !important;
}

/* Texto de mensagens e estados */
html[data-tema="escuro"] .text-emerald-950,
html[data-tema="escuro"] .text-amber-950 {
    color: #F1F5F9 !important;
}

html[data-tema="escuro"] .bg-emerald-50\/80,
html[data-tema="escuro"] .bg-emerald-100\/90 {
    background-color: rgba(21, 127, 85, 0.22) !important;
}

html[data-tema="escuro"] .bg-amber-100\/90 {
    background-color: rgba(245, 158, 11, 0.20) !important;
}

/* Componentes específicos do kit */
html[data-tema="escuro"] #tela-app .aba {
    background-color: transparent;
}

html[data-tema="escuro"] .modal-card,
html[data-tema="escuro"] #modal-formulario > div,
html[data-tema="escuro"] #modal-confirmacao > div,
html[data-tema="escuro"] #modal-resultado > div {
    background-color: #0F1B2D !important;
}

/* Editor visual de fluxos */
html[data-tema="escuro"] #chatflow-canvas .drawflow-node .cf-node {
    background: #16243A !important;
    border-color: #31445E !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.30) !important;
}

html[data-tema="escuro"] #chatflow-canvas .drawflow-node.selected .cf-node {
    border-color: #2FB9EA !important;
    box-shadow: 0 0 0 3px rgba(47, 185, 234, 0.18), 0 8px 20px rgba(0, 0, 0, 0.35) !important;
}

html[data-tema="escuro"] #chatflow-canvas .cf-node-top {
    background: #101D2E !important;
    border-bottom-color: #24354D !important;
}

html[data-tema="escuro"] #chatflow-canvas .cf-node-titulo {
    color: #E6EDF5 !important;
}

html[data-tema="escuro"] #chatflow-canvas .cf-node-corpo {
    color: #AFC0D2 !important;
}

html[data-tema="escuro"] #chatflow-canvas .cf-node-tipo {
    color: #71869D !important;
}

html[data-tema="escuro"] #chatflow-canvas .cf-start .cf-node-top {
    background: rgba(21, 127, 85, 0.20) !important;
    border-bottom-color: rgba(21, 127, 85, 0.35) !important;
}

html[data-tema="escuro"] #chatflow-canvas .cf-menu .cf-node-top {
    background: rgba(59, 130, 246, 0.18) !important;
    border-bottom-color: rgba(59, 130, 246, 0.35) !important;
}

html[data-tema="escuro"] #chatflow-canvas .cf-condicao .cf-node-top {
    background: rgba(245, 158, 11, 0.18) !important;
    border-bottom-color: rgba(245, 158, 11, 0.35) !important;
}

html[data-tema="escuro"] #chatflow-canvas .cf-ia .cf-node-top {
    background: rgba(168, 85, 247, 0.18) !important;
    border-bottom-color: rgba(168, 85, 247, 0.35) !important;
}

html[data-tema="escuro"] #chatflow-canvas .cf-transferir .cf-node-top,
html[data-tema="escuro"] #chatflow-canvas .cf-encerrar .cf-node-top {
    background: rgba(194, 55, 59, 0.18) !important;
    border-bottom-color: rgba(194, 55, 59, 0.35) !important;
}

html[data-tema="escuro"] .cf-paleta-item {
    background: #16243A !important;
    border-color: #24354D !important;
    color: #D7E1EC !important;
}

html[data-tema="escuro"] .cf-paleta-item:hover {
    background: #1C2C44 !important;
    border-color: #2FB9EA !important;
    color: #7DD3F5 !important;
}

html[data-tema="escuro"] .cf-paleta-item i {
    color: #2FB9EA !important;
}

html[data-tema="escuro"] .cf-campo {
    background: #0B1524 !important;
    border-color: #24354D !important;
    color: #E6EDF5 !important;
}

html[data-tema="escuro"] .cf-campo:focus {
    background: #101D2E !important;
    border-color: #2FB9EA !important;
}

html[data-tema="escuro"] .cf-label {
    color: #71869D !important;
}

html[data-tema="escuro"] #chatflow-canvas .drawflow .connection .main-path {
    stroke: #5A6E84 !important;
}

html[data-tema="escuro"] #chatflow-canvas .drawflow .connection .main-path:hover {
    stroke: #2FB9EA !important;
}

/* Variantes de opacidade usadas no painel */
html[data-tema="escuro"] .bg-indigo-50\/60,
html[data-tema="escuro"] .bg-indigo-50\/70,
html[data-tema="escuro"] .bg-indigo-50\/80 {
    background-color: rgba(79, 88, 201, 0.22) !important;
}

html[data-tema="escuro"] .bg-emerald-50\/60,
html[data-tema="escuro"] .bg-emerald-50\/70,
html[data-tema="escuro"] .bg-emerald-100\/70,
html[data-tema="escuro"] .bg-emerald-50\/80 {
    background-color: rgba(21, 127, 85, 0.22) !important;
}

html[data-tema="escuro"] .bg-purple-50\/70 {
    background-color: rgba(168, 85, 247, 0.20) !important;
}

html[data-tema="escuro"] .bg-slate-50\/40,
html[data-tema="escuro"] .bg-slate-50\/50 {
    background-color: rgba(11, 21, 36, 0.55) !important;
}

html[data-tema="escuro"] #usuario-status-dot-mobile {
    box-shadow: 0 0 0 2px #0F1B2D !important;
}
