:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --texto: var(--tg-theme-text-color, #111827);
  --suave: var(--tg-theme-hint-color, #6b7280);
  --card: var(--tg-theme-secondary-bg-color, #f3f4f6);
  --botao: var(--tg-theme-button-color, #2f6fed);
  --botao-texto: var(--tg-theme-button-text-color, #ffffff);
  --bom: #16a34a;
  --ruim: #dc2626;
  --ezimar: #2f6fed;
  --thaissa: #8b3fd9;
  --total: #6b7280;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: var(--tg-theme-bg-color, #111418); --texto: var(--tg-theme-text-color, #f3f4f6); --card: var(--tg-theme-secondary-bg-color, #1c2128); --bom: #4ade80; --ruim: #f87171; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--texto); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: hidden; }
main { max-width: 480px; margin: 0 auto; padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); }
h2 { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--suave); margin: 0 0 8px; font-weight: 600; }
section { background: var(--card); border-radius: 14px; padding: 14px; margin: 0 0 12px; }
.aviso { text-align: center; color: var(--suave); padding: 32px 8px; }
.erro { text-align: center; padding: 24px 8px; }

button, .btn { font: inherit; border: 0; border-radius: 10px; min-height: 44px; padding: 0 14px; background: var(--botao); color: var(--botao-texto); cursor: pointer; }
button.sec { background: transparent; color: var(--texto); background: var(--card); }
button:disabled { opacity: .5; }

.topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.topo .nome { flex: 1; text-align: center; font-weight: 700; font-size: 17px; }
.topo button { min-width: 44px; padding: 0; background: var(--card); color: var(--texto); font-size: 18px; }
.modos { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.modos button { flex: 1; min-height: 40px; background: var(--card); color: var(--texto); font-size: 14px; }
.modos button.ativo { background: var(--botao); color: var(--botao-texto); }
.abas { display: flex; gap: 6px; margin-bottom: 12px; }
.abas button { flex: 1; background: var(--card); color: var(--texto); }
.abas button.ativo { background: var(--botao); color: var(--botao-texto); }
.intervalo { display: flex; gap: 6px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.intervalo input { flex: 1; min-width: 120px; min-height: 44px; border-radius: 10px; border: 0; padding: 0 10px; background: var(--card); color: var(--texto); font: inherit; }

.linha { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 5px 0; }
.linha .v { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.linha .sub { color: var(--suave); font-size: 13px; }
.grande { font-size: 24px; font-weight: 700; }
.bom { color: var(--bom); } .ruim { color: var(--ruim); } .suave { color: var(--suave); }
.barra { margin: 2px 0 6px; }
.pessoa { display: flex; justify-content: space-between; font-size: 13px; color: var(--suave); }
.pessoa b { color: var(--texto); font-weight: 600; }
.ponto { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.meta { height: 8px; border-radius: 4px; background: rgba(128,128,128,.2); overflow: hidden; margin: 4px 0 8px; }
.meta > i { display: block; height: 100%; background: var(--bom); border-radius: 4px; }
.meta > i.perto { background: #f59e0b; } .meta > i.estourou { background: var(--ruim); }
.tabela { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.tabela td, .tabela th { white-space: nowrap; padding: 6px 0 6px 6px; text-align: right; font-weight: 500; }
.tabela th { color: var(--suave); font-size: 12px; font-weight: 600; }
.tabela td:first-child, .tabela th:first-child { text-align: left; }
.tabela .tot { font-weight: 700; }
.item { padding: 8px 0; }
.item .desc { overflow-wrap: anywhere; }
.item button { min-height: 36px; font-size: 13px; padding: 0 10px; margin-top: 6px; }
.item .ruim-btn { background: var(--ruim); color: #fff; }
.csv { width: 100%; margin-top: 4px; }
svg { display: block; max-width: 100%; color: var(--texto); }
