:root {
  /* Marca German Sports: preto #000, vermelho #EE3023, amarelo #FAD70E —
     aqui em tons mais sóbrios (grafite, tijolo, dourado) pra uso diário. */
  --ink: #1f1c1b;
  --muted: #6f6862;
  --paper: #ffffff;
  --bg: #f6f4ef;
  --line: #e7e2d9;
  --graphite: #211e1d;
  --graphite-2: #34302d;
  --brand: #b8322a;          /* vermelho-tijolo (ações principais) */
  --brand-dark: #922620;
  --brand-soft: #fbece8;
  --gold: #e8b923;           /* dourado (detalhes) */
  --gold-soft: #fdf5d8;
  --gold-line: #f1dc8f;
  --marca-preto: #1a1a1a;
  --marca-vermelho: #ee3023;
  --marca-amarelo: #fad70e;
  --ok: #1c7a44;             /* verde só pra "deu certo / pago" */
  --ok-soft: #e6f4ec;
  --red: #c7362b;
  --red-bg: #fdecea;
  --shadow-sm: 0 1px 2px rgba(35, 25, 20, 0.06);
  --shadow: 0 8px 24px rgba(35, 25, 20, 0.08);
  --shadow-lg: 0 16px 40px rgba(35, 25, 20, 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --font: 'Figtree', system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  --font-display: 'Figtree', var(--font);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Topbar ---------- */
.topbar {
  position: relative;
  background: linear-gradient(135deg, var(--graphite), var(--graphite-2));
  color: #fff;
  box-shadow: 0 4px 20px rgba(20, 15, 12, .25);
}
/* as três faixas da marca na borda de baixo (o preto vira claro sobre o fundo escuro, como no logo) */
.topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: linear-gradient(100deg,
    #f2eee8 0 33.3%, var(--marca-vermelho) 33.3% 66.6%, var(--marca-amarelo) 66.6% 100%);
}
.topbar-inner {
  max-width: 1240px;
  margin: auto;
  padding: 18px 24px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: #fff;
}
.brand-logo { height: 62px; width: auto; display: block; }
.brand-sub {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
}
.topbar nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  padding: 5px;
}
.topbar nav a {
  color: rgba(255, 255, 255, .85);
  text-decoration: none;
  font-size: 16.5px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.topbar nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.topbar nav a.active { background: var(--gold); color: var(--graphite); }

.shell { max-width: 1240px; margin: auto; padding: 28px 20px 60px; }

/* ---------- Flashes ---------- */
.flashes { margin-bottom: 20px; display: grid; gap: 8px; }
.flash { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13.5px; box-shadow: var(--shadow-sm); }
.flash-success { background: var(--ok-soft); border-left: 4px solid var(--ok); color: #125c32; }
.flash-error { background: var(--red-bg); border-left: 4px solid var(--red); color: var(--red); }

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 22px;
}
.card h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: -.01em;
}
.hint { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 0 0 18px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.field { display: grid; gap: 7px; }
.field.wide { grid-column: span 2; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.field label.req:after { content: ' *'; color: var(--red); }
input, select, textarea {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 10px 12px;
  font: 14px/1.4 var(--font);
  color: var(--ink);
  min-height: 42px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; min-height: 60px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(184, 50, 42, .14);
}

.computed {
  margin-top: 18px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13.5px;
}
.computed b { color: var(--brand-dark); }

/* ---------- Buttons ---------- */
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
button, .btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 20px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform .1s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: var(--shadow-sm);
}
button:hover, .btn:hover { background: var(--brand-dark); box-shadow: var(--shadow); }
button:active, .btn:active { transform: translateY(1px); }
button.secondary, .btn.secondary { background: #f1eee8; color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; }
button.secondary:hover, .btn.secondary:hover { background: #e8e3da; }
button.danger, .btn.danger { background: var(--red-bg); color: var(--red); border: 1.5px solid #f4c9c9; box-shadow: none; }
button.danger:hover, .btn.danger:hover { background: #fbdada; }
.mini { padding: 6px 12px; font-size: 11.5px; }

.cpf-notice {
  margin-top: 8px;
  padding: 12px 14px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-sm);
  color: var(--graphite);
  font-size: 12.5px;
  line-height: 1.5;
}
.cpf-notice button { margin-top: 8px; padding: 7px 12px; font-size: 11.5px; margin-right: 6px; }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { border-collapse: collapse; width: 100%; min-width: 900px; font-size: 12.5px; }
th {
  background: var(--graphite-2);
  color: #fff;
  text-align: left;
  padding: 12px 14px;
  white-space: nowrap;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
tbody tr:nth-child(even) td { background: #fbfaf7; }
tr:hover td { background: var(--gold-soft); }

/* ---------- Summary / stats ---------- */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 22px; }
.summary-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.summary-card h3 { margin: 0 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.summary-card ul { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.summary-card li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.summary-card li:last-child { border-bottom: none; }
.summary-card .total { font-weight: 800; color: var(--brand); font-size: 22px; }

.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 18px; }
.filters .field { min-width: 170px; }

.status-pill { padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-PAGO_TUDO { background: #dff3e4; color: #176b3a; }
.status-EM_DIA { background: #e4f0fb; color: #1a5aa8; }
.status-ATRASADO { background: #fff2d6; color: #9a6a00; }
.status-SEM_COBRANCA { background: #eef0ee; color: #5b635b; }

/* situação do atleta (vai ou não ao evento) */
.situ-ATIVO { background: #dff3e4; color: #176b3a; }
.situ-CANCELAR { background: #fff0dc; color: #a35600; }
.situ-CANCELADO_SEM_MULTA { background: #fdecec; color: #b23737; }
.situ-CANCELADO_COM_MULTA { background: #f7d9d9; color: #8f1f1f; }
.situ-TRANSFERIDO { background: #ece4fb; color: #5b32a8; }
.situ-RESOLVER { background: #fdecf5; color: #a8327c; }

.valor-pacote { font-size: 15px; }
.box-fora { grid-column: 1 / -1; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.box-fora summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--muted); }
.box-fora .form-grid { margin-top: 12px; }

/* situação financeira do responsável (tela Financeiro) */
.sit-QUITADO { background: #dff3e4; color: #176b3a; }
.sit-EM_DIA { background: #e4f0fb; color: #1a5aa8; }
.sit-DEVENDO { background: #fff2d6; color: #9a6a00; }
.sit-RESOLVER { background: #fdecf5; color: #a8327c; }
.sit-SEM_COBRANCA { background: #eef0ee; color: #5b635b; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tfoot td { border-top: 2px solid var(--line); background: #f4f1eb; }
details.parcelas { margin-top: 6px; font-size: 11.5px; }
details.parcelas summary { cursor: pointer; color: var(--muted); }
details.parcelas ul { margin: 6px 0 0; padding-left: 16px; }
.parcelas-resumo { font-size: 11px; color: var(--muted); }

.stat-row { display: flex; gap: 18px; flex-wrap: wrap; margin: 10px 0 24px; }
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  min-width: 170px;
  flex: 1 1 170px;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--brand);
}
.stat:nth-child(3n+2) { border-top-color: var(--gold); }
.stat:nth-child(3n) { border-top-color: var(--graphite); }
.stat b { display: block; font-family: var(--font-display); font-size: 26px; color: var(--graphite); letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--muted); }

.eventos-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.eventos-list li {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px;
}

@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .field.wide, .field.full { grid-column: span 1; }
  .topbar nav { width: 100%; justify-content: flex-start; overflow-x: auto; border-radius: var(--radius-sm); }
}

a:not(.btn) { color: var(--brand); }
a:not(.btn):hover { color: var(--brand-dark); }

/* quadro de resumo do resultado da venda */
.resumo-venda { background: var(--gold-soft); border-color: var(--gold-line); text-align: center; }
.resumo-venda h2 { color: var(--brand-dark); }
.resumo-venda p { margin: 8px 0; font-size: 14px; }
.resumo-receita { font-family: var(--font-display); font-size: 24px; font-weight: 800; color: var(--ok); }

/* funil do Kommo no relatório */
.funil-etapas { display: flex; flex-wrap: wrap; gap: 12px; }
.funil-etapa {
  display: flex; flex-direction: column; gap: 2px; min-width: 130px;
  padding: 12px 16px; border-radius: var(--radius-sm); background: #f4f1eb; border-left: 4px solid #b4aba0;
}
.funil-etapa b { font-size: 24px; font-weight: 800; color: var(--graphite); }
.funil-etapa span { font-size: 12.5px; color: var(--muted); }
.funil-etapa small { font-size: 11.5px; color: var(--muted); }
.funil-etapa.total { background: var(--graphite); border-left-color: var(--gold); }
.funil-etapa.total b, .funil-etapa.total span { color: #fff; }
.funil-etapa.etapa-inscricao { border-left-color: var(--ok); }
.funil-etapa.etapa-perdidos { border-left-color: var(--red); }

/* relatório: responsável + celular legível */
.col-resp { min-width: 190px; }
.col-resp b { display: block; font-size: 13.5px; }
.col-resp .tel { display: block; font-size: 14px; font-weight: 600; color: var(--graphite-2); margin: 3px 0 4px; letter-spacing: .02em; }

/* editor das datas das parcelas */
.venc-lista { display: flex; flex-direction: column; gap: 6px; }
.venc-linha { display: flex; align-items: center; gap: 12px; }
.venc-linha input[type=date] { min-height: 36px; padding: 5px 10px; }
.venc-n { width: 28px; font-weight: 800; color: var(--brand); }
.venc-valor { font-weight: 700; color: var(--graphite); font-variant-numeric: tabular-nums; }
.venc-plano { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* login e usuário logado */
.acesso { max-width: 460px; margin: 40px auto; }
.acesso .field { margin-bottom: 12px; }
.usuario-topo { font-size: 13px; color: rgba(255, 255, 255, .7); }
.usuario-topo a { color: #fff !important; }

/* foto do resultado da venda (botão "Baixar imagem") */
.so-na-imagem { display: none; }
.exportando { width: max-content; min-width: 1100px; background: #fff; padding: 28px; }
.exportando .so-na-imagem { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.exportando .table-wrap { overflow: visible; }
.exportando .card { box-shadow: none; }
.titulo-imagem { font-size: 26px; font-weight: 800; color: var(--graphite); }
.sub-imagem { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* Abas dentro de uma seção (Financeiro: Recebimentos | Custos) */
.abas { display: flex; gap: 6px; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.abas a { padding: 9px 16px; font-weight: 600; font-size: 14px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.abas a:hover { color: var(--ink); }
.abas a.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Configurações */
.config-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.config-item { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); }
.config-item:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.config-item b { font-size: 16px; color: var(--brand); }
.config-item span { font-size: 13px; color: var(--muted); }
.voltar-config { margin: 0 0 10px; font-size: 13px; }
.voltar-config a { color: var(--muted); }

/* Lançar reunião: cidade + presentes, pacotes em grade, resumo ao vivo */
.reuniao-topo { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; max-width: 620px; }
.pacotes-grid { display: grid; grid-template-columns: max-content 110px 20px 110px; align-items: center; gap: 8px 10px; margin: 18px 0 12px; }
.pg-cab { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: center; }
.pg-rot { font-size: 15px; font-weight: 700; color: var(--ink); padding-right: 8px; margin: 0; text-transform: none; letter-spacing: 0; }
.pg-sep { text-align: center; color: var(--muted); font-weight: 700; }
.pacotes-grid input { width: 100%; font-size: 18px; font-weight: 700; text-align: center; }
.reuniao-resumo { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 10px 14px; max-width: 620px; background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: var(--radius-sm); font-size: 14px; }
.reuniao-resumo b { font-size: 17px; }
.reuniao-mais { margin-top: 12px; }
.reuniao-mais summary { cursor: pointer; margin: 0; }
tr.linha-editando td { background: var(--gold-soft); }
@media (max-width: 760px) {
  .reuniao-topo { grid-template-columns: 1fr; }
  .pacotes-grid { grid-template-columns: max-content 1fr 14px 1fr; }
}
td.conf-dif { background: var(--red-bg) !important; color: var(--red); font-weight: 800; }
.conf-ok { color: var(--ok); font-weight: 700; white-space: nowrap; }
.conf-x { color: var(--red); font-weight: 800; white-space: nowrap; }
td.conf-falta-cel { background: var(--gold-soft) !important; font-weight: 700; }
.conf-falta { color: #8a6d0b; font-weight: 700; white-space: nowrap; }

/* Resultado da venda: funil do Kommo + resumo do Meta lado a lado */
.resumo-venda { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 20px; align-items: stretch; }
.resumo-venda > .card { margin-bottom: 20px; }
.resumo-venda > .card:only-child { grid-column: 1 / -1; }
.meta-resumo h2, .resumo-venda .funil-kommo h2 { margin-bottom: 14px; }
.meta-gasto { display: flex; flex-direction: column; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--brand-soft); border-left: 5px solid var(--brand); margin-bottom: 12px; }
.meta-gasto b { font-size: 26px; font-weight: 800; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.meta-gasto span { font-size: 12.5px; color: var(--muted); }
.meta-num { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 0; }
.meta-num div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed var(--line); padding: 4px 0; }
.meta-num dt { font-size: 12.5px; color: var(--muted); }
.meta-num dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .resumo-venda { grid-template-columns: 1fr; } }
