:root {
  --verde: #1f8a5b;
  --verde-claro: #e6f4ed;
  --verde-escuro: #15694a;
  --azul: #2f6fed;
  --azul-claro: #e8effd;
  --vermelho: #d64545;
  --vermelho-claro: #fdecec;
  --dourado: #c9a227;
  --fundo: #f1f3f2;
  --card: #ffffff;
  --texto: #0f1b15;
  --suave: #6b7a72;
  --borda: #e7ebe9;
  --sombra: 0 2px 10px rgba(15, 27, 21, .06);
  --sombra-alta: 0 12px 40px rgba(15, 27, 21, .16);
  --r: 20px;
  --nav-h: 68px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

button, input, select, textarea {
  font-family: inherit;
  font-size: 15px;
  color: inherit;
}

button { cursor: pointer; border: 0; background: none; }

a { color: var(--verde); }

.oculto { display: none !important; }

.marca {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.4px;
}

.marca svg { flex: none; }
.marca span { white-space: nowrap; }
.marca span i { font-style: normal; color: var(--dourado); }

/* ---------------- Login ---------------- */

.entrada {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 18px;
  background: radial-gradient(1100px 520px at 50% -10%, #dff0e7 0%, var(--fundo) 60%);
}

.entrada-caixa {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 26px;
  padding: 30px 26px 26px;
  box-shadow: var(--sombra-alta);
}

.entrada-caixa h1 {
  margin: 22px 0 4px;
  font-size: 24px;
  letter-spacing: -.6px;
}

.entrada-caixa p.sub {
  margin: 0 0 22px;
  color: var(--suave);
  font-size: 14px;
  line-height: 1.5;
}

.abas-entrada {
  display: flex;
  background: var(--fundo);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 20px;
}

.abas-entrada button {
  flex: 1;
  padding: 10px;
  border-radius: 11px;
  font-weight: 600;
  color: var(--suave);
  font-size: 14px;
}

.abas-entrada button.ativo {
  background: var(--card);
  color: var(--texto);
  box-shadow: var(--sombra);
}

/* ---------------- Formularios ---------------- */

.campo { margin-bottom: 14px; }

.campo label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--suave);
  margin-bottom: 6px;
}

.campo input,
.campo select,
.campo textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--borda);
  border-radius: 14px;
  background: #fbfcfb;
  outline: none;
  transition: border-color .15s, background .15s;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
  border-color: var(--verde);
  background: var(--card);
}

.campo-linha {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  padding: 6px 0 14px;
}

.check input { width: 18px; height: 18px; accent-color: var(--verde); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  background: var(--verde);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  transition: transform .08s, background .15s;
}

.btn:active { transform: scale(.985); }
.btn:hover { background: var(--verde-escuro); }
.btn[disabled] { opacity: .6; pointer-events: none; }

.btn-claro {
  background: var(--fundo);
  color: var(--texto);
}
.btn-claro:hover { background: #e6eae8; }

.btn-perigo { background: var(--vermelho); }
.btn-perigo:hover { background: #b93a3a; }

.btn-linha { display: flex; gap: 10px; }

.aviso {
  background: var(--vermelho-claro);
  color: #a32d2d;
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.4;
}

.aviso.bom { background: var(--verde-claro); color: var(--verde-escuro); }

/* ---------------- Layout do painel ---------------- */

.topo {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--borda);
  padding: 12px 16px;
}

.topo-int {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mes-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--borda);
  border-radius: 999px;
  padding: 4px;
  box-shadow: var(--sombra);
}

.mes-nav button {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--suave);
}

.mes-nav button:hover { background: var(--fundo); color: var(--texto); }

.mes-nav .rotulo {
  min-width: 104px;
  text-align: center;
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
  cursor: pointer;
}

.icone-topo {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--borda);
  background: var(--card);
  display: grid;
  place-items: center;
  color: var(--suave);
}

.icone-topo:hover { color: var(--verde); border-color: var(--verde); }

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 18px 16px calc(var(--nav-h) + 28px);
}

