:root {
  /* Séries dos gráficos (paleta categórica validada; a cor acompanha o cliente) */
  --serie-1: #2a78d6; --serie-2: #eb6834; --serie-3: #1baf7a; --serie-4: #eda100;
  --serie-5: #e87ba4; --serie-6: #008300; --serie-7: #6250d6; --serie-8: #e34948;
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #1f2a2e;
  --muted: #6b7478;
  --line: #e4e1da;
  --accent: #2f6f62;
  --accent-ink: #ffffff;
  --accent-soft: #e2eeea;
  --danger: #b3412f;
  --danger-soft: #f7e6e2;
  --warn-soft: #fbf1d9;
  --warn-ink: #7a5a12;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 42, 46, .06), 0 4px 14px rgba(31, 42, 46, .06);
  --tabbar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --serie-1: #3987e5; --serie-2: #d95926; --serie-3: #199e70; --serie-4: #c98500;
    --serie-5: #d55181; --serie-6: #008300; --serie-7: #9085e9; --serie-8: #e66767;
    --bg: #14191b;
    --surface: #1d2427;
    --surface-2: #192022;
    --ink: #e9ecec;
    --muted: #9aa4a7;
    --line: #2c3539;
    --accent: #5fb3a1;
    --accent-ink: #0f1a17;
    --accent-soft: #1f3530;
    --danger: #e0816f;
    --danger-soft: #3a2420;
    --warn-soft: #3a3120;
    --warn-ink: #e9c97a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 88px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding: calc(env(safe-area-inset-top) + 14px) 16px 8px;
}
.topbar h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 4px 16px 16px;
  outline: none;
}

.aviso {
  margin: 0 16px 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--warn-soft);
  color: var(--warn-ink);
  font-size: 14px;
}

