/* TechApp - Gestão · app mobile (iPhone, iPad, Android) – mesma identidade visual do aplicativo Windows.
   As cores vêm de cores.css (gerado a partir do tema do Windows). */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.4; color: var(--texto); background: var(--fundo);
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--lima); }
.oculto { display: none !important; }
svg.ic { width: 20px; height: 20px; flex: none; vertical-align: middle; }

/* ------------------------------------------------------------------ estrutura */
#app { min-height: 100%; }
.cabecalho {
  position: sticky; top: 0; z-index: 20; background: var(--cabecalho);
  padding: calc(env(safe-area-inset-top) + 6px) 14px 8px; display: flex; align-items: center; gap: 10px;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--verde) 0 62%, var(--lima) 62% 90%, var(--amarelo) 90%) 1;
}
.cabecalho .logo { height: 30px; cursor: pointer; }
.cabecalho .voltar { display: flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--acento);
  font-weight: 700; padding: 6px 4px; min-height: 40px; cursor: pointer; }
.cabecalho .titulo-cab { font-weight: 800; color: var(--acento); font-size: 17px; flex: 1; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis; }
.cabecalho .espaco { flex: 1; }
.btn-ico { border: 0; background: transparent; width: 42px; height: 42px; border-radius: 21px; display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer; position: relative; color: var(--texto-2); }
.btn-ico:active { background: var(--lima-claro); }
.badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--amarelo); color: #1E2A22; font-size: 11px; font-weight: 800; display: flex; align-items: center;
  justify-content: center; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--verde); color: #fff; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden; flex: none; font-size: 14px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.g { width: 84px; height: 84px; font-size: 30px; }
.avatar.m { width: 56px; height: 56px; font-size: 20px; }

.conteudo { padding: 14px 14px calc(86px + env(safe-area-inset-bottom)); max-width: 1500px; margin: 0 auto; }
.barra-sync { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; padding: 6px 12px;
  border-radius: 10px; margin: 0 0 10px; }
.barra-sync.off { background: var(--pil-vermelho-bg); color: var(--pil-vermelho-fg); }
.barra-sync.pend { background: var(--pil-amarelo-bg); color: var(--pil-amarelo-fg); }

/* barra inferior (iPhone) – mesma barra verde do aplicativo Windows */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--verde); display: flex;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 12px rgba(0, 0, 0, .15);
}
.tabbar button { flex: 1; border: 0; background: none; color: var(--barra-icone); display: flex; flex-direction: column;
  align-items: center; gap: 2px; font-size: 10.5px; font-weight: 700; padding: 4px 0; min-height: 50px;
  cursor: pointer; position: relative; }
.tabbar button.ativo { color: var(--amarelo); }
.tabbar svg.ic { width: 24px; height: 24px; }
.tabbar .badge { top: 0; right: calc(50% - 22px); }

/* menu lateral (iPad) */
.lateral { display: none; }
@media (min-width: 900px) {
  body.com-lateral .tabbar { display: none; }
  body.com-lateral .lateral {
    display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; width: 264px; z-index: 25;
    background: linear-gradient(180deg, var(--verde) 0%, var(--verde-esc) 100%); color: #fff; overflow-y: auto;
    padding: calc(env(safe-area-inset-top) + 14px) 0 calc(env(safe-area-inset-bottom) + 14px);
    border-right: 3px solid var(--lima);
  }
  body.com-lateral .cabecalho, body.com-lateral .conteudo-wrap { margin-left: 264px; }
  .conteudo { padding: 20px 24px 40px; }
}
.lateral .conta-lat { display: flex; align-items: center; gap: 10px; padding: 6px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .15); margin-bottom: 8px; }
.lateral .conta-lat b { display: block; }
.lateral .conta-lat small { color: var(--barra-icone); }
.lateral button { border: 0; background: none; color: #E8F3DA; display: flex; align-items: center; gap: 12px;
  padding: 11px 18px; text-align: left; font-weight: 600; cursor: pointer; border-left: 4px solid transparent; }
