/* PAINEL CERTO 326 — CORRECAO DE TEMAS, SOMENTE CSS.
   Tema native: html[data-theme="light"|"dark"] do Workspace e Master.
   Paginas independentes sem seletor de tema usam claro por padrao.
   Nenhuma mudanca de DOM, JS, API, permissoes ou visibilidade. */
:root[data-theme="light"],:root:not([data-theme]){
  color-scheme:light;
  --p325-bg:#eef3fb;--p325-card:#fff;--p325-elevated:#f5f8fe;
  --p325-border:#dce5f3;--p325-text:#172744;--p325-muted:#607590;
  --p325-side:#fbfdff;--p325-glow:0 12px 34px #25436917,0 1px 3px #1830500b;
  --p326-bg:#eef3fb;--p326-surface:#fff;--p326-surface-alt:#f6f9fe;
  --p326-stroke:#dce5f3;--p326-text:#172744;--p326-muted:#607590;
  --p326-inset:#f8fbff;--p326-soft-shadow:0 10px 30px #24436717,0 1px 3px #20385510;
  background:var(--p326-bg)!important;
}
:root[data-theme="dark"]{color-scheme:dark}
:root:is([data-theme="light"],:not([data-theme])) body{
  --bg:var(--p326-bg);--ink:var(--p326-text);--muted:var(--p326-muted);
  --line:var(--p326-stroke);--side:var(--p326-surface);
  background:var(--p326-bg)!important;color:var(--p326-text)!important;
}
:root:is([data-theme="light"],:not([data-theme])) body :is(h1,h2,h3,h4){color:var(--p326-text)!important}
:root:is([data-theme="light"],:not([data-theme])) body :is(.muted,.hint,.help,.subheading,small){color:var(--p326-muted)}
:root:is([data-theme="light"],:not([data-theme])) body :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select){
  color:var(--p326-text)!important;background:#fff!important;
  border-color:#cdd9ea!important;box-shadow:inset 0 1px 3px #3448660c!important;
}
:root:is([data-theme="light"],:not([data-theme])) body :is(input,textarea)::placeholder{color:#8090aa!important}
:root:is([data-theme="light"],:not([data-theme])) body label{color:#415673!important}
:root:is([data-theme="light"],:not([data-theme])) body :is(.panel,.stat,.card,.tile,.widget,.v31-panel){
  color:var(--p326-text)!important;background:linear-gradient(152deg,#fff,#f9fbff)!important;
  border-color:var(--p326-stroke)!important;box-shadow:var(--p326-soft-shadow)!important;
}
:root:is([data-theme="light"],:not([data-theme])) body th{background:#edf3fc!important;color:#506783!important;border-color:var(--p326-stroke)!important}
:root:is([data-theme="light"],:not([data-theme])) body :is(table,td,tr){color:var(--p326-text)}
:root:is([data-theme="light"],:not([data-theme])) body td{border-color:#e0e8f4!important}
:root:is([data-theme="light"],:not([data-theme])) body :is(dialog,.modal,.modalbox){
  background:#fff!important;color:var(--p326-text)!important;border-color:#dce5f3!important;
  box-shadow:0 28px 90px #203b6152!important;
}
/* Cliente: mantem as posicoes, larguras, menus e handlers originais. */
:root:is([data-theme="light"],:not([data-theme])) body :is(.shell,.main){background:var(--p326-bg)!important;color:var(--p326-text)!important}
:root:is([data-theme="light"],:not([data-theme])) body .sidebar{
  background:linear-gradient(160deg,#fff,#f4f8ff)!important;
  border-right:1px solid #dce6f3!important;box-shadow:8px 0 26px #203f6710!important;
  color:var(--p326-text)!important;
}
:root:is([data-theme="light"],:not([data-theme])) body .sidebar :is(.brand,.preview-brand strong,.sideuser strong,.navbutton,.preview-group-button,.preview-subitem,.preview-sidebar-bottom button){
  color:#324965!important;text-shadow:none!important;
}
:root:is([data-theme="light"],:not([data-theme])) body .sidebar :is(.navlabel,.preview-nav-caption,.preview-brand span,.sideuser small){color:#7085a3!important}
:root:is([data-theme="light"],:not([data-theme])) body .sidebar :is(.preview-group-button[aria-expanded="true"],.navbutton:hover,.preview-subitem:hover){
  background:#eaf1fd!important;color:#163c7e!important;
}
:root:is([data-theme="light"],:not([data-theme])) body .sidebar :is(.navbutton.active,.navbutton.selected,.preview-subitem.selected,.preview-subitem[aria-current="page"]){
  background:var(--p325-gradient)!important;color:#fff!important;
  box-shadow:0 7px 19px var(--p325-ring),inset 0 1px #ffffff55!important;
}
:root:is([data-theme="light"],:not([data-theme])) body .topbar{
  background:#fffffff2!important;color:#203552!important;border-bottom:1px solid #dfe7f4!important;
}
:root:is([data-theme="light"],:not([data-theme])) body .topbar .crumb{color:#607692!important}
:root:is([data-theme="light"],:not([data-theme])) body :is(.stat,.panel){
  background:linear-gradient(153deg,#fff,#f9fbff 85%)!important;
  color:#172744!important;border-color:#dce5f3!important;
  box-shadow:0 12px 28px #203e6317,inset 0 1px 0 #fff!important;
}
:root:is([data-theme="light"],:not([data-theme])) body .stat .label{color:#57708c!important}
:root:is([data-theme="light"],:not([data-theme])) body .stat .value{color:#172744!important}
:root:is([data-theme="light"],:not([data-theme])) body .stat .foot{color:#7586a1!important}
:root:is([data-theme="light"],:not([data-theme])) body :is(.panel,.stat) :is(h2,h3,strong){color:#172744!important}
:root:is([data-theme="light"],:not([data-theme])) body .stat .sicon{
  background:linear-gradient(145deg,color-mix(in srgb,var(--p325-primary) 11%,white),#fff)!important;
  color:var(--p325-primary)!important;border-color:#e1e9f5!important;box-shadow:0 6px 15px #14365d19!important;
}
:root:is([data-theme="light"],:not([data-theme])) body :is(.toolbar,.actions,.panelhead,.heading p){color:#405873!important}
:root:is([data-theme="light"],:not([data-theme])) body :is(.secondary,.btn-secondary,button.secondary){
  background:#edf3fd!important;color:#31517b!important;border-color:#d6e2f3!important;
}
:root:is([data-theme="light"],:not([data-theme])) body :is(.secondary,.btn-secondary,button.secondary):hover{background:#e3edfb!important}
:root:is([data-theme="light"],:not([data-theme])) body button.danger{background:#fff1f3!important;color:#ab2441!important;border-color:#f3c8d0!important}
:root:is([data-theme="light"],:not([data-theme])) body .badge{background:color-mix(in srgb,var(--tag,var(--p325-primary)) 12%,#fff)!important;color:color-mix(in srgb,var(--tag,var(--p325-primary)) 75%,#152b48)!important}
:root:is([data-theme="light"],:not([data-theme])) body :is(.lane,.task,.taskrow,.ticket,.contactcard){
  background:#fff!important;color:#172744!important;border-color:#dce5f3!important;
  box-shadow:0 5px 17px #23456f0c!important;
}
:root:is([data-theme="light"],:not([data-theme])) body .lane{background:#f3f7fe!important}
:root:is([data-theme="light"],:not([data-theme])) body .avatar{background:#eaf2ff!important;color:#2852a2!important}
:root:is([data-theme="light"],:not([data-theme])) body :is(.authwrap,.loginbox,.auth-box,.login-panel,.login-card){
  background:linear-gradient(150deg,#fff,#f8fbff)!important;color:#172744!important;border-color:#dce5f3!important;
}
/* Atendimento: corrige chat panes, conversas, bolhas e composer; nao muda geometria. */
:root:is([data-theme="light"],:not([data-theme])) body.att-page .att-layout.chatlayout{border-color:#d9e3f1!important;box-shadow:0 14px 42px #2443661d!important}
:root:is([data-theme="light"],:not([data-theme])) body.att-page .att-layout :is(.chatlist,.chatpane){background:#fff!important;color:#172744!important}
:root:is([data-theme="light"],:not([data-theme])) body.att-page .att-layout :is(.chathead,.att-filters,.att-searchbar,.att-tabs){background:#f5f8fe!important;color:#233a59!important;border-color:#e0e8f3!important}
:root:is([data-theme="light"],:not([data-theme])) body.att-page .att-layout .chatmessages{background:radial-gradient(ellipse at 65% 0%,#e8f0ff,#f5f8fe 70%)!important}
:root:is([data-theme="light"],:not([data-theme])) body.att-page .att-thread{background:#fff!important;color:#203856!important;border-color:#dfe7f2!important}
:root:is([data-theme="light"],:not([data-theme])) body.att-page .att-thread.selected{background:color-mix(in srgb,var(--p325-primary) 10%,#fff)!important;border-left-color:var(--p325-primary)!important}
:root:is([data-theme="light"],:not([data-theme])) body.att-page :is(.att-message .bubble,.bubble){background:#fff!important;color:#1c3050!important;border-color:#dce5f3!important;box-shadow:0 3px 12px #213d6815!important}
:root:is([data-theme="light"],:not([data-theme])) body.att-page .bubble.out{background:linear-gradient(140deg,var(--p325-primary),var(--p325-secondary))!important;color:white!important;border-color:transparent!important}
:root:is([data-theme="light"],:not([data-theme])) body.att-page :is(.att-thread-copy small,.att-preview,.att-thread-meta small){color:#627b9c!important}
:root:is([data-theme="light"],:not([data-theme])) body.att-page .att-title h1{color:#172744!important}
/* White Label: area de configuracoes com campos legiveis e preview claro. */
:root:is([data-theme="light"],:not([data-theme])) body :is(.branding-panel,.brand-settings,.wl-config,.theme-preview,.brand-preview){background:#fff!important;color:#172744!important;border-color:#dce5f3!important;box-shadow:var(--p326-soft-shadow)!important}
/* Master usa as classes nativas r320-master/mv-master e o mesmo data-theme do JS existente. */
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master){
  --r-bg:#eef3fb;--r-card:#fff;--r-line:#dce5f3;--r-text:#172744;--r-muted:#607590;--r-tint:#f1f6fe;
  --pv-surface:#fff;--pv-soft:#f4f8ff;--pv-line:#dce5f3;--pv-text:#172744;--pv-muted:#607590;
  background:#eef3fb!important;color:#172744!important;
}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.r320-workspace,.r320-main,.p280-workspace,.p280-main){background:#eef3fb!important;color:#172744!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.r320-sidebar,.p280-sidebar){background:linear-gradient(160deg,#fff,#f4f8ff)!important;color:#324965!important;border-right-color:#dce5f3!important;box-shadow:8px 0 28px #172e5112!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.r320-brand,.p280-brand){color:#203650!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.r320-sidebar .r320-navgroup,.p280-sidebar .mv-nav-label){color:#7689a4!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.r320-sidebar button,.p280-sidebar button){color:#314761!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.r320-sidebar button,.p280-sidebar button):hover{background:#e9f1fc!important;color:#1b4384!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.r320-sidebar button.active,.p280-sidebar button.active,.mv-nav-primary button.active,.p280-quick-grid .mv-quick-active){background:var(--p325-gradient)!important;color:#fff!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.r320-top,.p280-top,.mastertop){background:#fffffff2!important;color:#172744!important;border-color:#dce5f3!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.r320-heading h1,.p280-page-title h1,.mv-monitor-heading h1){color:#172744!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.r320-breadcrumb,.r320-top-actions,.p280-page-title p,.r320-heading p){color:#607590!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.r320-card,.r320-stat,.mv-card,.mv-stat,.p280-card,.p280-stat,.v31-panel,.panel,.stat,.p280-section,.mv-plan-modal,.r320-note,.r320-access-banner){background:linear-gradient(152deg,#fff,#f9fbff)!important;color:#172744!important;border-color:#dce5f3!important;box-shadow:var(--p326-soft-shadow)!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.r320-stat,.mv-stat,.p280-stat) :is(strong,b,.value){color:#172744!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.r320-card h2,.r320-card h3,.mv-card h2,.p280-section h3){color:#172744!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.r320-card p,.mv-card p,.mv-card small,.p280-section p,.mv-card-head small){color:#607590!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.r320-btn,.mv-button,.p280-row-menu summary){color:#315276!important;border-color:#d6e2f3!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.r320-primary,.p280-save button[type="submit"],.r320-btn.primary,.mv-quick-active){color:#fff!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.mv-stat-icon,.r320-provider-icon,.mv-title-icon,.r320-icon){background:linear-gradient(143deg,color-mix(in srgb,var(--p325-primary) 13%,#fff),#fff)!important;color:var(--p325-primary)!important;border-color:#dae5f4!important;box-shadow:0 6px 16px #203e6614!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.p280-section,.mv-plan-modal,.r320-note,.r320-access-banner,.p280-summary,.mv-summary-calculation,.mv-plan-modal #p280PlanSummary,.r320-profile-menu,.r320-row-menu,.r320-savebar,.p280-save){background:#fff!important;color:#172744!important;border-color:#dce5f3!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.r320-card table th,.p280-section table th){background:#eef4fc!important;color:#4c6483!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.p280-section label,.mv-plan-modal label,.field label){color:#425873!important}
:root:is([data-theme="light"],:not([data-theme])) body:is(.r320-master,.mv-master) :is(.r320-top input,.p280-top input){background:#fff!important;color:#172744!important;border-color:#d4dfed!important}
/* Portal, suporte e avaliacao (paginas sem seletor -> claro por padrao). */
:root:is([data-theme="light"],:not([data-theme])) body .r320-portal>header,
:root:is([data-theme="light"],:not([data-theme])) body .v31-head{
 background:linear-gradient(135deg,#fff,#f5f8ff)!important;color:#172744!important;border-color:#dce5f3!important;box-shadow:var(--p326-soft-shadow)!important;
}
:root:is([data-theme="light"],:not([data-theme])) body :is(.r320-portal-brand,.v31-head h1){color:#172744!important}
:root:is([data-theme="light"],:not([data-theme])) body .r320-portal :is(.v31-panel,.v31-stat,.r320-login),
:root:is([data-theme="light"],:not([data-theme])) body :is(.v31-panel,.v31-stat,.rating-wrap){background:linear-gradient(150deg,#fff,#f9fbff)!important;color:#172744!important;border-color:#dce5f3!important;box-shadow:var(--p326-soft-shadow)!important}
:root:is([data-theme="light"],:not([data-theme])) body :is(.v31-panel,.v31-stat,.v31-head) :is(h1,h2,h3,strong,b){color:#172744!important}
:root:is([data-theme="light"],:not([data-theme])) body :is(.v31-help,.r320-portal footer,#portalCompany){color:#607590!important}
:root:is([data-theme="light"],:not([data-theme])) body :is(.v31-button:not(.primary),button.secondary){background:#edf3fd!important;color:#345478!important;border-color:#dce6f4!important}
:root:is([data-theme="light"],:not([data-theme])) body .v31-table th{background:#eef4fc!important;color:#4f6581!important}
:root:is([data-theme="light"],:not([data-theme])) body .v31-table td{color:#233d5c!important;border-color:#e2eaf4!important}
:root:is([data-theme="light"],:not([data-theme])) body :is(.r320-portal-history article,.v31-event,.v31-empty){background:#f4f8ff!important;color:#37516f!important;border-color:#dce5f3!important}
:root:is([data-theme="light"],:not([data-theme])) body :is(.v31-field select,.v31-field textarea,.v31-field input){background:#fff!important;color:#172744!important;border-color:#d1ddec!important}
/* Reunioes: manter stream/video, apenas superficies e formulários. */
:root:is([data-theme="light"],:not([data-theme])) body.room-body{background:#eef3fb!important;color:#172744!important}
:root:is([data-theme="light"],:not([data-theme])) body.room-body .room-top{background:linear-gradient(120deg,#fff,#f5f8ff)!important;color:#172744!important;border-color:#dce5f3!important;box-shadow:var(--p326-soft-shadow)!important}
:root:is([data-theme="light"],:not([data-theme])) body.room-body :is(.room-alert,.room-card,.room-panel,.room-controls,.room-reception){background:#fff!important;color:#172744!important;border-color:#dce5f3!important;box-shadow:var(--p326-soft-shadow)!important}
:root:is([data-theme="light"],:not([data-theme])) body.room-body :is(input,textarea,select){background:#fff!important;color:#172744!important;border-color:#d4dfed!important}
/* Acesso administrativo */
:root:is([data-theme="light"],:not([data-theme])) body.r320-entry{background:radial-gradient(circle at 20% 5%,#dceaff,#eef3fb 65%)!important;color:#172744!important}
:root:is([data-theme="light"],:not([data-theme])) body.r320-entry main{background:linear-gradient(150deg,#fff,#f8fbff)!important;color:#172744!important;border-color:#dce5f3!important;box-shadow:var(--p326-soft-shadow)!important}
/* Webchat visitante */
:root:is([data-theme="light"],:not([data-theme])) body.visitorchat{background:#eef3fb!important;color:#172744!important}
:root:is([data-theme="light"],:not([data-theme])) body.visitorchat :is(.panel,.message,.bubble){background:#fff!important;color:#172744!important;border-color:#dce5f3!important}
:root:is([data-theme="light"],:not([data-theme])) body.visitorchat :is(input,textarea,select){background:#fff!important;color:#172744!important;border-color:#d4dfed!important}
/* Acessibilidade: controles de estado e selecao mantidos; hover visivel, sem esconder nada. */
:root:is([data-theme="light"],:not([data-theme])) body :is(button,a,input,select,textarea):focus-visible{outline-color:var(--p325-primary)!important}
@media(prefers-reduced-motion:reduce){:root body :is(button,input,select,textarea){transition:none!important}}