.titulo-pagina {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 18px;
}

.titulo-pagina h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -.9px;
}

.olho {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--suave);
  border-radius: 999px;
}
.olho:hover { background: var(--card); }

/* ---------------- Cards ---------------- */

.grade {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.card {
  background: var(--card);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--sombra);
}

.card-kpi .cab {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.card-kpi .rotulo {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--suave);
}

.card-kpi .valor {
  font-size: clamp(14.5px, 4.3vw, 22px);
  font-weight: 800;
  letter-spacing: -.8px;
  white-space: nowrap;
}

.bolha {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: none;
}

.bolha.verde { background: var(--verde-claro); color: var(--verde); }
.bolha.azul { background: var(--azul-claro); color: var(--azul); }
.bolha.vermelha { background: var(--vermelho-claro); color: var(--vermelho); }
.bolha.cinza { background: var(--fundo); color: var(--suave); }

.txt-verde { color: var(--verde); }
.txt-azul { color: var(--azul); }
.txt-vermelho { color: var(--vermelho); }
.txt-suave { color: var(--suave); }

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 26px 24px 30px;
  background: linear-gradient(135deg, #1f8a5b 0%, #15694a 100%);
  color: #fff;
  box-shadow: 0 14px 30px rgba(21, 105, 74, .28);
  margin-bottom: 22px;
}

.hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -110px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
}

.hero .rotulo {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  opacity: .85;
}

.hero .valor {
  font-size: clamp(26px, 8vw, 34px);
  font-weight: 800;
  letter-spacing: -1.2px;
  margin-top: 8px;
  white-space: nowrap;
}

.hero .nota { margin-top: 10px; font-size: 13px; opacity: .85; }

.atalhos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.atalho {
  background: var(--card);
  border-radius: var(--r);
  padding: 18px 10px 14px;
  text-align: center;
  box-shadow: var(--sombra);
  color: var(--verde);
  transition: transform .1s;
}

.atalho:hover { transform: translateY(-2px); }
.atalho span {
  display: block;
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--texto);
  line-height: 1.3;
}

/* ---------------- Segmentos e listas ---------------- */

.segmento {
  display: flex;
  background: #e9ecea;
  border-radius: 16px;
  padding: 5px;
  margin-bottom: 16px;
}

.segmento button {
  flex: 1;
  padding: 11px 6px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  color: var(--suave);
}

.segmento button.ativo {
  background: var(--card);
  color: var(--texto);
  box-shadow: var(--sombra);
}

.painel { background: var(--card); border-radius: var(--r); box-shadow: var(--sombra); overflow: hidden; }

.painel-cab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--borda);
}

.painel-cab h3 { margin: 0; font-size: 16px; letter-spacing: -.3px; }

.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--fundo);
  font-weight: 600;
  font-size: 13.5px;
}

.mini-btn:hover { background: #e6eae8; }
.mini-btn.destaque { background: var(--verde); color: #fff; }
.mini-btn.destaque:hover { background: var(--verde-escuro); }
.painel-cab .mini-btn:first-of-type { margin-left: auto; }

.linha {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--borda);
}

.linha:last-child { border-bottom: 0; }
.linha:hover { background: #fafbfa; }

.linha .data {
  font-size: 12.5px;
  color: var(--suave);
  width: 46px;
  flex: none;
  font-variant-numeric: tabular-nums;
}

.linha .info { flex: 1; min-width: 0; }

.linha .nome {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.linha .tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--suave);
  margin-top: 3px;
}

.ponto { width: 7px; height: 7px; border-radius: 999px; flex: none; }

.linha .cifra {
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.linha.quitado .nome, .linha.quitado .cifra { opacity: .45; text-decoration: line-through; }

.acao-linha {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--suave);
  flex: none;
}

.acao-linha:hover { background: var(--fundo); color: var(--texto); }
.acao-linha.pago { color: var(--verde); }

.vazio {
  padding: 34px 20px;
  text-align: center;
  color: var(--suave);
  font-size: 14px;
  line-height: 1.6;
}

.barra {
  height: 8px;
  border-radius: 999px;
  background: var(--fundo);
  overflow: hidden;
  margin-top: 10px;
}

.barra i { display: block; height: 100%; border-radius: 999px; background: var(--verde); }

/* ---------------- Grafico ---------------- */

.grafico-caixa {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 20px 16px;
}

.legenda { width: 100%; display: grid; gap: 9px; }

.legenda-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
}