.lateral button.ativo { background: rgba(255, 255, 255, .1); border-left-color: var(--amarelo); color: #fff; }
.lateral button svg.ic { color: var(--barra-icone); }
.lateral button.ativo svg.ic { color: var(--amarelo); }

/* ------------------------------------------------------------------ títulos e cartões */
.titulo-pag { margin: 2px 0 12px; }
.titulo-pag h1 { margin: 0; font-size: 24px; color: var(--acento); font-weight: 800; letter-spacing: -.2px; }
.traco { display: flex; align-items: center; gap: 4px; margin: 4px 0 4px; }
.traco i { display: block; height: 4px; border-radius: 2px; }
.traco i:nth-child(1) { width: 38px; background: var(--lima); }
.traco i:nth-child(2) { width: 12px; background: var(--amarelo); }
.traco i:nth-child(3) { width: 80px; height: 1px; background: var(--lima); opacity: .5; }
.titulo-pag p { margin: 2px 0 0; color: var(--texto-2); font-size: 13.5px; }
.acoes-pag { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }

.cartao { background: var(--cartao); border: 1px solid var(--borda); border-radius: 14px; padding: 14px;
  margin-bottom: 12px; position: relative; }
.cartao::before { content: ""; position: absolute; top: -1px; left: 16px; width: 34px; height: 3px; border-radius: 2px;
  background: var(--lima); }
.cartao::after { content: ""; position: absolute; top: -1px; left: 53px; width: 10px; height: 3px; border-radius: 2px;
  background: var(--amarelo); }
.cartao.sem-detalhe::before, .cartao.sem-detalhe::after { display: none; }
.cartao h2, .secao { margin: 0 0 10px; font-size: 16px; color: var(--acento); font-weight: 800; display: flex;
  align-items: center; gap: 8px; flex-wrap: wrap; }
.cartao h2 small, .secao small { color: var(--texto-2); font-weight: 500; font-size: 12.5px; }
.cartao.alerta { border: 2px solid var(--amarelo); }
.sub { color: var(--texto-2); font-size: 13px; }
.rot { color: var(--texto-2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.val { font-weight: 600; word-break: break-word; }
.vazio { color: var(--texto-2); font-style: italic; text-align: center; padding: 18px 8px; }
.grade-info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
@media (min-width: 700px) { .grade-info.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* indicadores */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
@media (min-width: 700px) { .kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi { background: var(--cartao); border: 1px solid var(--borda); border-radius: 14px; padding: 12px; display: flex;
  gap: 10px; align-items: flex-start; min-width: 0; }
.kpi .ico { width: 36px; height: 36px; border-radius: 18px; background: var(--lima-claro); display: flex;
  align-items: center; justify-content: center; flex: none; }
.kpi .t { font-size: 11px; color: var(--texto-2); font-weight: 700; }
.kpi .v { font-size: 19px; font-weight: 800; color: var(--acento); line-height: 1.2; word-break: break-word; }
.kpi .s { font-size: 11.5px; color: var(--texto-2); }
@media (max-width: 520px) {
  .kpi { padding: 10px; }
  .kpi .ico { display: none; }
  .kpi .v { font-size: 17px; white-space: nowrap; letter-spacing: -.3px; }
  .kpis.k3 > .kpi:last-child:nth-child(odd), .kpis.k6 > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* etiquetas */
.pil { display: inline-flex; align-items: center; border-radius: 10px; padding: 2px 9px; font-weight: 700;
  font-size: 11.5px; white-space: nowrap; }
.pil.verde { background: var(--pil-verde-bg); color: var(--pil-verde-fg); }
.pil.amarelo { background: var(--pil-amarelo-bg); color: var(--pil-amarelo-fg); }
.pil.vermelho { background: var(--pil-vermelho-bg); color: var(--pil-vermelho-fg); }
.pil.neutro { background: var(--pil-neutro-bg); color: var(--pil-neutro-fg); }
.pil.azul { background: var(--pil-azul-bg); color: var(--pil-azul-fg); }
.pils { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------------ listas */
.lista { display: flex; flex-direction: column; gap: 8px; }
.item { background: var(--cartao); border: 1px solid var(--borda); border-radius: 12px; padding: 12px; display: flex;
  gap: 12px; align-items: center; cursor: pointer; min-height: 56px; }
.item:active { background: var(--lima-claro); border-color: var(--lima); }
.item .corpo { flex: 1; min-width: 0; }
.item .t1 { font-weight: 700; color: var(--texto); overflow: hidden; text-overflow: ellipsis; }
.item .t2 { font-size: 12.5px; color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; }
.item .dir { text-align: right; flex: none; max-width: 48%; }
.item .dir .v { font-weight: 800; color: var(--acento); white-space: nowrap; }
.item .mini { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--suave); flex: none; }
.item.pendente { border-style: dashed; border-color: var(--amarelo); }
.item.nova { border-color: var(--lima); background: var(--lima-claro); }
.grupo-lista { font-size: 12px; font-weight: 800; color: var(--texto-2); text-transform: uppercase; margin: 12px 2px 6px; }
.total-lista { text-align: right; font-weight: 800; color: var(--acento); padding: 10px 4px; }

/* tabela (iPad) */
.tabela-wrap { overflow-x: auto; border: 1px solid var(--borda); border-radius: 12px; background: var(--cartao); }
table.tab { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tab th { text-align: left; color: var(--texto-2); font-size: 11.5px; font-weight: 700; padding: 10px;
  border-bottom: 2px solid var(--lima); white-space: nowrap; }
table.tab td { padding: 10px; border-bottom: 1px solid var(--suave); }
table.tab tr:nth-child(even) td { background: var(--alt); }
table.tab td.num { text-align: right; white-space: nowrap; }

/* duas colunas no iPad (lista + detalhe) */
@media (min-width: 900px) {
  .duas-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .duas-col.l2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 700px) { .kpis.k6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ------------------------------------------------------------------ botões */
.btn { border: 1px solid var(--campo-borda); background: var(--cartao); color: var(--acento); border-radius: 10px;
  padding: 0 14px; min-height: 42px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; cursor: pointer; white-space: nowrap; }
.btn:active { background: var(--pressed); }
.btn.primario { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn.destaque { background: var(--lima); border-color: var(--lima); color: #fff; }
.btn.perigo { color: var(--vermelho); border-color: var(--vermelho); }
.btn.link { border: 0; background: none; color: var(--lima); text-decoration: underline; padding: 0 4px; }
.btn.cheio { width: 100%; }
.btn.peq { min-height: 34px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .5; }
.botoes { display: flex; gap: 8px; flex-wrap: wrap; }
.botoes.fim { justify-content: flex-end; }
.fab { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 26; width: 58px;
  height: 58px; border-radius: 29px; border: 0; background: var(--lima); color: #fff; display: flex;
  align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); cursor: pointer; }
.fab svg.ic { width: 28px; height: 28px; }
@media (min-width: 900px) { body.com-lateral .fab { bottom: 24px; } }

/* segmentos / abas */
.segmentos { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 2px; scrollbar-width: none; }
.segmentos::-webkit-scrollbar { display: none; }
.segmentos button { border: 1px solid var(--campo-borda); background: var(--cartao); color: var(--texto-2);
  border-radius: 10px; padding: 0 12px; min-height: 38px; font-weight: 700; white-space: nowrap; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; }
.segmentos button.ativo { border: 2px solid var(--lima); background: var(--lima-claro); color: var(--acento); }
.seg2 { display: flex; border: 1px solid var(--campo-borda); border-radius: 10px; overflow: hidden; }
.seg2 button { flex: 1; border: 0; background: var(--cartao); min-height: 42px; font-weight: 700; color: var(--acento);
  display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.seg2 button.ativo { background: var(--verde); color: #fff; }

/* ------------------------------------------------------------------ formulários */
.filtros { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px; }
@media (min-width: 600px) { .filtros { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }
.campo { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.campo label { font-size: 12px; font-weight: 700; color: var(--texto-2); }
.campo .ajuda { font-size: 12px; color: var(--texto-2); }
input.inp, select.inp, textarea.inp {
  width: 100%; min-height: 44px; border: 1px solid var(--campo-borda); background: var(--campo); border-radius: 10px;
  padding: 10px 12px; font-size: 16px; color: var(--texto); outline: none; -webkit-appearance: none; appearance: none;
}
select.inp { background-image: linear-gradient(45deg, transparent 50%, var(--texto-2) 50%),
  linear-gradient(135deg, var(--texto-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
  padding-right: 32px; }
textarea.inp { min-height: 88px; resize: vertical; }
input.inp:focus, select.inp:focus, textarea.inp:focus { border: 2px solid var(--lima); padding: 9px 11px; }
input.inp.num { text-align: right; }
.busca { position: relative; }
.busca svg.ic { position: absolute; left: 12px; top: 12px; color: var(--texto-2); }
.busca input.inp { padding-left: 40px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--lima); flex: none; }
.linha2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 700px) { .linha3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; } }
.secao-form { font-weight: 800; color: var(--acento); margin: 10px 0 8px; font-size: 14.5px; }
.erro-form { color: var(--vermelho); font-weight: 600; margin: 4px 0 10px; }
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.fotos .f { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--suave); }
.fotos .f img { width: 100%; height: 100%; object-fit: cover; }
.fotos .f button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 14px; border: 0;
  background: rgba(0, 0, 0, .6); color: #fff; font-weight: 800; cursor: pointer; }
.anexos .a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--borda);
  border-radius: 10px; margin-bottom: 6px; background: var(--alt); }
.anexos .a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }

/* ------------------------------------------------------------------ janelas (folhas que sobem de baixo) */
.veu { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 50; display: flex; align-items: flex-end;
  justify-content: center; animation: aparecer .15s ease-out; }
.folha { background: var(--fundo); width: 100%; max-height: calc(100% - env(safe-area-inset-top) - 24px);
  border-radius: 18px 18px 0 0; display: flex; flex-direction: column; animation: subir .22s ease-out; }
@media (min-width: 700px) {
  .veu { align-items: center; }
  .folha { width: 640px; max-width: 94vw; border-radius: 18px; max-height: 90vh; }
  .folha.larga { width: 920px; }
}
.folha .topo { display: flex; align-items: center; gap: 8px; padding: 14px 16px 8px; border-bottom: 1px solid var(--borda); }
.folha .topo h3 { margin: 0; flex: 1; color: var(--acento); font-size: 17px; }
.folha .meio { padding: 14px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.folha .rodape { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--borda);
  display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; background: var(--cartao);
  border-radius: 0 0 18px 18px; }
.folha .rodape .btn { flex: 1; }
@media (min-width: 700px) { .folha .rodape .btn { flex: none; min-width: 120px; } }
@keyframes subir { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }

.aviso-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom));
  z-index: 80; background: #17241B; color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600;
  max-width: 92vw; box-shadow: 0 4px 16px rgba(0, 0, 0, .3); animation: aparecer .2s; text-align: center; }
.aviso-toast.ok { background: var(--verde); }
.aviso-toast.erro { background: var(--vermelho); }
.carregando { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .25); display: flex;
  align-items: center; justify-content: center; }
.carregando div { background: var(--cartao); padding: 18px 22px; border-radius: 14px; font-weight: 700;
  color: var(--acento); display: flex; gap: 10px; align-items: center; }
.giro { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--lima-claro); border-top-color: var(--lima);
  animation: girar 0.8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ componentes específicos */
.barra-prazo { height: 8px; border-radius: 4px; background: var(--trilha); overflow: hidden; }
.barra-prazo i { display: block; height: 100%; border-radius: 4px; }
.grafico { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.grafico svg { width: 100%; min-width: 580px; height: auto; display: block; }
.anel { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--texto-2); }
.aneis { display: flex; gap: 10px; justify-content: space-around; flex-wrap: wrap; }
.cartao-membro { text-align: center; cursor: pointer; }
.cartao-membro .nome { font-weight: 800; color: var(--acento); margin-top: 6px; }
.grade-cartoes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .grade-cartoes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grade-cartoes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.perfil-topo { display: flex; gap: 14px; align-items: center; }
.perfil-topo .nome { font-size: 19px; font-weight: 800; color: var(--acento); }
.mapa { width: 100%; height: 62vh; background: var(--mapa); border-radius: 12px; border: 1px solid var(--borda);
  touch-action: none; overflow: hidden; }
.mapa svg { width: 100%; height: 100%; }
.logo-login { display: block; margin: 8px auto 14px; height: 120px; }
.tela-login { max-width: 420px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 24px) 18px 30px; }
.assinatura { text-align: center; font-size: 11.5px; color: var(--texto-2); margin: 16px 0 4px; letter-spacing: .3px; }
.assinatura b { color: var(--acento); }
.assinatura i { color: var(--amarelo); font-style: normal; }
.social { color: #fff !important; border: 0 !important; }
.social.insta { background: linear-gradient(45deg, #F58529, #DD2A7B 55%, #8134AF); }
.social.whats { background: #1FAF5A; }
.logo-card { background: #fff; border-radius: 10px; height: 96px; display: flex; align-items: center; justify-content: center;
  padding: 8px; }
.logo-card.escuro { background: #0E2A17; }
.logo-card img { max-width: 100%; max-height: 100%; }
.menu-mais { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 600px) { .menu-mais { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.menu-mais button { border: 1px solid var(--borda); background: var(--cartao); border-radius: 14px; min-height: 92px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-weight: 700;
  font-size: 12.5px; color: var(--acento); padding: 8px 4px; cursor: pointer; text-align: center; }
.menu-mais button svg.ic { width: 28px; height: 28px; color: var(--lima); }
.menu-mais button:active { background: var(--lima-claro); }
.nota { display: inline-flex; align-items: center; gap: 4px; }
input[type=range] { width: 100%; accent-color: var(--lima); height: 32px; }
.detalhe-linha { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--suave); }
.detalhe-linha:last-child { border-bottom: 0; }
.detalhe-linha span:last-child { font-weight: 700; text-align: right; }
.cor-ok { color: var(--ok) !important; }
.cor-verm { color: var(--vermelho) !important; }
.cor-atencao { color: var(--atencao-txt) !important; }
.cor-sub { color: var(--texto-2) !important; }
.galeria-foto { width: 100%; border-radius: 12px; display: block; margin-bottom: 8px; }
