/* InteliBox - camada de consistência do tema global selecionado em Admin > Aparência.
   Não altera autenticação, lógica operacional ou tema armazenado no banco. */
body[data-ib-global-theme="1"]{
  --ibg-bg:var(--bg,#05070d);--ibg-panel:var(--panel,#0b1019);
  --ibg-panel2:var(--panel2,#101a27);--ibg-border:var(--line,#2b4054);
  --ibg-text:var(--text,#eef7ff);--ibg-muted:var(--muted,#a8b9ca);
  --ibg-accent:var(--theme-accent,var(--cyan,#00e5ff));
  --ibg-contrast:var(--theme-contrast,#07141c);
}

body[data-ib-global-theme="1"][data-theme="neon"]{--ibg-bg:#05070d;--ibg-panel:#0b1019;--ibg-panel2:#0e1520;--ibg-border:#1d2938;--ibg-text:#eef7ff;--ibg-muted:#7f8da1;--ibg-accent:#00e5ff;}
body[data-ib-global-theme="1"][data-theme="aurora"]{--ibg-bg:#060912;--ibg-panel:#0c1220;--ibg-panel2:#11182a;--ibg-border:#25314a;--ibg-text:#f3f7ff;--ibg-muted:#8d9ab1;--ibg-accent:#7dd3fc;}
body[data-ib-global-theme="1"][data-theme="quantum"]{--ibg-bg:#02030a;--ibg-panel:#080b14;--ibg-panel2:#0d1120;--ibg-border:#222942;--ibg-text:#f8fbff;--ibg-muted:#77819a;--ibg-accent:#67e8f9;}
body[data-ib-global-theme="1"][data-theme="luminous"]{--ibg-bg:#eef4fb;--ibg-panel:#ffffff;--ibg-panel2:#f7faff;--ibg-border:#cbd8e8;--ibg-text:#0b1730;--ibg-muted:#5e6f86;--ibg-accent:#006dff;}
body[data-ib-global-theme="1"][data-theme="luminous2"]{--ibg-bg:#f2f5ff;--ibg-panel:#ffffff;--ibg-panel2:#f6f8ff;--ibg-border:#cdd8eb;--ibg-text:#142642;--ibg-muted:#536987;--ibg-accent:#2654ed;}
body[data-ib-global-theme="1"][data-theme="v46"]{--ibg-bg:#080e16;--ibg-panel:#101a26;--ibg-panel2:#142130;--ibg-border:#293a49;--ibg-text:#f3f6f3;--ibg-muted:#aabac4;--ibg-accent:#bafa58;}
body[data-ib-global-theme="1"][data-theme="shock"]{--ibg-bg:#04101f;--ibg-panel:#071b2c;--ibg-panel2:#092b45;--ibg-border:#297499;--ibg-text:#f2faff;--ibg-muted:#b7d1e1;--ibg-accent:#0bcfff;--ibg-contrast:#042033;}
body[data-ib-global-theme="1"][data-theme="violeta"]{--ibg-bg:#120b29;--ibg-panel:#21163c;--ibg-panel2:#2b1e4c;--ibg-border:#6f50a4;--ibg-text:#f7efff;--ibg-muted:#c9b9df;--ibg-accent:#b179f5;--ibg-contrast:#1d1031;}
body[data-ib-global-theme="1"][data-theme="cromo"]{--ibg-bg:#161e24;--ibg-panel:#26323b;--ibg-panel2:#303e47;--ibg-border:#8699a5;--ibg-text:#f2f7fa;--ibg-muted:#b8c9d1;--ibg-accent:#c1d0d7;--ibg-contrast:#1a2932;}
body[data-ib-global-theme="1"][data-theme="cromo_laranja"]{--ibg-bg:#1b2023;--ibg-panel:#292f33;--ibg-panel2:#383d3e;--ibg-border:#b78257;--ibg-text:#fff5ea;--ibg-muted:#d8c6b8;--ibg-accent:#ff9636;--ibg-contrast:#271a10;}

/* Telas que antes tinham cores fixas, independentemente do tema. */
body[data-ib-global-theme="1"][data-ib-theme-tool="1"]{
  background:var(--ibg-bg)!important;color:var(--ibg-text)!important;
  color-scheme:dark;
}
body[data-ib-global-theme="1"][data-ib-theme-tool="1"][data-theme="luminous"],
body[data-ib-global-theme="1"][data-ib-theme-tool="1"][data-theme="luminous2"]{color-scheme:light}
body[data-ib-global-theme="1"][data-ib-theme-tool="1"] :is(main,.panel,section.panel,main.login-box){color:var(--ibg-text)}
body[data-ib-global-theme="1"][data-ib-theme-tool="1"] :is(.panel,main.login-box,main.cadastro-portal,main:only-child:not(.portal):not(.app):not(.boardShell)){
  background:var(--ibg-panel)!important;border-color:var(--ibg-border)!important;color:var(--ibg-text)!important;
}
body[data-ib-global-theme="1"][data-ib-theme-tool="1"] :is(h1,h2,h3,strong,b,legend){color:var(--ibg-text)}
body[data-ib-global-theme="1"][data-ib-theme-tool="1"] :is(p,small,.muted,.note){color:var(--ibg-muted)}
body[data-ib-global-theme="1"][data-ib-theme-tool="1"] :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea){
  background:var(--ibg-panel2)!important;color:var(--ibg-text)!important;
  border:1px solid var(--ibg-border)!important;max-width:100%;
}
body[data-ib-global-theme="1"][data-ib-theme-tool="1"] :is(input,select,textarea)::placeholder{color:var(--ibg-muted)}
body[data-ib-global-theme="1"][data-ib-theme-tool="1"] :is(button:not(.secondary),.back){
  background:var(--ibg-accent)!important;color:var(--ibg-contrast)!important;
  border-color:var(--ibg-accent)!important;
}
body[data-ib-global-theme="1"][data-ib-theme-tool="1"] :is(a:not(.back),code,.status,.msg){color:var(--ibg-accent)}
body[data-ib-global-theme="1"][data-ib-theme-tool="1"] :is(.row,fieldset){border-color:var(--ibg-border)}
body[data-ib-global-theme="1"][data-ib-theme-tool="1"] .warning{
  border-color:var(--ibg-accent)!important;
  background:color-mix(in srgb,var(--ibg-panel) 84%,var(--ibg-accent) 16%)!important;
  color:var(--ibg-text)!important;
}
/* Painel executivo: preserva seu grid, mas harmoniza as superfícies com a escolha do Admin. */
body[data-ib-global-theme="1"] .boardHeader,
body[data-ib-global-theme="1"] :is(.boardAside,.condCard,.metric){
  background:var(--ibg-panel)!important;border-color:var(--ibg-border)!important;color:var(--ibg-text)!important;
}
body[data-ib-global-theme="1"] :is(.boardHeader,.boardAside,.condCard) :is(p,small){color:var(--ibg-muted)}
body[data-ib-global-theme="1"] .boardHeader a{color:var(--ibg-accent)}
body[data-ib-global-theme="1"] .boardAside :is(select,input[type=date],input[type=month]){
  background:var(--ibg-panel2)!important;border-color:var(--ibg-border)!important;color:var(--ibg-text)!important;
}
body[data-ib-global-theme="1"] :is(.formActions button,.intro button){border-color:var(--ibg-accent)}
/* Padrões de acessibilidade aplicados em todas as páginas visuais. */
body[data-ib-global-theme="1"] :is(a,button,input,select,textarea):focus-visible{
  outline:2px solid var(--ibg-accent);outline-offset:3px;
}
@media(max-width:650px){
 body[data-ib-global-theme="1"][data-ib-theme-tool="1"] main{max-width:100%;padding:16px 12px}
 body[data-ib-global-theme="1"][data-ib-theme-tool="1"] .panel{padding:16px}
 body[data-ib-global-theme="1"][data-ib-theme-tool="1"] :is(input,select,textarea,button){font-size:max(16px,1em)}
}