.legenda-item b { margin-left: auto; font-variant-numeric: tabular-nums; }

.colunas {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 130px;
  padding: 16px;
}

.coluna { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.coluna .par { display: flex; align-items: flex-end; gap: 3px; height: 100%; width: 100%; justify-content: center; }
.coluna .par i { width: 9px; border-radius: 4px 4px 0 0; min-height: 3px; display: block; }
.coluna .par i.r { background: var(--verde); }
.coluna .par i.d { background: #f0b4b4; }
.coluna small { font-size: 10.5px; color: var(--suave); text-transform: capitalize; }

/* ---------------- Navegacao ---------------- */

.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  height: var(--nav-h);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--borda);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--suave);
  font-size: 11px;
  font-weight: 600;
}

.nav button.ativo { color: var(--verde); }

/* ---------------- Modal ---------------- */

.modal-fundo {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 27, 21, .45);
  display: grid;
  place-items: end center;
  padding: 0;
  animation: aparecer .15s ease;
}

@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
@keyframes subir { from { transform: translateY(30px); } to { transform: translateY(0); } }

.modal {
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 26px 26px 0 0;
  padding: 8px 20px 24px;
  animation: subir .2s ease;
}

.modal-punho {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: var(--borda);
  margin: 8px auto 14px;
}

.modal h3 { margin: 0 0 16px; font-size: 20px; letter-spacing: -.5px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 16px);
  transform: translateX(-50%);
  z-index: 80;
  background: #0f1b15;
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--sombra-alta);
  animation: aparecer .15s ease;
  max-width: 90vw;
  text-align: center;
}

.toast.erro { background: var(--vermelho); }

.carregando {
  padding: 46px;
  text-align: center;
  color: var(--suave);
  font-size: 14px;
}

/* ---------------- Telas estreitas ---------------- */

@media (max-width: 520px) {
  .marca { font-size: 17px; }
  .marca span { max-width: 96px; overflow: hidden; text-overflow: ellipsis; }

  .painel-cab { flex-wrap: wrap; }
  .painel-cab h3 { width: calc(100% - 28px); }
  .painel-cab .mini-btn:first-of-type { margin-left: 0; }

  .card { padding: 14px 13px; }
  .grade { gap: 10px; }
  .linha { gap: 9px; padding: 13px 13px; }
  .linha .data { width: 40px; font-size: 12px; }
  .linha .nome { font-size: 14.5px; }
  .linha .cifra { font-size: 14.5px; }
  .acao-linha { width: 28px; height: 28px; }
  .titulo-pagina h2 { font-size: 25px; }
}

@media (max-width: 340px) {
  .marca span { display: none; }
}

/* ---------------- Desktop ---------------- */

@media (min-width: 900px) {
  .nav {
    top: 0;
    right: auto;
    bottom: 0;
    width: 210px;
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    padding: 84px 14px 20px;
    border-top: 0;
    border-right: 1px solid var(--borda);
  }

  .nav button {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 14px;
    font-size: 14.5px;
  }

  .nav button.ativo { background: var(--verde-claro); }

  .topo { padding-left: 226px; }
  main { padding-left: 226px; padding-right: 24px; padding-bottom: 40px; max-width: 1260px; }
  .toast { bottom: 24px; left: calc(50% + 105px); }
  .modal-fundo { place-items: center; }
  .modal { border-radius: 26px; padding: 20px 24px 24px; animation: aparecer .15s ease; }
  .modal-punho { display: none; }
  .grafico-caixa { flex-direction: row; align-items: center; }
  .grafico-caixa .legenda { max-width: 340px; }
}
