/* ============================================================
   Sports Manager — Tema dourado/claro (porta do frontend original)
   Escopado com .sm- para não conflitar com o tema WordPress
   ============================================================ */

:root {
  --sm-bg: #f6f3e9;
  --sm-bg-2: #ece5cf;
  --sm-panel: #fbf9f1;
  --sm-panel-2: #f1ebda;
  --sm-line: #ddd2b5;
  --sm-txt: #232013;
  --sm-muted: #8a7f5f;
  --sm-accent: #c9a227;
  --sm-accent-2: #a8861c;
  --sm-gold: #c9a227;
  --sm-danger: #e05c5c;
  --sm-hl: #f1e7c6;
  --sm-sel: #f5ecd0;
}

.sm-app, .sm-app * { box-sizing: border-box; }
.sm-app {
  --bg: var(--sm-bg); --bg-2: var(--sm-bg-2); --panel: var(--sm-panel);
  --panel-2: var(--sm-panel-2); --line: var(--sm-line); --txt: var(--sm-txt);
  --muted: var(--sm-muted); --accent: var(--sm-accent); --accent-2: var(--sm-accent-2);
  --gold: var(--sm-gold); --danger: var(--sm-danger);
  font-family: 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif;
  background: #fff;
  color: var(--sm-txt);
  min-height: 100vh;
  margin: -10px;
  padding: 20px;
  font-size: 14px;
  line-height: 1.5;
}
.sm-app h1, .sm-app h2, .sm-app h3, .sm-app h4 {
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: -0.02em; font-weight: 600; margin: 0 0 12px; line-height: 1.25;
}
.sm-app a { color: var(--sm-accent); }
.sm-app table { border-collapse: collapse; }
.sm-app input, .sm-app select, .sm-app textarea {
  background: var(--sm-bg-2); color: var(--sm-txt); border: 1px solid var(--sm-line);
  padding: 8px 10px; border-radius: 8px; font-size: 13px; outline: none; font-family: inherit;
}
.sm-app input:focus, .sm-app select:focus, .sm-app textarea:focus { border-color: var(--sm-accent); }
.sm-app input[type="color"] {
  padding: 2px;
  width: 60px;
  height: 38px;
  background: var(--sm-panel);
  cursor: pointer;
}
.sm-color { display: flex; align-items: center; gap: 8px; }
.sm-color code { font-size: 12px; color: var(--sm-muted); }

