/* Plataforma CASA — tema visual (painel escuro, cartões claros, cabeçalhos em faixa).
   Carregado depois de app.css: só redefine aparência, não muda estrutura das páginas. */
:root {
  --fonte: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 10px;
  --r-g: 16px;
  --papel: #f2f5f8;
  --linha: #e1e6ec;
  --tinta: #17212b;
  --tinta-2: #5b6776;
  --concreto: #8b95a3;
  --marinho: #0d3b22;
  --noite: #009440;
  --noite-2: #008a3c;
  --verde: #009440;
  --verde-esc: #007a35;
  --verde-claro: #e4f6ec;
  --sombra: 0 1px 2px rgba(16, 32, 54, .05), 0 6px 20px rgba(16, 32, 54, .06);
  --sombra-forte: 0 10px 30px rgba(10, 31, 54, .18);
}
body { font-size: 15px; background: var(--papel); }
h1, h2, h3, legend, .mes-nome, .eco-numeros strong, .tabela-calc caption { font-stretch: normal; letter-spacing: -0.015em; }
h1 { font-weight: 800; }
h2 { font-weight: 700; color: var(--marinho); }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- estrutura: menu lateral escuro + área de conteúdo ---------- */
body.com-menu { display: grid; grid-template-columns: 260px minmax(0, 1fr); background: var(--papel); }
.menu-fundo { display: none; }
.area { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.menu { background: linear-gradient(180deg, var(--noite) 0%, #007a35 100%); color: #effaf3; padding: 1.1rem .85rem .9rem; gap: .25rem; height: 100vh; overflow: hidden; }
.menu .marca { align-items: center; padding: .25rem 0 1rem; margin: 0 0 .5rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.menu .marca em { color: #c9ecd6; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.logo-placa { border-radius: 12px; padding: .45rem .7rem; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.logo-placa img { width: 128px; }
.menu-busca { display: flex; align-items: center; gap: .5rem; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 0 .65rem; margin: .25rem 0 .6rem; color: #c9ecd6; }
.menu-busca input { background: none; border: 0; color: #fff; min-height: 36px; padding: 0; font-size: .88rem; }
.menu-busca input::placeholder { color: #c9ecd6; }
.menu-busca input:focus { box-shadow: none; }
.menu-itens { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; margin: 0 -.35rem; padding: 0 .35rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.menu a { border-left: 0; border-radius: 9px; color: #e8f7ee; padding: .5rem .7rem; font-size: .9rem; }
.menu a:hover { background: rgba(255,255,255,.06); color: #fff; }
.menu a.ativo { background: linear-gradient(90deg, rgba(0,148,64,.28), rgba(0,148,64,.08)); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #2fd27a; }
.menu-solto { display: flex; align-items: center; gap: .7rem; font-weight: 600; }
.menu-grupo { display: block; padding: 0; margin: 0; text-transform: none; letter-spacing: 0; }
.menu-grupo > summary { list-style: none; display: flex; align-items: center; gap: .7rem; padding: .5rem .7rem; border-radius: 9px; color: #e8f7ee; font-size: .9rem; font-weight: 600; cursor: pointer; user-select: none; }
.menu-grupo > summary::-webkit-details-marker { display: none; }
.menu-grupo > summary:hover { background: rgba(255,255,255,.06); color: #fff; }
.menu-grupo > summary span { flex: 1; }
.menu-grupo > summary .seta { width: 14px; height: 14px; opacity: .6; transition: transform .15s; }
.menu-grupo[open] > summary .seta { transform: rotate(90deg); }
.menu-grupo[open] > summary { color: #fff; }
.menu-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 1.55rem; padding-left: .55rem; border-left: 1px solid rgba(255,255,255,.1); }
.menu-sub a { padding: .4rem .65rem; font-size: .86rem; }
.menu-pe { margin-top: .5rem; padding: .75rem .25rem 0; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: .6rem; }
.menu-usuario { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.menu-usuario b { color: #fff; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-usuario small { color: #c9ecd6; font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-sair { background: rgba(255,255,255,.06); border: 0; color: #e8f7ee; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; cursor: pointer; }
.menu-sair:hover { background: rgba(255,255,255,.12); color: #fff; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, #2fd27a, #009440); color: #fff; font-weight: 700; font-size: .8rem; text-decoration: none; }
.avatar:hover { color: #fff; }

/* barra superior */
.barra-topo { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .7rem clamp(1rem, 3vw, 2.25rem); background: rgba(255,255,255,.88); backdrop-filter: blur(8px); border-bottom: 1px solid var(--linha); }
.barra-titulo { font-weight: 700; color: var(--marinho); font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-dir { margin-left: auto; display: flex; align-items: center; gap: .6rem; min-width: 0; }
.menu-abrir { display: none; background: none; border: 1px solid var(--linha); border-radius: 9px; width: 38px; height: 38px; place-items: center; color: var(--marinho); cursor: pointer; }
.amb { margin: 0; padding: .3rem .7rem; font-size: .76rem; font-weight: 700; border-radius: 999px; border: 0; white-space: nowrap; text-decoration: none; }
.amb-sim { background: #e6f5ec; color: #00632b; }
.amb-teste { background: var(--ambar-claro); color: #7a5600; }
.sem-menu .amb { display: inline-block; margin-bottom: 1rem; }
.emp-ativo { margin: 0; display: flex; align-items: center; gap: .45rem; flex-wrap: nowrap; padding: .35rem .75rem; border: 1px solid var(--linha); border-left: 1px solid var(--linha); border-radius: 999px; background: #fff; text-decoration: none; color: var(--tinta); font-size: .84rem; min-width: 0; max-width: 420px; }
.emp-ativo:hover { border-color: var(--verde); color: var(--tinta); }
.emp-ativo span { color: var(--tinta-2); white-space: nowrap; }
.emp-ativo b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-ativo small { white-space: nowrap; }
.emp-ativo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--verde); flex: none; box-shadow: 0 0 0 3px var(--verde-claro); }
.conteudo { max-width: 1240px; padding: 1.5rem clamp(1rem, 3vw, 2.25rem) 4rem; }

/* ---------- cabeçalho da página em faixa escura ---------- */
.conteudo > .topo, .conteudo > header.topo { position: relative; overflow: hidden; align-items: center; padding: 1.4rem 1.6rem; border-radius: var(--r-g); background: linear-gradient(120deg, var(--noite) 0%, var(--noite-2) 60%, #006f30 100%); color: #effaf3; box-shadow: var(--sombra-forte); margin-bottom: 1.5rem; }
.conteudo > .topo::after { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(47,210,122,.22), transparent 65%); pointer-events: none; }
.conteudo > .topo h1 { color: #fff; font-size: 1.65rem; }
.conteudo > .topo .sub, .conteudo > .topo p.sub { color: #d9f2e2; }
.conteudo > .topo .migalha, .conteudo > .topo .migalha a { color: #d2f0dc; font-size: .82rem; }
.conteudo > .topo .acoes { position: relative; z-index: 1; }
.conteudo > .topo .btn-sec { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.25); }
.conteudo > .topo .btn-sec:hover { background: rgba(255,255,255,.16); color: #fff; }
.conteudo > .topo .st { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }

/* ---------- botões e campos ---------- */
.btn { border-radius: 10px; font-weight: 700; padding: .62rem 1.15rem; box-shadow: 0 2px 6px rgba(0,148,64,.25); border-width: 1.5px; }
.btn-sec { box-shadow: none; background: #fff; border-color: #cfe7d9; }
.btn-sec:hover { background: var(--verde-claro); }
.btn-perigo { box-shadow: none; }
input, select, textarea { border: 1.5px solid #d5dce4; border-radius: 10px; min-height: 42px; }
input:focus, select:focus, textarea:focus { border-color: var(--verde); box-shadow: 0 0 0 4px rgba(0,148,64,.14); }
input[readonly] { background: #f5f7fa; border-color: #e5eaf0; }
.campo > span { font-size: .84rem; color: #34414f; }

/* ---------- cartões ---------- */
form.pilha > fieldset, .conteudo > fieldset, .bloco, section.acompanhamento, .vazio, .lista-obras, .passo, .sim-form, .economia, .resultado, section.cert, .acesso, .lead-simulacao, .cartao-folha, .caixa-folha {
  background: #fff; border: 1px solid var(--linha); border-radius: var(--r-g); box-shadow: var(--sombra);
}
form.pilha > fieldset { padding: 1.25rem 1.4rem 1.4rem; }
form.pilha > fieldset > legend { float: left; width: 100%; display: flex; align-items: center; gap: .55rem; color: var(--marinho); font-size: 1rem; margin-bottom: 1rem; padding: 0; }
form.pilha > fieldset > legend::before { content: ""; width: 6px; height: 18px; border-radius: 3px; background: linear-gradient(180deg, #2fd27a, var(--verde)); }
form.pilha > fieldset > legend + * { clear: both; }
.bloco { padding: 1.25rem 1.4rem; margin-top: 1.5rem; }
.vazio { padding: 1.5rem; text-align: center; border-style: dashed; box-shadow: none; }
.estreito { max-width: 720px; }

/* ---------- tabelas ---------- */
.tabela { border: 1px solid var(--linha); border-radius: var(--r-g); box-shadow: var(--sombra); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.tabela thead th { background: #f6f8fb; color: #4d5a69; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.tabela th, .tabela td { padding: .75rem .9rem; border-bottom: 1px solid #edf1f5; }
.tabela tbody tr:hover > td { background: #fafcfe; }
.grade-folha thead th { background: linear-gradient(180deg, #00a347, var(--noite)); color: #fff; }
.st { border: 0; font-weight: 700; padding: .2rem .6rem; }
.st-nao_enviado, .st-vazio { background: #eef1f5; color: #5b6776; }
.st-enviado, .st-andamento { background: #e6f5ec; color: #00632b; }
.st-sucesso, .st-concluido, .st-fechado { background: var(--verde-claro); color: var(--verde-esc); }
.st-advertencia { background: #edf7e6; color: #4e7a10; }
.st-erro { background: var(--erro-claro); color: var(--erro); }
.st-pendente { background: var(--ambar-claro); color: #7a5600; }
.st-excluido { background: #f1eef6; color: #5f4b8b; }

/* ---------- avisos ---------- */
.aviso { border-left-width: 0; border-radius: 12px; padding: .8rem 1rem .8rem 2.6rem; position: relative; box-shadow: var(--sombra); }
.aviso::before { position: absolute; left: .9rem; top: .78rem; width: 1.15rem; height: 1.15rem; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: #fff; }
.aviso-ok { background: #effaf3; } .aviso-ok::before { content: "✓"; background: var(--verde); }
.aviso-erro { background: #fdf0ef; } .aviso-erro::before { content: "!"; background: var(--erro); }
.aviso-alerta { background: #fff8e6; } .aviso-alerta::before { content: "!"; background: var(--ambar); }

/* ---------- abas e outros ---------- */
.abas-folha { border-bottom: 0; background: #fff; border: 1px solid var(--linha); border-radius: 12px; padding: 4px; display: inline-flex; box-shadow: var(--sombra); margin-bottom: 1rem; }
.abas-folha a { border-radius: 9px; padding: .45rem 1rem; font-size: .9rem; }
.kanban-col { border-radius: var(--r-g); background: #e9eef3; }
.lead { border-radius: 12px; }
.mes { border-radius: 10px; }
.passo-n { border-width: 0; background: #eef1f5; }

/* ---------- painel gerencial ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
.dash-principal { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.dash-lateral { display: flex; flex-direction: column; gap: 1.25rem; }
.cartao { background: #fff; border: 1px solid var(--linha); border-radius: var(--r-g); box-shadow: var(--sombra); padding: 1.15rem 1.25rem; min-width: 0; }
.cartao-cab { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.cartao-cab h2 { font-size: 1rem; margin: 0; display: flex; align-items: center; gap: .5rem; }
.cartao-cab h2 .ico { color: var(--verde); }
.cartao-cab small { color: var(--tinta-2); }
.heroi { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1rem; align-items: center; padding: 1.75rem 1.9rem; border-radius: var(--r-g); background: linear-gradient(120deg, #ffffff 0%, #f1f8f4 55%, #e2f4e9 100%); border: 1px solid var(--linha); box-shadow: var(--sombra); }
.heroi h1 { font-size: 2rem; line-height: 1.12; color: var(--marinho); }
.heroi h1 em { font-style: normal; background: linear-gradient(90deg, var(--verde), #006f30); -webkit-background-clip: text; background-clip: text; color: transparent; }
.heroi p { color: var(--tinta-2); margin: .7rem 0 1.1rem; max-width: 48ch; }
.heroi .acoes { gap: .6rem; }
.heroi svg.ilustra { width: 100%; height: auto; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.kpi { background: #fff; border: 1px solid var(--linha); border-radius: var(--r-g); box-shadow: var(--sombra); padding: 1rem 1.1rem; display: flex; gap: .8rem; align-items: center; text-decoration: none; color: var(--tinta); min-width: 0; }
a.kpi:hover { border-color: #bfe3cd; color: var(--tinta); }
.kpi-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--verde-claro); color: var(--verde-esc); flex: none; }
.kpi-ico .ico { width: 21px; height: 21px; }
.kpi span { display: block; color: var(--tinta-2); font-size: .8rem; }
.kpi strong { display: block; font-size: 1.35rem; font-weight: 800; color: var(--marinho); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-destaque { background: linear-gradient(135deg, var(--noite), #006f30); border-color: transparent; }
.kpi-destaque span { color: #d2f0dc; }
.kpi-destaque strong { color: #fff; }
.kpi-destaque .kpi-ico { background: rgba(47,210,122,.18); color: #5ef0a0; }
.graficos { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; }
.grafico svg { width: 100%; height: auto; display: block; overflow: visible; }
.grafico .eixo { fill: var(--concreto); font-size: 11px; font-family: var(--fonte); }
.grafico .grade-l { stroke: #edf1f5; stroke-width: 1; }
.grafico .ponto { fill: #fff; stroke: var(--verde); stroke-width: 2; }
.grafico .alvo { fill: transparent; cursor: pointer; }
.grafico .alvo:hover + .ponto, .grafico .ponto:hover { r: 6; }
.grafico-total { font-size: 1.5rem; font-weight: 800; color: var(--marinho); }
.rosca { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 1rem; align-items: center; }
.rosca svg { width: 130px; height: 130px; }
.rosca-legenda { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; font-size: .86rem; }
.rosca-legenda li { display: flex; align-items: center; gap: .5rem; }
.rosca-legenda i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.rosca-legenda b { margin-left: auto; }
.c-ok { background: #009440; } .c-proc { background: #8a948e; } .c-erro { background: #d4483b; }
.acesso-rapido { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.acesso-rapido a { display: flex; align-items: center; gap: .75rem; padding: .55rem .6rem; border-radius: 12px; text-decoration: none; color: var(--tinta); }
.acesso-rapido a:hover { background: #f4f8fb; color: var(--tinta); }
.acesso-rapido .kpi-ico { width: 36px; height: 36px; border-radius: 10px; }
.acesso-rapido b { display: block; font-size: .9rem; }
.acesso-rapido small { display: block; font-size: .76rem; }
.acesso-rapido .seta { margin-left: auto; color: var(--concreto); width: 16px; height: 16px; }
.cartoes-ajuda { display: grid; grid-template-columns: 1fr auto; gap: .75rem; }
.ajuda { border-radius: var(--r-g); padding: 1rem 1.1rem; display: flex; align-items: center; gap: .7rem; text-decoration: none; background: linear-gradient(135deg, var(--noite), #006f30); color: #fff; box-shadow: var(--sombra-forte); }
.ajuda:hover { color: #fff; filter: brightness(1.08); }
.ajuda small { display: block; color: #d2f0dc; }
.ajuda-sup { flex-direction: column; justify-content: center; text-align: center; min-width: 96px; background: linear-gradient(135deg, #009440, #07803a); }
.pendencias { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; font-size: .88rem; }
.pendencias li { display: flex; gap: .55rem; align-items: flex-start; }
.pendencias li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--erro); margin-top: .45rem; flex: none; }
.pendencias li.alerta::before { background: var(--ambar); }

/* ---------- responsivo ---------- */
@media (max-width: 1100px) {
  .dash { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  body.com-menu { display: block; }
  .menu { position: fixed; inset: 0 auto 0 0; width: 280px; height: 100vh; z-index: 50; transform: translateX(-105%); transition: transform .2s; flex-direction: column; flex-wrap: nowrap; padding: 1.1rem .85rem .9rem; }
  body.menu-aberto .menu { transform: none; }
  .menu-fundo { display: none; }
  body.menu-aberto .menu-fundo { display: block; position: fixed; inset: 0; background: rgba(5,15,28,.45); z-index: 40; }
  .menu a { padding: .5rem .7rem; border-bottom: 0; }
  .menu a.ativo { background: linear-gradient(90deg, rgba(0,148,64,.28), rgba(0,148,64,.08)); }
  .menu .marca { width: auto; padding: .25rem 0 1rem; }
  .menu-pe { width: auto; padding: .75rem .25rem 0; }
  .menu-abrir { display: grid; }
  .barra-titulo { display: none; }
  .emp-ativo span { display: none; }
  .graficos, .heroi { grid-template-columns: 1fr; }
  .heroi svg.ilustra { display: none; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr; }
  .emp-ativo small, .amb { display: none; }
  .conteudo > .topo { padding: 1.1rem 1.15rem; }
}
.cartao .tabela { box-shadow: none; margin-bottom: 0; }

/* ajustes do painel */
body.com-menu { background: linear-gradient(90deg, #007a35 260px, var(--papel) 260px); }
.menu { position: sticky; top: 0; align-self: start; }
.grafico svg { width: auto; height: auto; }
.grafico > svg { width: 100%; }
.cartao-cab small { white-space: nowrap; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi { flex-direction: column; align-items: flex-start; gap: .6rem; }
.kpi strong { font-size: 1.25rem; }
.rosca { grid-template-columns: 1fr; justify-items: center; }
.rosca-legenda { width: 100%; }
.acesso-rapido a > span:not(.kpi-ico) { flex: 1; min-width: 0; }
.acesso-rapido a > .ico:last-child { color: var(--concreto); width: 16px; height: 16px; }
@media (max-width: 900px) { body.com-menu { background: var(--papel); } .menu { position: fixed; } }
.grafico .ico, .cartao .ico { width: 18px; height: 18px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- tema verde #009440 (sem azul) ---------- */
.menu a.ativo { background: rgba(255,255,255,.2); box-shadow: inset 3px 0 0 #fff; color: #fff; }
.menu a:hover, .menu-grupo > summary:hover { background: rgba(255,255,255,.12); }
.menu-busca { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.22); }
.menu-busca input::placeholder { color: #d2f0dc; }
.menu-sub { border-left-color: rgba(255,255,255,.3); }
.menu .marca, .menu-pe { border-color: rgba(255,255,255,.2); }
.menu-sair { background: rgba(255,255,255,.14); }
.avatar { background: #fff; color: #009440; }
.barra-dir .avatar { background: #009440; color: #fff; }
.conteudo > .topo .btn:not(.btn-sec) { background: #fff; color: #009440; border-color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.conteudo > .topo .btn:not(.btn-sec):hover { background: #effaf3; color: #007a35; }
.conteudo > .topo::after { background: radial-gradient(circle, rgba(255,255,255,.18), transparent 65%); }
.kpi-destaque .kpi-ico { background: rgba(255,255,255,.2); color: #fff; }
.ajuda-sup { background: linear-gradient(135deg, #0d3b22, #00632b); }
.st-enviado, .st-andamento { background: #eef1f5; color: #4b5563; }
.amb-sim { background: #e6f5ec; color: #00632b; }
.menu .logo-branca { width: 168px; height: auto; display: block; margin: .2rem auto 0; }
.menu .marca { gap: .55rem; } .menu .marca em { display: block; margin-top: .15rem; }
.heroi { grid-template-columns: 1fr; }
.acesso-marca { justify-content: center; } .acesso-marca img { width: 170px; }
