/* Tema escuro opcional · financeiro.tracktor.com.br
   Padrão continua claro. Escuro só quando o Max escolhe no botão do topo (salvo no navegador). */

.tema{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;color:rgba(255,255,255,.85);cursor:pointer;background:none;border:0;flex:none;padding:0}
.tema:hover{color:#fff;background:rgba(255,255,255,.12)}
.tema svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.tema .lua{display:block}
.tema .sol{display:none}
.tema-sp{margin-left:auto}
html[data-theme=dark] .tema .lua{display:none}
html[data-theme=dark] .tema .sol{display:block}

html[data-theme=dark]{
  color-scheme:dark;
  --bg:#131513; --card:#1C1F1C; --inset:#252825; --hairline:#30342F;
  --ink:#ECEEE9; --ink2:#C6C9C2; --muted:#8E928B;
  --verde:#119e3f; --verde-hover:#0d762f; --verde-soft:#153A22; --verde-tx:#7EE2A0;
  --amber:#E9A24E; --amber-soft:#332612;
  --red:#F0796A; --red-soft:#3A1E1A;
}

/* superfícies que estavam com branco fixo */
html[data-theme=dark] input:not([type=checkbox]):not([type=radio]),
html[data-theme=dark] select,
html[data-theme=dark] textarea{background-color:var(--card);color:var(--ink)}
html[data-theme=dark] .fx input[type=text],
html[data-theme=dark] .fx input:not([type]),
html[data-theme=dark] .fx input,
html[data-theme=dark] .fx select,
html[data-theme=dark] .sp-li input,
html[data-theme=dark] .sp-li select,
html[data-theme=dark] .aba-inp{background-color:var(--card);color:var(--ink)}
html[data-theme=dark] .top .btn{background:var(--card);color:var(--verde)}
html[data-theme=dark] .top .btn:hover{background:var(--inset)}
html[data-theme=dark] .mespill .mes{background:var(--card);color:var(--ink)}
html[data-theme=dark] .menu,
html[data-theme=dark] .modal{background:var(--card)}
html[data-theme=dark] .grp:hover,
html[data-theme=dark] .row:hover,
html[data-theme=dark] .rel:hover{background:var(--inset)}
html[data-theme=dark] .chipf{background:var(--inset);border-color:var(--muted)}
html[data-theme=dark] .seg2,
html[data-theme=dark] .m-impl,
html[data-theme=dark] .obj .barra,
html[data-theme=dark] .pj-i .prob .bar{background:var(--inset)}
html[data-theme=dark] .m-serv{border-color:var(--muted)}
html[data-theme=dark] .trk i.som{background:repeating-linear-gradient(45deg,#153A22,#153A22 5px,#1F5230 5px,#1F5230 10px)}
html[data-theme=dark] .acoes button.perigo:hover{background:var(--red-soft);color:var(--red)}
html[data-theme=dark] .cores span.on{box-shadow:inset 0 0 0 2px var(--card)}
html[data-theme=dark] .toast{background:var(--card);color:var(--ink);border:1px solid var(--hairline)}

/* gráfico SVG dos fechamentos (cores vêm por atributo) */
html[data-theme=dark] svg [fill="#1B1D1A"]{fill:var(--ink)}
html[data-theme=dark] svg [fill="#454843"]{fill:var(--ink2)}
html[data-theme=dark] svg [fill="#6C6E69"]{fill:var(--muted)}
html[data-theme=dark] svg [stroke="#DBDED8"]{stroke:var(--hairline)}
html[data-theme=dark] svg [fill="#0a5c26"]{fill:var(--verde-tx)}
html[data-theme=dark] svg [stroke="#0a5c26"]{stroke:var(--verde-tx)}

/* login (não usa variáveis) */
html[data-theme=dark] body.login .card{background:#1C1F1C}
html[data-theme=dark] body.login .logo{color:#ECEEE9}
html[data-theme=dark] body.login p{color:#C6C9C2}
html[data-theme=dark] body.login input{background:#252825;border-color:#30342F;color:#ECEEE9}