/* Navegação de mês */
.mes-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 12px;
}
.mes-nav strong { font-size: 17px; }
.mes-nav button {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

/* Cartões de resumo */
.resumo {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.resumo .cartao {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.resumo .rotulo { font-size: 13px; color: var(--muted); }
.resumo .valor { font-size: 22px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.resumo .cartao.destaque { background: var(--accent); color: var(--accent-ink); }
.resumo .cartao.destaque .rotulo { color: inherit; opacity: .85; }

/* Listas */
.grupo { margin-bottom: 16px; }
.grupo-cab {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding: 0 4px 6px;
}
.lista {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  padding: 12px 14px;
  cursor: pointer;
}
.item + .item { border-top: 1px solid var(--line); }
.item:active { background: var(--surface-2); }
.item .principal { font-weight: 600; font-variant-numeric: tabular-nums; }
.item .lateral { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.item .sub {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.item .tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 6px;
}

.vazio {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
}
.vazio strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* Seções de formulário (ajustes / relatório) */
.secao {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.secao h2 { font-size: 15px; margin: 0 0 12px; }
.secao p.dica { color: var(--muted); font-size: 14px; margin: -6px 0 12px; }

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
}
input, textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 11px 12px;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 46px;
  -webkit-appearance: none;
  appearance: none;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.linha2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Seletor de hora: hora + minutos (intervalos de 10 e 15 min) */
.campo-hora { margin-bottom: 12px; }
.campo-hora .rotulo { display: block; font-size: 14px; font-weight: 600; color: var(--muted); }
.hora { display: flex; align-items: center; gap: 4px; margin-top: 5px; }
.hora span { font-weight: 700; color: var(--muted); }
.hora select {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 10px 8px;
  font: inherit;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  text-align-last: center;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  -webkit-appearance: none;
  appearance: none;
}
.hora select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

/* Botões */
.btn {
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  min-height: 46px;
}
.btn.primario { background: var(--accent); color: var(--accent-ink); }
.btn.secundario { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn.perigo { background: var(--danger-soft); color: var(--danger); }
.btn.bloco { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.botoes { display: grid; gap: 10px; }

/* Tabela de prévia do relatório */
.previa { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.previa td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.previa td:last-child { text-align: right; font-weight: 600; }
.previa tr.total td { border-bottom: 0; padding-top: 10px; font-size: 18px; font-weight: 700; }
.previa tr.total td:first-child { font-weight: 700; }

.pendencias {
  background: var(--warn-soft);
  color: var(--warn-ink);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 12px;
}
.pendencias ul { margin: 4px 0 0; padding-left: 18px; }

/* Botão flutuante */
.fab {
  position: fixed;
  right: max(16px, calc(50% - 304px));
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  width: 58px; height: 58px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 6px 18px rgba(47, 111, 98, .35);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 6;
}
.fab[hidden] { display: none; }

/* Barra de abas */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 7;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  height: var(--tabbar-h);
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
}
.tabbar svg {
  width: 24px; height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tabbar button.ativo { color: var(--accent); }

/* Folhas (diálogos) */
dialog.folha {
  border: 0;
  padding: 0;
  width: 100%;
  max-width: 520px;
  margin: auto auto 0;
  border-radius: 20px 20px 0 0;
  background: var(--surface);
  color: var(--ink);
  max-height: 92vh;
}
@media (min-width: 600px) {
  dialog.folha { margin: auto; border-radius: 20px; }
}
dialog.folha::backdrop { background: rgba(10, 15, 17, .45); }
dialog.folha form { padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); }
dialog.folha h2 { margin: 0 0 16px; font-size: 20px; }
.calc {
  margin: -2px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.calc small { font-weight: 500; color: var(--muted); }
.erro { color: var(--danger); font-size: 14px; margin: 0 0 12px; }
.acoes { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.acoes .espaco { flex: 1; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 90px);
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  max-width: calc(100% - 32px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 20;
}
.toast.visivel { opacity: 1; transform: translate(-50%, 0); }

/* Botão "Agora" ao lado do rótulo */
.campo-hora .rotulo { display: flex; align-items: center; justify-content: space-between; }
.agora {
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 4px;
  cursor: pointer;
}

/* Registro em andamento (sem horário de fim) */
.item.aberto { background: var(--accent-soft); }
.selo {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 2px 8px;
}

/* Listas de seleção (cliente) */
select.sel {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 11px 36px 11px 12px;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7478' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 46px;
  -webkit-appearance: none;
  appearance: none;
}
select.sel:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

/* Filtro de clientes */
.filtros {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -16px 14px;
  padding: 2px 16px;
  scrollbar-width: none;
}
.filtros::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.chip.ativo { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.item .cli { font-size: 12px; font-weight: 600; color: var(--accent); margin-left: 6px; }

/* Cadastro de clientes */
.cab-secao { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cab-secao h2 { margin: 0; }
.btn-link { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; padding: 4px 0; }
.secao .lista { box-shadow: none; border: 1px solid var(--line); }
.item.arquivado .principal { color: var(--muted); }
.historico {
  font-size: 13px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 8px 12px;
  margin: -4px 0 12px;
}
.historico strong { color: var(--ink); display: block; margin-bottom: 2px; }
.historico div { display: flex; justify-content: space-between; align-items: center; padding: 2px 0; font-variant-numeric: tabular-nums; }
.historico button { border: 0; background: none; color: var(--danger); font: inherit; font-size: 13px; cursor: pointer; }
label.check { display: flex; gap: 10px; align-items: center; color: var(--ink); font-weight: 500; }
label.check input { width: 20px; height: 20px; min-height: 0; margin: 0; flex: none; -webkit-appearance: checkbox; appearance: auto; }
label.check small { color: var(--muted); font-weight: 400; }

/* Resumo geral por cliente */
.previa th { text-align: right; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 0 6px; }
.previa th:first-child { text-align: left; }
.previa.geral td { text-align: right; font-weight: 500; }
.previa.geral td:first-child { text-align: left; font-weight: 600; }
.previa.geral tr.total td { font-size: 15px; font-weight: 700; }

/* Totais em mais de uma moeda */
.resumo .valor.multi { font-size: 17px; line-height: 1.3; }
.moeda-tit { font-size: 14px; margin: 14px 0 6px; color: var(--accent); }
.moeda-tit:first-of-type { margin-top: 0; }
.previa.geral td { font-size: 14px; padding-left: 10px; white-space: nowrap; vertical-align: top; }
.previa.geral td:first-child { padding-left: 0; white-space: normal; }
.previa.geral td small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.previa.geral th { padding-left: 10px; }

/* Barra com 6 abas */
.tabbar { grid-template-columns: repeat(6, 1fr); }
.tabbar button { font-size: 10.5px; letter-spacing: -0.1px; padding: 0; min-width: 0; }
.tabbar svg { width: 22px; height: 22px; }

/* Serviços pontuais */
.campo-servico[hidden] { display: none; }
small.opcional { font-weight: 400; color: var(--muted); }
.dica-form { font-size: 13px; color: var(--muted); margin: 4px 0 14px; }
.itens-cab { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 6px; }
.rotulo-campo { font-size: 14px; font-weight: 600; color: var(--muted); }
.itens { display: grid; gap: 8px; margin-bottom: 6px; }
.itens .item-linha { display: grid; grid-template-columns: 1fr 112px 32px; gap: 6px; align-items: center; }
.itens .item-linha input { margin-top: 0; }
.itens .item-linha button {
  border: 0; background: var(--danger-soft); color: var(--danger);
  border-radius: 8px; height: 32px; font-size: 18px; line-height: 1; cursor: pointer;
}
.itens .vazio-itens { font-size: 13px; color: var(--muted); }

.secao-tit { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 4px 6px; margin-top: 4px; }
.selo.concluido { color: var(--muted); }
.item .srv { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 6px; }

/* Detalhe do serviço */
.voltar { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; padding: 4px 0 10px; cursor: pointer; }
.det-cab h2 { font-size: 20px; margin: 0 0 4px; }
.det-cab p { margin: 0 0 4px; color: var(--muted); font-size: 14px; }
.botoes.lado { grid-template-columns: 1fr 1fr; margin-bottom: 16px; }

/* Resumo geral agrupado por empresa */
.empresa, .andamento { margin-bottom: 14px; }
.empresa-nome { font-weight: 700; font-size: 15px; background: var(--surface-2); border-radius: 8px; padding: 7px 10px; margin-bottom: 2px; }
.empresa-nome small { font-weight: 500; color: var(--muted); font-size: 12px; }
.previa.empresa-tab td { font-size: 14px; vertical-align: top; }
.previa.empresa-tab td:first-child { padding-left: 10px; font-weight: 500; }
.previa.empresa-tab td small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.previa.empresa-tab td:last-child { white-space: nowrap; padding-left: 10px; }
.previa.empresa-tab tr.subtotal td { font-weight: 700; border-bottom: 0; }
.andamento .previa.empresa-tab td:last-child { color: var(--muted); }

/* Sobre o app */
.sobre-cab { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sobre-cab img { border-radius: 11px; }
.sobre-cab strong { display: block; font-size: 17px; }
.sobre-cab span { color: var(--muted); font-size: 14px; }
.historico-versoes { margin-top: 12px; font-size: 14px; }
.historico-versoes summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 4px 0; }
.versao-item { margin-top: 8px; }
.versao-item span { color: var(--muted); font-size: 13px; }
.versao-item ul { margin: 4px 0 0; padding-left: 18px; color: var(--ink); }
.versao-item li { margin: 2px 0; }

/* Cabeçalho do serviço com ícones de ação */
.det-titulo { display: flex; align-items: flex-start; gap: 8px; }
.det-titulo h2 { flex: 1; min-width: 0; }
.det-icones { display: flex; gap: 6px; flex: none; }
.icone {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent);
  display: grid; place-items: center;
  cursor: pointer;
}
.icone svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icone:disabled { opacity: .4; cursor: default; }
.secao.horas-info { padding: 10px 16px; }
.secao.horas-info .previa td { border-bottom: 0; }
.secao-tit.lista-cab { display: flex; justify-content: space-between; margin-top: 18px; }
.secao-tit.lista-cab span:last-child { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Créditos em Sobre o app */
.creditos { margin: 0 0 12px; font-size: 14px; }
.creditos span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 2px; }
.creditos strong { display: block; font-weight: 600; }

/* Fator por horário */
.fator-campos { background: var(--surface-2); border-radius: 10px; padding: 10px 12px 2px; margin: -4px 0 14px; }
.fator-campos input { background: var(--surface); }
.item .fator { display: inline-block; font-size: 12px; font-weight: 600; color: var(--warn-ink); background: var(--warn-soft); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }

/* Nome completo do cliente abaixo do apelido (Ajustes → Clientes) */
.item .principal .nome-completo { display: block; font-weight: 400; font-size: .82em; color: var(--muted); margin-top: 1px; }

/* Cobranças */
.situacao { display: inline-block; font-size: 11.5px; font-weight: 650; border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 1px; }
.situacao.aberta { color: var(--accent); background: var(--accent-soft); }
.situacao.vencida { color: var(--danger); background: var(--danger-soft); }
.situacao.paga { color: var(--muted); background: var(--surface-2); }
.txt-vencida { color: var(--danger); font-weight: 600; }
.previa.receber td:last-child { font-size: 17px; font-weight: 700; }
.cob-tit { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.cob-tit .situacao { font-size: 12px; }
.pagamento { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; margin: 14px 0 4px; }
.pagamento label { margin: 0; }
#form-cobranca .pendencias { margin: 12px 0 0; }
#form-cobranca .acoes { margin-top: 14px; flex-wrap: wrap; }
.item.cob-info { border-radius: 14px; border: 1px solid var(--line); margin-bottom: 12px; background: var(--surface); }
.btn-link.mais { display: block; margin: 8px auto 0; }
.dica.rodape { margin: 18px 4px 0; font-size: 13px; color: var(--muted); }

/* Painel */
.segmentos { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; margin-bottom: 14px; }
.segmentos button { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); padding: 8px; border-radius: 9px; cursor: pointer; }
.segmentos button.ativo { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.painel-tit { font-size: 15px; margin: 4px 4px 10px; color: var(--muted); font-weight: 600; }
.cartoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.cartao { background: var(--surface); border: 0; border-radius: 14px; box-shadow: var(--shadow); padding: 12px 12px 11px; text-align: left; font: inherit; color: var(--ink); display: block; min-width: 0; }
button.cartao { cursor: pointer; }
button.cartao:active { background: var(--surface-2); }
.cartao .rot { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cartao .val { font-size: 21px; font-weight: 700; margin: 4px 0 3px; font-variant-numeric: tabular-nums; letter-spacing: -0.3px; }
.cartao .val.multi { font-size: 17px; line-height: 1.25; }
.cartao .val.multi span { display: block; }
.cartao .det { font-size: 12px; color: var(--muted); line-height: 1.3; }
.cartao.alerta .val { color: var(--danger); }
.evol-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; flex-wrap: wrap; }
.ano-nav { margin: 0; }
.filtros.medida { margin: 0; }
.graf-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.graf-cab h2 { margin: 0; }
.graf-cab span { font-size: 13px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
svg.barras { display: block; width: 100%; height: auto; margin: 8px 0 6px; }
svg.barras .grade { stroke: var(--line); stroke-width: 1; }
svg.barras .grade.base { stroke: var(--muted); stroke-opacity: .5; }
svg.barras .eixo { font-size: 10px; fill: var(--muted); font-variant-numeric: tabular-nums; }
svg.barras .eixo.sel { fill: var(--ink); font-weight: 700; }
svg.barras .destaque { fill: var(--surface-2); stroke: var(--line); }
svg.barras .alvo { fill: transparent; cursor: pointer; }
.legenda { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i, i.ponto { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
i.ponto { margin-right: 6px; vertical-align: -1px; }
.legenda b { color: var(--ink); font-weight: 600; }
.mes-detalhe { margin-top: 10px; }
.mes-detalhe td.mes-detalhe-tit { padding-left: 0 !important; font-weight: 700 !important; text-align: left !important; }
#form-cobranca .pago-data { margin-top: 14px; }
#form-cobranca .acoes.rapido .primario { flex-basis: 100%; order: -1; }

/* Visualizador de PDF */
dialog.visualizador { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--bg); color: var(--ink); display: none; flex-direction: column; }
dialog.visualizador[open] { display: flex; }
dialog.visualizador::backdrop { background: rgba(0, 0, 0, .5); }
.pdf-barra { display: flex; align-items: center; gap: 6px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; background: var(--surface);
  border-bottom: 1px solid var(--line); flex: none; }
.pdf-titulo { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-bt { width: 36px; height: 36px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; padding: 0; }
.pdf-bt svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pdf-zoom { font-size: 12px; font-weight: 600; color: var(--muted); min-width: 38px; text-align: center; font-variant-numeric: tabular-nums; }
.pdf-baixar { padding: 8px 12px; font-size: 13px; white-space: nowrap; flex: none; }
.pdf-paginas { flex: 1; overflow: auto; padding: 12px 12px calc(16px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.pdf-paginas canvas { display: block; margin: 0 auto 12px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); border-radius: 2px; }
.pdf-msg { text-align: center; color: var(--muted); margin-top: 40px; }
@media (max-width: 420px) {
  .pdf-titulo { display: none; }
  .pdf-barra { justify-content: space-between; }
}

/* Cobranças de serviço e pagamentos em partes */
.situacao.parcial { color: var(--warn-ink); background: var(--warn-soft); }
.cob-servicos { margin: 12px 0 4px; }
.cob-srv { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: var(--surface-2); }
.cob-srv-cab { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.cob-srv-cab span { font-weight: 600; white-space: nowrap; }
.cob-srv-info { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cob-srv-desc { font-size: 13.5px; margin: 6px 0 0; white-space: pre-line; }
.previa tr.pag td { font-size: 14px; color: var(--muted); font-weight: 500; }
.previa tr.saldo td { font-weight: 700; font-size: 16px; }
.remover-pag { font-size: 12px; margin-left: 6px; padding: 0; }
.pagamento.com-valor { grid-template-columns: 1fr 1fr; }
.sel-servicos { display: grid; gap: 8px; margin: 4px 0 14px; }
.sel-srv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: start; padding: 14px; margin: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); font-weight: 400; line-height: 1.35; }
.sel-srv:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.sel-srv input[type="checkbox"] { -webkit-appearance: checkbox; appearance: auto; width: 22px; height: 22px; min-height: 0; padding: 0; margin: 1px 0 0;
  border: 0; accent-color: var(--accent); grid-row: span 2; }
.sel-srv-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sel-srv-txt strong { font-size: 15px; font-weight: 600; color: var(--ink); }
.sel-srv-txt small { color: var(--muted); font-size: 12.5px; }
.sel-srv-val { grid-column: 2; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.pagamento:not(.com-valor) { grid-template-columns: 1fr; }

/* Filtro Mensais | Serviços | Todos (Horas e Despesas) */
.segmentos.tres { grid-template-columns: repeat(3, 1fr); margin: 0 0 12px; }
.segmentos.tres button { padding: 7px 4px; font-size: 13.5px; }
/* Detalhe do serviço: concluir */
.botoes.lado .concluir { grid-column: 1 / -1; }