/* ===== Botões ===== */
.sm-btn {
  background: var(--sm-panel); color: var(--sm-txt); border: 1px solid var(--sm-line);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
  transition: .15s; font-weight: 600; font-family: inherit;
}
.sm-btn:hover { border-color: var(--sm-accent); }
a.sm-btn { text-decoration: none; display: inline-block; text-align: center; }
.sm-btn.primary { background: var(--sm-accent); border-color: var(--sm-accent); color: #231b02; }
.sm-btn.primary:hover { background: var(--sm-accent-2); }
.sm-btn.ghost { background: transparent; }
.sm-btn.danger { color: var(--sm-danger); }
.sm-btn.danger:hover { border-color: var(--sm-danger); }
.sm-btn.sm { padding: 4px 9px; font-size: 12px; }
.sm-btn.active { border-color: var(--sm-accent); color: var(--sm-accent); }
.sm-btn:disabled { opacity: .5; cursor: not-allowed; }

.sm-card {
  background: var(--sm-panel); border: 1px solid var(--sm-line);
  border-radius: 12px; padding: 18px; margin-bottom: 16px;
}
.sm-card h2 { font-size: 17px; }
.sm-card h3 { font-size: 13px; color: var(--sm-muted); text-transform: uppercase; letter-spacing: .5px; }
.sm-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.sm-field { display: flex; flex-direction: column; gap: 4px; }
.sm-field label { font-size: 11px; color: var(--sm-muted); }
.sm-muted { color: var(--sm-muted); }
.sm-empty { color: var(--sm-muted); text-align: center; padding: 18px; }
.sm-err { color: var(--sm-danger); font-size: 13px; margin: 6px 0; }

/* ===== Cabeçalho do app admin ===== */
.sm-topo {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 0; border-bottom: 1px solid var(--sm-line); margin-bottom: 18px;
}
.sm-logo { font-size: 20px; font-weight: 800; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.sm-logo b { color: var(--sm-accent); }
.sm-topo nav { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.sm-user { font-size: 12px; color: var(--sm-muted); }
.sm-topo nav .sm-btn.active { background: var(--sm-accent); color: #231b02; }

/* ===== Tabelas ===== */
.sm-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 8px; }
.sm-table th, .sm-table td { padding: 7px 8px; border: 1px solid var(--sm-line); text-align: center; }
.sm-table th { background: var(--sm-panel-2); font-size: 12px; }
.sm-table .tl { text-align: left; }
.sm-table tr.top1 { background: var(--sm-hl); }
.sm-table .sm-actions { white-space: nowrap; }
.sm-table .sm-actions .sm-btn { margin: 1px; }

/* ===== Modais ===== */
.sm-modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99990;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto;
}
.sm-modal {
  background: var(--sm-panel); border: 1px solid var(--sm-line); border-radius: 14px;
  width: 100%; max-width: 560px; padding: 20px; box-shadow: 0 18px 60px rgba(0,0,0,.28);
}
.sm-modal.wide { max-width: 760px; }
.sm-modal h2 { margin-bottom: 14px; }
.sm-modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* ===== Check list ===== */
.sm-lista-part { max-height: 320px; overflow: auto; border: 1px solid var(--sm-line); border-radius: 8px; padding: 6px; background: var(--sm-bg-2); }
.sm-check-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.sm-check-item:hover { background: var(--sm-panel-2); }
.sm-check-item.sel { background: #f5ecd0; }
.sm-check-item input { accent-color: var(--sm-accent); }

/* ===== Grid ===== */
.sm-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .sm-grid2 { grid-template-columns: 1fr; } }
.sm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.sm-stat {
  background: var(--sm-panel); border: 1px solid var(--sm-line); border-radius: 12px;
  padding: 16px; text-align: center;
}
.sm-stat .num { font-size: 30px; font-weight: 800; color: var(--sm-accent); font-family: Georgia, serif; }
.sm-stat .lbl { font-size: 12px; color: var(--sm-muted); text-transform: uppercase; letter-spacing: .5px; }

/* ===== Painel do torneio ===== */
.sm-pa-topo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.sm-pa-nome { font-size: 20px; font-weight: 800; font-family: Georgia, serif; }
.sm-pill { font-size: 11px; padding: 3px 10px; border-radius: 999px; background: var(--sm-panel-2); border: 1px solid var(--sm-line); }
.sm-pill.ok { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.sm-pa-corpo { display: grid; grid-template-columns: 190px 1fr; gap: 14px; align-items: start; }
@media (max-width: 820px) { .sm-pa-corpo { grid-template-columns: 1fr; } }
.sm-pa-menu { display: flex; flex-direction: column; gap: 4px; }
.sm-pa-menu .sm-btn { text-align: left; }
@media (max-width: 820px) { .sm-pa-menu { flex-direction: row; flex-wrap: wrap; } }
.sm-pa-tela { min-width: 0; }

/* ===== Painel do torneio no visual da página pública ===== */
.sm-pa-tela > h1 { text-align: center; margin: 8px 0 2px; font-size: 26px; }
.sm-pa-tela > .sub { text-align: center; color: var(--sm-muted); margin-bottom: 16px; }
.sm-pa-tela .sm-secao { margin-bottom: 26px; }
.sm-pa-tela .sm-secao > h2 { border-bottom: 2px solid var(--sm-accent); padding-bottom: 6px; margin: 22px 0 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sm-pa-tela .sm-secao h3 { font-size: 14px; margin: 14px 0 8px; }
.sm-pa-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: center; margin-bottom: 20px; }

/* Tabela de jogos (edição) no estilo da tabela pública */
.sm-jogo-tab input[type="number"] { width: 52px; text-align: center; padding: 5px 6px; font-size: 13px; }
.sm-jogo-tab input[type="date"], .sm-jogo-tab input[type="time"] { padding: 4px 6px; font-size: 12px; }
.sm-jogo-tab input[type="date"] { width: 128px; }
.sm-jogo-tab input[type="time"] { width: 92px; }
.sm-jogo-tab select { padding: 4px 6px; font-size: 12px; max-width: 160px; }
.sm-jogo-tab .pl { white-space: nowrap; }
.sm-jogo-tab .acao { white-space: nowrap; text-align: right; }
.sm-jogo-tab .acao .sm-btn { margin: 1px; }

/* ===== Rodadas / jogos ===== */
.sm-rodada-block { margin-bottom: 16px; }
.sm-rodada-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 700; }
.sm-jogo {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--sm-panel); border: 1px solid var(--sm-line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; font-size: 13px;
}
.sm-jogo .g1, .sm-jogo .g2 { font-weight: 700; flex: 1; min-width: 90px; }
.sm-jogo .g2 { text-align: right; }
.sm-jogo .pl { display: flex; align-items: center; gap: 6px; }
.sm-jogo .pl input { width: 54px; text-align: center; padding: 5px 6px; }
.sm-jogo .gx { color: var(--sm-muted); font-weight: 700; }
.sm-jogo .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.sm-jogo .sel { border-color: var(--sm-accent); background: var(--sm-sel); }
.sm-jogo input[type=date], .sm-jogo input[type=time] { padding: 4px 6px; font-size: 12px; }

/* ===== Gráfico de barras ===== */
.sm-gbar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sm-gbar-label { width: 110px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.sm-gbar-bar { height: 20px; background: var(--sm-line); border-radius: 4px; position: relative; min-width: 4px; }
.sm-gbar-val { position: absolute; right: 6px; top: 1px; font-size: 11px; font-weight: 700; color: #231b02; }

/* ===== Cronômetro ===== */
.sm-cro-display { font-size: 44px; font-weight: 800; text-align: center; font-family: Georgia, serif; letter-spacing: 2px; }
.sm-cro-label { text-align: center; color: var(--sm-muted); margin-bottom: 8px; }
.sm-cro-ctrl { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.sm-cro-config { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 8px; font-size: 12px; }

/* ===== Bracket (mata-mata) ===== */
.sm-bracket { display: flex; gap: 26px; overflow-x: auto; padding-bottom: 10px; }
.sm-br-col { min-width: 150px; }
.sm-br-round-title { font-size: 11px; text-transform: uppercase; color: var(--sm-muted); margin-bottom: 10px; text-align: center; }
.sm-br-match { margin-bottom: 14px; border: 1px solid var(--sm-line); border-radius: 8px; overflow: hidden; background: var(--sm-panel); }
.sm-br-match .m { padding: 5px 8px; font-size: 12px; display: flex; justify-content: space-between; gap: 6px; }
.sm-br-match .m.sel { background: var(--sm-sel); }
.sm-br-match .m.win { font-weight: 800; background: var(--sm-hl); }
.sm-br-match .m b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Súmula ===== */
.sm-relato { white-space: pre-wrap; font-size: 13px; background: var(--sm-bg-2); border: 1px solid var(--sm-line); border-radius: 8px; padding: 10px; min-height: 90px; }

/* ===== Forma recente (últimos 5) ===== */
.sm-forma { display: inline-flex; gap: 3px; }
.sm-bola { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 700; }

/* ===== Navegação por rodada ===== */
.sm-rodada-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sm-rodada-nav .sm-btn { min-width: 32px; justify-content: center; }
.sm-rodada-ind { font-weight: 700; font-size: 14px; color: var(--sm-txt); }
.sm-rodada-nav .sm-btn.active { background: var(--sm-accent); color: #231b02; }

/* Navegação por rodada (página pública) */
.sm-round-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sm-round-nav .sm-btn { min-width: 32px; justify-content: center; }
.sm-round-ind { font-weight: 700; font-size: 14px; }
.sm-round-block { display: none; }
.sm-round-block.active { display: block; }

/* ===== Escalação / eventos ===== */
.sm-eq { margin-bottom: 14px; }
.sm-eq h4 { margin: 0 0 6px; }
.sm-eq-lista { display: flex; flex-wrap: wrap; gap: 6px; }
.sm-atleta-chip {
  display: flex; align-items: center; gap: 4px; background: var(--sm-panel-2);
  border: 1px solid var(--sm-line); border-radius: 999px; padding: 3px 9px; font-size: 12px;
}
.sm-atleta-chip input { width: 44px; padding: 2px 4px; font-size: 12px; text-align: center; }
.sm-atleta-chip .nome { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Tag / número ===== */
.sm-tag {
  display: inline-block; background: var(--sm-accent); color: #231b02;
  border-radius: 6px; padding: 0 6px; font-size: 11px; font-weight: 700; margin-left: 4px;
}
td.sm-tag { font-weight: 600; color: var(--sm-txt); background: transparent; }

/* ===== Calendário ===== */
.sm-cal-jogo {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 8px 10px; border-bottom: 1px solid var(--sm-line); font-size: 13px;
}
.sm-cal-jogo:last-child { border-bottom: none; }
.sm-cal-mandante { flex: 1; text-align: right; font-weight: 600; min-width: 90px; }
.sm-cal-placar { font-weight: 700; color: var(--sm-accent); min-width: 64px; text-align: center; }
.sm-cal-visitante { flex: 1; text-align: left; font-weight: 600; min-width: 90px; }

/* ===== Regulamento ===== */
.sm-regulamento { white-space: pre-wrap; font-size: 13px; background: var(--sm-bg-2); border: 1px solid var(--sm-line); border-radius: 8px; padding: 12px; }

/* ===== Toast ===== */
.sm-toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #232013; color: #f6f3e9; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; z-index: 99999; box-shadow: 0 8px 30px rgba(0,0,0,.3); max-width: 90vw;
}
.sm-toast.err { background: var(--sm-danger); }

/* ===== Página pública ===== */
.sm-public { font-family: 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif; color: var(--sm-txt); }
.sm-public h1 { text-align: center; margin: 8px 0 2px; font-size: 26px; }
.sm-public .sub { text-align: center; color: var(--sm-muted); margin-bottom: 16px; }
.sm-pub-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; justify-content: center; margin-bottom: 20px; }
.sm-torneio-sec { margin-bottom: 26px; }
.sm-torneio-sec h2 { border-bottom: 2px solid var(--sm-accent); padding-bottom: 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sm-champ-box {
  background: var(--sm-hl); border: 1px solid var(--sm-line); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.sm-champ-box .cup { font-size: 22px; }
.sm-lang-switch { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 8px; }
.sm-lang-switch .sm-btn.sel { background: var(--sm-accent); color: #231b02; }
.sm-filter-form { display: flex; gap: 8px; align-items: center; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
.sm-filter-label { font-size: 12px; color: var(--sm-muted); font-weight: 600; }
.sm-filter-form select { min-width: 220px; }
.sm-filter-form input { min-width: 220px; }

/* Detalhes por jogo (página pública) */
.sm-table .sm-det-row td { text-align: left; font-size: 12px; background: var(--sm-panel-2); }
.sm-det { margin: 2px 0; }
.sm-det strong { color: var(--sm-accent-2); }

/* Regulamento (popup público) */
.sm-reg-link { margin: 8px 0 4px; }
.sm-reg-modal .sm-modal { max-width: 720px; }
.sm-reg-modal[hidden] { display: none; }
.sm-regulamento { white-space: pre-wrap; font-size: 13px; background: var(--sm-bg-2); border: 1px solid var(--sm-line); border-radius: 8px; padding: 12px; max-height: 60vh; overflow: auto; }

/* Detalhes do jogo (popup público) */
.sm-det-modal .sm-modal { max-width: 720px; }
.sm-det-modal[hidden] { display: none; }
.sm-det-body { font-size: 13px; }
.sm-det-body .sm-det { padding: 5px 0; border-bottom: 1px solid var(--sm-line); }
.sm-det-body .sm-det:last-child { border-bottom: none; }
.sm-det-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 6px; }
.sm-det-col-title { font-weight: 700; margin-bottom: 4px; }
.sm-det-atleta { padding: 2px 0; }
@media (max-width: 560px) { .sm-det-cols { grid-template-columns: 1fr; } }

@media print {
  body * { visibility: hidden !important; }
  .sm-public, .sm-public * { visibility: visible !important; }
  .sm-public { position: absolute !important; left: 0; top: 0; width: 100%; max-width: 100% !important; }
  .sm-public .sm-pub-toolbar, .sm-lang-switch, .sm-filter-form { display: none !important; }
  .sm-round-nav { display: none !important; }
  .sm-round-block { display: block !important; }
  .sm-reg-link, .sm-reg-modal, .sm-det-open, .sm-det-modal { display: none !important; }
}
