/* Ajustes comuns para computador, tablet e celular. */
.tema-toggle{position:fixed;right:14px;bottom:14px;z-index:99999;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:10px 14px;border:1px solid rgba(255,255,255,.28);border-radius:999px;background:#182318;color:#f4f7ef;font:700 13px/1 system-ui,sans-serif;box-shadow:0 5px 18px #0005;cursor:pointer;touch-action:manipulation}
.tema-toggle:focus-visible{outline:3px solid #e6b34f;outline-offset:3px}
.tema-toggle.tema-in-header{position:static;top:auto;right:auto;bottom:auto;flex:none;min-height:40px;margin:0 0 0 auto;white-space:nowrap}
html[data-theme="light"] .tema-toggle{background:#fff;color:#172215;border-color:#c7d0c2;box-shadow:0 5px 18px #17221525}
html[data-theme="dark"]{color-scheme:dark}html[data-theme="light"]{color-scheme:light}

/* Operação da empresa */
@media(max-width:1100px){.maplayout{grid-template-columns:minmax(0,1fr) 260px}.grade{grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr))}}
@media(max-width:900px){.maplayout{grid-template-columns:1fr}.fleetmap{height:min(58svh,620px);min-height:340px}.mapaside{max-height:none}.dashhead{align-items:flex-start;flex-wrap:wrap}.registry-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,270px),1fr))}}
@media(max-width:640px){
 html,body{min-width:320px}header{gap:7px;padding:9px 10px;flex-wrap:wrap}header .marca{font-size:18px;flex:1 1 100%;line-height:1.1}header .marca small{display:none}header .esp{display:none}header #quem{margin-left:auto;font-size:12px!important}header .bt{min-height:42px;padding:8px 10px;font-size:12px}
 main{padding:12px}.dashhead{display:flex;flex-direction:column;align-items:stretch;gap:8px}.dashhead h2{font-size:22px}.viewtabs{width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.viewtabs button{padding:10px 6px;min-height:44px;font-size:13px}.kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.kpi{padding:9px}.filterrow{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-inline:contain;padding:2px 1px 8px;scrollbar-width:thin}.filterrow button,.filterrow select{flex:none;min-height:42px;white-space:nowrap}.busca{max-width:none;min-height:44px}.fleetmap{height:56svh;min-height:310px}.mapaside{padding:10px}.maptools button{min-height:40px}.grade{grid-template-columns:1fr}.registry{padding:10px}.registry-grid,.client-installations{grid-template-columns:1fr}.planner form{grid-template-columns:1fr}.planner .full{grid-column:auto}.fleet-screen .mapaside{top:58px;right:8px;width:min(320px,calc(100vw - 16px));max-height:calc(100svh - 70px)}.fleet-screen .mapfloat{top:8px;right:8px}.fleet-screen .mapfloat button{min-height:42px}.fleet-screen .map-panel-head{touch-action:manipulation}
}
@media(max-width:380px){main{padding:9px}.kpi b{font-size:21px}.fleetmap{min-height:280px}.change-notice{top:6px;padding:12px 40px 12px 12px}}

/* Cadastro: campos e botões confortáveis ao toque; mapa abaixo do formulário. */
@media(max-width:900px){.layout{grid-template-columns:1fr}.map-card{position:static}.install-map{height:min(52svh,560px);min-height:340px}}
@media(max-width:640px){header{position:sticky;gap:8px;padding:10px 12px;flex-wrap:wrap}header b{flex:1 1 100%}header span{font-size:12px}header a,header button{min-height:42px;padding:9px 11px}main{padding:12px}.layout{gap:8px}.card{padding:12px;border-radius:13px}.form{grid-template-columns:1fr}.form .wide{grid-column:auto}.form input,.form select,.search{min-height:46px;font-size:16px}.actions{display:grid;grid-template-columns:1fr}.actions button{width:100%;min-height:44px}.install-map{height:55svh;min-height:300px}.map-controls select{min-height:42px}.client-record-head{display:flex;flex-direction:column}.client-record-actions button,.client-site-actions button{min-height:42px;flex:1}.client-site{align-items:flex-start}.workflow-nav{display:grid;grid-template-columns:1fr 1fr}.workflow-nav a{min-height:44px;display:flex;align-items:center;justify-content:center;padding:8px}.clientDialog,#clientDialog,#equipDialog{max-height:90svh;overflow:auto}}

/* IHM e visão do cliente: não altera o mapa de fundo; melhora leitura e controles. */
@media(max-width:900px){#alerta{max-width:calc(100% - 24px);font-size:15px}#tec .grid,#tec .cols{grid-template-columns:1fr!important}#tec .card{min-width:0}}
@media(max-width:640px){
 #alerta{top:72px;left:8px;right:8px;transform:none;width:auto;max-width:none;display:flex;flex-wrap:wrap;gap:8px;padding:10px 12px;font-size:13px}#alerta button{min-height:42px}
 body.remoto #mapa{inset:138px 6px 154px;border-radius:13px}body.remoto #barra{left:7px;right:7px;bottom:142px;min-height:48px;padding:9px 11px;font-size:14px}body.remoto #lista{left:7px!important;right:7px!important;bottom:6px!important;max-height:126px!important;overflow:auto}body.remoto .mapctl{right:12px;bottom:198px}
 #tec{overflow:auto}#tec header{position:sticky;top:0;z-index:5;flex-wrap:wrap;padding:9px 10px}#tec header h1{font-size:17px;flex:1 1 100%}#tec nav{padding:8px 8px 0;overflow-x:auto;gap:4px}#tec nav button{min-width:110px;min-height:44px;padding:9px 7px;font-size:13px}#tec main,#tec .conteudo{padding:10px!important}#tec .card{padding:11px}#tec .met{grid-template-columns:repeat(2,minmax(0,1fr))}#tec .cf{grid-template-columns:minmax(0,1fr) 70px 70px}#tec .cf i{grid-column:1/-1}#tec input,#tec select,#tec button{min-height:42px}
 #assist header{padding:10px}#assist header h2{font-size:22px}#ficha{bottom:8px;max-height:78svh;overflow:auto;padding:14px}#demo{bottom:8px;left:8px}
}
@media(max-width:380px){body.remoto #mapa{inset:145px 4px 154px}#tec nav button{min-width:96px;font-size:12px}}

/* Tema claro aplicado aos componentes de gestão e às superfícies da IHM. */
html[data-theme="light"][data-wej="painel"] body{background:#f4f6f1;color:#182117}
html[data-theme="light"][data-wej="painel"] body header{background:rgba(248,250,246,.96);border-color:#d6ded2}
html[data-theme="light"][data-wej="painel"] body .kpi,html[data-theme="light"][data-wej="painel"] body .num,html[data-theme="light"][data-wej="painel"] body .registry,html[data-theme="light"][data-wej="painel"] body .mapaside,html[data-theme="light"][data-wej="painel"] body .viewtabs{background:#fff;border-color:#d7dfd3}
html[data-theme="light"][data-wej="painel"] body .registry-card,html[data-theme="light"][data-wej="painel"] body .client-location,html[data-theme="light"][data-wej="painel"] body .maptools button,html[data-theme="light"][data-wej="painel"] body .mapaside select,html[data-theme="light"][data-wej="painel"] body .bt{background:#f4f7f2;color:#1c281a;border-color:#d6ded2}
html[data-theme="light"][data-wej="painel"] body .filterrow button,html[data-theme="light"][data-wej="painel"] body .filterrow select,html[data-theme="light"][data-wej="painel"] body .busca{background:#fff;color:#263323;border-color:#cbd5c6}
html[data-theme="light"][data-wej="painel"] body .mapitem,html[data-theme="light"][data-wej="painel"] body .registry-card p,html[data-theme="light"][data-wej="painel"] body .client-location p{color:#52614e}
html[data-theme="light"][data-wej="painel"] body h3{color:#755a20}
html[data-theme="light"][data-wej="painel"] body .fleet-screen .mapfloat button{background:#fff;color:#1b2819;border-color:#ccd7c8}
html[data-theme="light"][data-wej="painel"] body dialog.planner{background:#fff;color:#182117}html[data-theme="light"][data-wej="painel"] body .planner input{background:#f6f8f4;color:#182117}
html[data-theme="dark"][data-pagina="instalacoes"] body{--bg:#0d120b;--card:#151d12;--card2:#1b2517;--line:rgba(220,230,205,.16);--tx:#eef2e8;--muted:#aeb9a4;--gold:#cdb98a;--green:#27843e}
html[data-theme="dark"][data-pagina="instalacoes"] body header,html[data-theme="dark"][data-pagina="instalacoes"] body .card,html[data-theme="dark"][data-pagina="instalacoes"] body .item,html[data-theme="dark"][data-pagina="instalacoes"] body .client-record,html[data-theme="dark"][data-pagina="instalacoes"] body #clientDialog,html[data-theme="dark"][data-pagina="instalacoes"] body #equipDialog{background:var(--card);color:var(--tx)}
html[data-theme="dark"][data-pagina="instalacoes"] body input,html[data-theme="dark"][data-pagina="instalacoes"] body select,html[data-theme="dark"][data-pagina="instalacoes"] body .form input,html[data-theme="dark"][data-pagina="instalacoes"] body .form select,html[data-theme="dark"][data-pagina="instalacoes"] body .search{background:#202b1c;color:var(--tx);border-color:#52604b}
html[data-theme="dark"][data-pagina="instalacoes"] body .notice,html[data-theme="dark"][data-pagina="instalacoes"] body .workflow-help,html[data-theme="dark"][data-pagina="instalacoes"] body .workflow-nav a,html[data-theme="dark"][data-pagina="instalacoes"] body .pending-box{background:#202b1c;color:var(--tx);border-color:#52604b}
html[data-theme="dark"][data-pagina="instalacoes"] body .tag{background:#283624;color:#eef2e8}html[data-theme="dark"][data-pagina="instalacoes"] body .install-map{background:#202b1c}
html[data-theme="light"][data-pagina="instalacoes"] body{--bg:#f4f6f1;--card:#fff;--card2:#f4f7f2;--line:#d2dbce;--tx:#182117;--muted:#52614e;--gold:#73581e;--green:#287a3b}
html[data-theme="light"][data-pagina="instalacoes"] body header{background:#fff}
html[data-theme="light"][data-pagina="instalacoes"] body .notice,html[data-theme="light"][data-pagina="instalacoes"] body .workflow-help,html[data-theme="light"][data-pagina="instalacoes"] body .workflow-nav a{background:#f4f8fc;color:#23384d}

html[data-theme="light"]:not([data-wej="painel"]):not([data-pagina="instalacoes"]) body{background:#e9eee5;color:#192319}
html[data-theme="light"]:not([data-wej="painel"]):not([data-pagina="instalacoes"]) body #tec{background:#eef2eb;color:#1b2216}
html[data-theme="light"]:not([data-wej="painel"]):not([data-pagina="instalacoes"]) body #tec .card{background:#fff;color:#1b2216}
html[data-theme="light"]:not([data-wej="painel"]):not([data-pagina="instalacoes"]) body #tec .met div,html[data-theme="light"]:not([data-wej="painel"]):not([data-pagina="instalacoes"]) body #tec .ac button,html[data-theme="light"]:not([data-wej="painel"]):not([data-pagina="instalacoes"]) body #tec .btn{background:#f2f5ef;color:#182117}
html[data-theme="light"]:not([data-wej="painel"]):not([data-pagina="instalacoes"]) body #tec input,html[data-theme="light"]:not([data-wej="painel"]):not([data-pagina="instalacoes"]) body #tec select{background:#fff;color:#182117}
.tema-toggle{top:76px;bottom:auto}
@media(max-width:640px){.tema-toggle{top:102px;right:8px;min-height:40px;padding:8px 10px;font-size:12px}.tema-toggle.tema-in-header{position:static;top:auto;right:auto;bottom:auto;min-height:40px;padding:8px 10px;font-size:12px}}

/* Tema claro mantém a paleta WEJ; escuro substitui também as regras antigas prioritárias. */
html[data-theme="light"][data-wej="painel"]{color-scheme:light;--fundo:#f4f1ea;--cartao:#fffcf7;--cartao2:#f7f1e6;--ln:rgba(28,25,23,.12);--tx:#1c1917;--mu:#6b6258;--ouro:#8b7355}
html[data-theme="light"][data-wej="painel"] body{background:#f4f1ea!important;color:#1c1917}
html[data-theme="dark"][data-wej="painel"]{color-scheme:dark;--fundo:#0d120b;--cartao:#151d12;--cartao2:#1b2517;--ln:rgba(220,230,205,.14);--tx:#eef2e8;--mu:#aeb9a4;--ouro:#cdb98a}
html[data-theme="dark"][data-wej="painel"] body{background:#0d120b!important;color:#eef2e8}
html[data-theme="dark"][data-wej="painel"] body header{background:rgba(13,18,11,.96)!important;color:#eef2e8;border-color:rgba(220,230,205,.14)}
html[data-theme="dark"][data-wej="painel"] body #login{background:#151d12;color:#eef2e8;border-color:rgba(220,230,205,.14)}
html[data-theme="dark"][data-wej="painel"] body #login input{background:#1b2517;color:#eef2e8;border-color:rgba(220,230,205,.22)}
html[data-theme="dark"][data-wej="painel"] body .kpi,html[data-theme="dark"][data-wej="painel"] body .num,html[data-theme="dark"][data-wej="painel"] body .registry,html[data-theme="dark"][data-wej="painel"] body .mapaside,html[data-theme="dark"][data-wej="painel"] body .viewtabs{background:#151d12;border-color:rgba(220,230,205,.14)}
html[data-theme="dark"][data-wej="painel"] body .registry-card,html[data-theme="dark"][data-wej="painel"] body .client-location,html[data-theme="dark"][data-wej="painel"] body .maptools button,html[data-theme="dark"][data-wej="painel"] body .mapaside select,html[data-theme="dark"][data-wej="painel"] body .bt,html[data-theme="dark"][data-wej="painel"] body .busca{background:#1b2517;color:#eef2e8;border-color:rgba(220,230,205,.16)}
html[data-theme="dark"][data-wej="painel"] body .registry-card p,html[data-theme="dark"][data-wej="painel"] body .client-location p,html[data-theme="dark"][data-wej="painel"] body .mapitem small{color:#aeb9a4}
html[data-theme="dark"][data-pagina="instalacoes"] body{--bg:#0d120b!important;--card:#151d12!important;--card2:#1b2517!important;--line:rgba(220,230,205,.16)!important;--tx:#eef2e8!important;--muted:#aeb9a4!important;--gold:#cdb98a!important;--green:#27843e!important;background:#0d120b!important;color:#eef2e8!important}
html[data-theme="dark"][data-pagina="instalacoes"] body header,html[data-theme="dark"][data-pagina="instalacoes"] body .card,html[data-theme="dark"][data-pagina="instalacoes"] body .item,html[data-theme="dark"][data-pagina="instalacoes"] body .client-record,html[data-theme="dark"][data-pagina="instalacoes"] body #clientDialog,html[data-theme="dark"][data-pagina="instalacoes"] body #equipDialog{background:#151d12!important;color:#eef2e8!important;border-color:rgba(220,230,205,.16)!important}
html[data-theme="dark"][data-pagina="instalacoes"] body input,html[data-theme="dark"][data-pagina="instalacoes"] body select,html[data-theme="dark"][data-pagina="instalacoes"] body .form input,html[data-theme="dark"][data-pagina="instalacoes"] body .form select,html[data-theme="dark"][data-pagina="instalacoes"] body .search{background:#202b1c!important;color:#eef2e8!important;border-color:#52604b!important}
html[data-theme="dark"][data-pagina="instalacoes"] body .notice,html[data-theme="dark"][data-pagina="instalacoes"] body .workflow-help,html[data-theme="dark"][data-pagina="instalacoes"] body .workflow-nav a,html[data-theme="dark"][data-pagina="instalacoes"] body .pending-box{background:#202b1c!important;color:#eef2e8!important;border-color:#52604b!important}
html[data-theme="light"][data-pagina="instalacoes"] body{background:#f4f6f1!important;color:#182117!important}
html[data-theme="light"][data-pagina="instalacoes"] body header,html[data-theme="light"][data-pagina="instalacoes"] body .card,html[data-theme="light"][data-pagina="instalacoes"] body .item,html[data-theme="light"][data-pagina="instalacoes"] body .client-record,html[data-theme="light"][data-pagina="instalacoes"] body #clientDialog,html[data-theme="light"][data-pagina="instalacoes"] body #equipDialog{background:#fff!important;color:#182117!important;border-color:#d2dbce!important}
html[data-theme="light"][data-pagina="instalacoes"] body input,html[data-theme="light"][data-pagina="instalacoes"] body select,html[data-theme="light"][data-pagina="instalacoes"] body .form input,html[data-theme="light"][data-pagina="instalacoes"] body .form select,html[data-theme="light"][data-pagina="instalacoes"] body .search{background:#fff!important;color:#182117!important;border-color:#cbd5c6!important}
html[data-theme="light"][data-wej="painel"] body .bt.pri,html[data-theme="dark"][data-wej="painel"] body .bt.pri{background:#2fb344!important;border-color:#2fb344!important;color:#fff!important}
html[data-theme="dark"][data-pagina="instalacoes"] body .save-state{background:#202b1c!important;color:#eef2e8!important;border-color:#52604b!important}
html[data-theme="dark"][data-pagina="instalacoes"] body .save-state[data-state="saving"]{background:#382d17!important;color:#ffe3a1!important;border-color:#9f7a2d!important}
html[data-theme="dark"][data-pagina="instalacoes"] body .save-state[data-state="saved"]{background:#17321f!important;color:#c6f2cc!important;border-color:#3c8a4b!important}
html[data-theme="dark"][data-pagina="instalacoes"] body .save-state[data-state="error"]{background:#3a201e!important;color:#ffd5d0!important;border-color:#a55048!important}
html[data-theme="light"][data-wej="ihm"]{color-scheme:light;--vidro:rgba(250,252,248,.88);--vidro2:rgba(255,255,255,.97);--tx:#182117;--mu:#52614e;--ln:#d2dbce;--pri:#315927;--bt:#f0f4ed}
html[data-theme="light"][data-wej="ihm"] body #topo .vid,html[data-theme="light"][data-wej="ihm"] body #barra,html[data-theme="light"][data-wej="ihm"] body #lista .li,html[data-theme="light"][data-wej="ihm"] body #ficha,html[data-theme="light"][data-wej="ihm"] body .caixa{color:#182117;border-color:#d2dbce}
html[data-theme="light"][data-wej="ihm"] body #marca{background:linear-gradient(145deg,#f7f9f5,#e8efe3);color:#315927;border-color:#b8c8b1}
html[data-theme="light"][data-wej="ihm"] body #geral .b{color:#fff}
html[data-theme="light"][data-wej="ihm"] body #barra small{color:var(--c)}
html[data-theme="light"][data-wej="ihm"] body #tec{--tx:#1b2216;--mu:#52614e;--ln:#d2dbce;--vidro2:#fff;--bt:#edf2ea;color:#1b2216}
html[data-theme="light"][data-wej="painel"]{--bg:#f4f1ea;--card:#fffcf7;--card2:#f7f1e6;--panel:#fff;--panel2:#f7f1e6;--line:#d9d1c2;--text:#1c1917;--muted:#6b6258;--gold:#8b7355;--blue:#315e8c}
html[data-theme="dark"][data-wej="painel"]{--bg:#0d120b;--card:#151d12;--card2:#1b2517;--panel:#151d12;--panel2:#1b2517;--line:#34412f;--text:#eef2e8;--muted:#aeb9a4;--gold:#cdb98a;--blue:#438de0}
html[data-theme="light"][data-wej="painel"] body .app .topbar{background:linear-gradient(135deg,#fff,#f5f3ed);color:#1c1917;border-color:#d9d1c2}
html[data-theme="light"][data-wej="painel"] body .app .card{background:#fff;color:#1c1917;border-color:#d9d1c2}
html[data-theme="light"][data-wej="painel"] body .app .metric,html[data-theme="light"][data-wej="painel"] body .app .chartbox,html[data-theme="light"][data-wej="painel"] body .app .tabbtn,html[data-theme="light"][data-wej="painel"] body .app .pill{background:#f5f4ef;color:#263323;border-color:#d9d1c2}
html[data-theme="light"][data-wej="painel"] body .app .site-link,html[data-theme="light"][data-wej="painel"] body .app .btn{background:#eef3eb;color:#253b25;border-color:#cbd5c6}
html[data-theme="light"][data-wej="painel"] body .shell>header{background:#fff;color:#1c1917;border-color:#d9d1c2}
html[data-theme="light"][data-wej="painel"] body .shell .panel,html[data-theme="light"][data-wej="painel"] body .shell .status{background:#fff;color:#1c1917;border-color:#d9d1c2}
html[data-theme="light"][data-wej="painel"] body .shell .panel p,html[data-theme="light"][data-wej="painel"] body .shell .legend,html[data-theme="light"][data-wej="painel"] body .shell .foot{color:#52614e}
html[data-theme="light"][data-wej="painel"] body .shell .banner{background:#eef5fb;color:#23384d}
html[data-theme="dark"][data-wej="painel"] body .app .topbar{background:linear-gradient(135deg,#12213a,#0b1422);color:#eef5ff}
html[data-theme="dark"][data-wej="painel"] body .shell>header{background:#10170fee;color:#eef2e8}
html[data-theme="dark"][data-wej="painel"] body .shell .panel,html[data-theme="dark"][data-wej="painel"] body .shell .status{background:#151d12;color:#eef2e8}
@media(max-width:700px){.app .topbar{position:relative;top:auto}.app .site-links{width:100%}.app .site-link{min-height:42px}.shell{padding:10px}.shell>header{gap:8px;padding:10px}.shell>header a{min-height:42px;display:inline-flex;align-items:center}.shell .map{height:56svh;min-height:300px}.tema-toggle.tema-in-header{font-size:12px;padding:8px 10px}}
@media(max-width:640px){#topo{left:7px;right:7px;top:7px;gap:6px}#topo #marca{order:1;flex:1 1 100%}#topo #hora{order:2}#topo>.bt2{order:3;padding:8px 10px}#topo #eng{order:4}#topo .tema-toggle{order:5;min-width:42px;padding:8px;justify-content:center}#topo #geral{order:6;flex:1 1 100%;min-height:50px}}
@media(max-width:640px){html[data-theme="light"][data-wej="painel"] body .shell .banner b{color:#23384d}}
@media(max-width:640px){.shell .panel{order:0}.shell .map{height:55svh;min-height:300px}}

/* Instalações: o mapa acompanha o fluxo da página e nunca cobre os formulários/listas. */
html[data-pagina="instalacoes"] body .map-card{position:static!important;top:auto!important;align-self:start}
