/* ==========================================================================
   STATVERO PREMIUM DESIGN SYSTEM
   Dark Glassmorphism Esportivo, Micro-interações, Acentos Neon e Responsividade
   ========================================================================== */

:root {
  --bg-main: #070b14;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #162238;
  --bg-card: rgba(18, 27, 47, 0.75);
  --bg-card-hover: rgba(26, 39, 68, 0.85);
  --bg-input: #0b1324;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(56, 189, 248, 0.3);
  --border-active: #38bdf8;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #38bdf8;

  --accent-blue: #2563eb;
  --accent-cyan: #06b6d4;
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.25);
  --shadow-glow-mic: 0 0 25px rgba(239, 68, 68, 0.6);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(15, 23, 42, 0.5) 0px, transparent 100%);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   HEADER & NAVEGAÇÃO
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 19, 36, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 1.75rem;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.4);
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff 40%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Filtros Rápidos do Header */
.header-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  transition: var(--transition-fast);
}

.filter-group:hover, .filter-group:focus-within {
  border-color: var(--border-highlight);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.15);
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 0.4rem;
}

.filter-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.filter-select option {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  row-gap: 0.45rem;
}

/* Único local dos critérios em uso (barra fixa do topo). */
.header-criterios {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 1 1 auto;
  padding-left: 0.35rem;
}

.header-criterios-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

.header-criterios-lista {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.1rem 0;
}

.header-criterios-lista::-webkit-scrollbar {
  display: none;
}

.header-criterios .fp-chip-tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
}

.header-criterios .fp-chip-remove {
  width: 16px;
  height: 16px;
  font-size: 0.68rem;
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */

.main-content {
  max-width: 1440px;
  margin: 1.5rem auto 3rem auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   SEÇÃO ESPECIAL: STATVERO AI ASSISTANT (DESTAQUE HERO)
   ========================================================================== */

.ia-hero-card {
  position: relative;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(11, 25, 48, 0.9));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg), 0 0 35px rgba(37, 99, 235, 0.15);
  backdrop-filter: blur(20px);
  overflow: hidden;
}

.ia-hero-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.ia-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.ia-badge-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ia-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

.ia-rule-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
}

.ia-rule-badge.fifa {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.ia-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 0.4rem;
  color: #ffffff;
}

.ia-subtitle {
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: none;
  margin-top: 0.25rem;
}

/* Barra de Entrada de Pergunta com Voz e Texto */
.ia-input-wrapper {
  margin: 1.5rem 0 1rem 0;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.5rem 0.35rem 1rem;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4), 0 0 15px rgba(56, 189, 248, 0.12);
  transition: var(--transition-normal);
}

.ia-input-wrapper:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.ia-input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  padding: 0.6rem 0.5rem;
}

.ia-input-field::placeholder {
  color: var(--text-muted);
}

.ia-input-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Botão de Microfone de Voz */
.btn-mic {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: var(--transition-normal);
  position: relative;
}

.btn-mic:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border-color: #38bdf8;
}

.btn-mic.listening {
  background: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: var(--shadow-glow-mic);
  animation: pulse-mic 1.4s infinite;
}

@keyframes pulse-mic {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 14px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Botão Enviar Pergunta */
.btn-send {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-normal);
}

.btn-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

/* Pílulas de Exemplos Rápidos */
.ia-suggestions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.suggestion-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.suggestion-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.82rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}

.suggestion-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

.suggestion-chip.highlight {
  border-color: rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.08);
}

/* Cartão de Resposta da IA */
.ia-response-box {
  margin-top: 1.5rem;
  background: rgba(7, 12, 23, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  animation: fadeIn 0.3s ease-out;
}

.ia-response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ia-response-title {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ia-response-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-tts {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
}

.btn-tts:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

/* Botão Limpar Consulta IA */
.btn-ia-reset {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
}

.btn-ia-reset:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* Pílula de Contexto Aplicado */
.ia-context-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  color: #94a3b8;
  margin-bottom: 0.85rem;
}

.ia-context-pill strong {
  color: #38bdf8;
}

/* Banner de Filtro IA sobre a Tabela de Partidas */
.ai-filter-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(59, 130, 246, 0.12));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1rem;
  color: #e0f2fe;
  font-size: 0.92rem;
  animation: fadeIn 0.3s ease-out;
  flex-wrap: wrap;
}

.ai-filter-banner.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.12));
  border-color: rgba(245, 158, 11, 0.45);
  color: #fef3c7;
}

.btn-banner-reset {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-banner-reset:hover {
  background: #38bdf8;
  color: #04132b;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.ia-response-text {
  font-size: 1.05rem;
  line-height: 1.65;
  color: #f1f5f9;
  white-space: pre-line;
}

/* Cards de decomposição de tempo (1T vs 2T) */
.time-breakdown-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.breakdown-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  border-left: 4px solid #38bdf8;
}

.breakdown-card.first-half {
  border-left-color: #06b6d4;
}

.breakdown-card.second-half {
  border-left-color: #8b5cf6;
}

.breakdown-card.total-unique {
  border-left-color: #10b981;
}

.breakdown-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.breakdown-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0.2rem 0;
}

.breakdown-detail {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Área de Auditoria (Zero Invenção) */
.ia-audit-toggle {
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  outline: none;
}

.ia-audit-toggle:hover {
  color: #38bdf8;
}

/* Brilho que desliza sobre o texto do atalho de auditoria. O emoji fica em
   um span próprio porque background-clip: text o deixaria transparente. */
.ia-audit-label {
  background-image: linear-gradient(
    100deg,
    var(--text-muted) 0%,
    var(--text-muted) 38%,
    #38bdf8 46%,
    #e0f2fe 50%,
    #38bdf8 54%,
    var(--text-muted) 62%,
    var(--text-muted) 100%
  );
  background-size: 200% 100%;
  background-repeat: repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: brilho-deslizante 3s linear infinite;
}

.ia-audit-toggle:hover .ia-audit-label {
  background-image: linear-gradient(
    100deg,
    #7dd3fc 0%,
    #7dd3fc 38%,
    #38bdf8 46%,
    #f0f9ff 50%,
    #38bdf8 54%,
    #7dd3fc 62%,
    #7dd3fc 100%
  );
}

/* Um ciclo de 200% equivale a deslocar exatamente uma repetição do fundo,
   então a animação recomeça sem salto. A posição decresce no eixo, o que
   move o brilho da esquerda para a direita. */
@keyframes brilho-deslizante {
  from { background-position: 200% 50%; }
  to { background-position: 0% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .ia-audit-label {
    animation: none;
    background-image: none;
    -webkit-text-fill-color: currentColor;
    color: var(--text-muted);
  }
}

.ia-audit-content {
  margin-top: 0.75rem;
  padding: 1rem;
  background: #060911;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  display: none;
}

.ia-audit-content.open {
  display: block;
}

/* Norma: cabeçalhos de qualquer grid são clicáveis para ordenar. */
.matches-table thead th,
.camp-tabela thead th {
  cursor: pointer;
  user-select: none;
}

.matches-table thead th:hover,
.camp-tabela thead th:hover {
  color: #38bdf8;
}

.tabela-sort-indicator,
.audit-sort-indicator {
  color: #38bdf8;
  font-size: 0.7rem;
}

/* Cabeçalhos da tabela de auditoria são clicáveis para ordenar. */
#audit-table-head th {
  user-select: none;
}

#audit-table-head th:hover {
  color: #38bdf8;
}

.audit-sort-indicator {
  color: #38bdf8;
  font-size: 0.7rem;
}

.ia-audit-box {
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: #0a0e18;
  overflow: hidden;
}

.ia-audit-subtoggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.ia-audit-subtoggle:hover {
  color: #38bdf8;
}

.ia-audit-subtoggle span:last-child {
  transition: transform 0.2s ease;
}

.ia-audit-subtoggle.open span:last-child {
  transform: rotate(180deg);
}

.ia-audit-subcontent {
  display: none;
  padding: 0 0.85rem 0.85rem;
}

.ia-audit-subcontent.open {
  display: block;
}

/* ==========================================================================
   EDITOR SQL INTERATIVO & AUDITORIA AVANÇADA
   ========================================================================== */

.sql-editor-header {
  margin-bottom: 0.85rem;
}

.sql-editor-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.sql-editor-tag {
  font-size: 0.72rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.sql-editor-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sql-editor-container {
  position: relative;
  margin-bottom: 0.75rem;
}

.sql-editor-textarea {
  width: 100%;
  background: #030712;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-sm);
  color: #38bdf8;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  padding: 0.85rem 1rem;
  resize: vertical;
  outline: none;
  transition: var(--transition-fast);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

.sql-editor-textarea:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25), inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

.sql-editor-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.btn-executar-sql {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
}

.btn-executar-sql:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.btn-executar-sql:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-restaurar-sql {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
}

.btn-restaurar-sql:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.sql-exec-status {
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 500;
}

/* Cards de Feedback (Erro Esclarecedor vs Sucesso) */
.sql-feedback-container {
  margin-bottom: 1.25rem;
  animation: fadeIn 0.25s ease-out;
}

.sql-error-card {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.1);
}

.sql-error-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fca5a5;
  font-weight: 700;
  font-size: 0.96rem;
  margin-bottom: 0.5rem;
}

.sql-error-explanation {
  color: #f1f5f9;
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

.sql-error-suggestion {
  background: rgba(15, 23, 42, 0.75);
  border-left: 3px solid #f59e0b;
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #fef08a;
  font-size: 0.83rem;
  line-height: 1.55;
  white-space: pre-line;
  margin-bottom: 0.65rem;
}

.sql-error-tech-toggle {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  display: inline-block;
  margin-top: 0.25rem;
}

.sql-error-tech-toggle:hover {
  color: #f87171;
}

.sql-error-tech-detail {
  margin-top: 0.4rem;
  font-family: 'Fira Code', monospace;
  font-size: 0.78rem;
  color: #ef4444;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  overflow-x: auto;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.sql-success-card {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: #86efac;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
}

.sql-results-header {
  margin-top: 1rem;
}

.sql-code-block {
  background: #020408;
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  color: #38bdf8;
  font-family: 'Fira Code', monospace;
  font-size: 0.82rem;
  overflow-x: auto;
  margin-bottom: 0.75rem;
}

/* ==========================================================================
   CARDS DE KPIS E ESTATÍSTICAS
   ========================================================================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.kpi-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.kpi-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-icon {
  font-size: 1.25rem;
}

.kpi-value {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  line-height: 1.1;
}

.kpi-subtext {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.kpi-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.kpi-indicator.green { background-color: var(--accent-green); }
.kpi-indicator.blue { background-color: var(--accent-cyan); }
.kpi-indicator.gold { background-color: var(--accent-gold); }

/* ==========================================================================
   GRÁFICOS E SEÇÕES ANALÍTICAS
   ========================================================================== */

.analytics-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 1024px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.panel-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.panel-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.panel-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chart-container {
  position: relative;
  width: 100%;
  height: 320px;
}

/* Lista de Artilharia e Médias */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ranking-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.ranking-item:hover {
  border-color: var(--border-highlight);
  transform: translateX(3px);
}

/* Ranking Interativo e Drill-down do Artilheiro */
.ranking-item-clickable {
  cursor: pointer;
  position: relative;
  user-select: none;
}

.ranking-item-clickable:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: #38bdf8;
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.18);
  transform: translateX(4px);
}

.ranking-item-clickable:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.ranking-name-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.ranking-drilldown-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-full);
  padding: 1px 7px;
  display: inline-flex;
  align-items: center;
  transition: var(--transition-fast);
}

.ranking-item-clickable:hover .ranking-drilldown-tag {
  background: #38bdf8;
  color: #04101c;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* Modal do Artilheiro */
.artilheiro-modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.artilheiro-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.artilheiro-kpi-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
}

.artilheiro-kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.artilheiro-kpi-val {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.2rem;
}

.artilheiro-kpi-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.artilheiro-participacao-nota {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin: -0.75rem 0 1.5rem;
}

/* Pílulas de Competição */
.comp-badge-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.comp-badge-pill .comp-name {
  color: #f1f5f9;
  font-weight: 600;
}

.comp-badge-pill .comp-count {
  color: #38bdf8;
  font-weight: 800;
}

.comp-badge-pill .comp-penaltis {
  color: #94a3b8;
  font-size: 0.74rem;
}

/* Badges e Pílulas de Gol */
.minute-badge-br {
  color: #38bdf8;
  font-weight: 800;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: inline-block;
  white-space: nowrap;
  font-size: 0.74rem;
}

.goal-pill-type {
  font-size: 0.71rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
}

.goal-pill-type.normal {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.goal-pill-type.penalti {
  background: rgba(244, 114, 182, 0.18);
  color: #f472b6;
  border: 1px solid rgba(244, 114, 182, 0.4);
}

.goal-pill-type.falta {
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.goal-pill-type.cabeca {
  background: rgba(167, 139, 250, 0.18);
  color: #c084fc;
  border: 1px solid rgba(167, 139, 250, 0.4);
}

/* Cards de Resumo por Partida */
.partida-resumo-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  transition: var(--transition-fast);
}

.partida-resumo-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(30, 41, 59, 0.75);
}

.game-goal-pill {
  font-size: 0.74rem;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-full);
  padding: 1px 7px;
  font-weight: 600;
}

/* Botão Voltar Modal */
.btn-back-modal {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: #38bdf8;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
}

.btn-back-modal:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #ffffff;
}

.btn-fonte-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: #38bdf8;
  text-decoration: none;
  font-size: 0.8rem;
  transition: var(--transition-fast);
  border: 1px solid var(--border-subtle);
}

.btn-fonte-link:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
}

.ranking-pos {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-secondary);
}

.ranking-pos.top1 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
}

.ranking-info {
  flex: 1;
  margin-left: 0.85rem;
}

.ranking-name {
  font-weight: 700;
  color: #ffffff;
  font-size: 0.92rem;
}

.ranking-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ranking-badge {
  font-size: 1.1rem;
  font-weight: 800;
  color: #38bdf8;
}

/* ==========================================================================
   CAMPANHA DO TIME (GRADE RODADA A RODADA + PONTOS ACUMULADOS)
   ========================================================================== */

.campanha-section {
  margin-bottom: 2rem;
  scroll-margin-top: 90px;
}

.campanha-titulo-linha {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.campanha-time-ano {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.campanha-time {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #ffffff 25%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.campanha-ano {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #06121f;
  background: linear-gradient(135deg, #38bdf8, #06b6d4);
  border-radius: var(--radius-full);
  padding: 0.12rem 0.55rem;
  line-height: 1.2;
}

.campanha-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.campanha-tab {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.campanha-tab:hover {
  border-color: var(--border-highlight);
  color: var(--text-primary);
}

.campanha-tab.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--border-active);
  color: #38bdf8;
}

.campanha-oficial {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(15, 23, 42, 0.4));
}

.campanha-oficial-pos {
  font-size: 1.55rem;
  font-weight: 800;
  color: #fbbf24;
  line-height: 1;
  white-space: nowrap;
}

.campanha-oficial-fase {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.campanha-oficial-fonte {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.campanha-oficial-fonte a {
  color: #38bdf8;
  text-decoration: none;
}

.campanha-oficial-fonte a:hover {
  text-decoration: underline;
}

.campanha-resumo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}

.campanha-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.55rem;
}

.campanha-pill-label {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.campanha-pill-val {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
}

.campanha-pill--destaque {
  border-color: rgba(56, 189, 248, 0.55);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(15, 23, 42, 0.65));
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.16);
}

.campanha-pill--destaque .campanha-pill-label {
  color: #7dd3fc;
}

.campanha-pill--destaque .campanha-pill-val {
  font-size: 1.3rem;
  color: #ffffff;
}

.campanha-corpo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
  align-items: start;
}

.campanha-grade {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 0.4rem;
  padding-right: 0.25rem;
}

.campanha-rodada {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.campanha-rodada:hover {
  border-color: var(--border-highlight);
  transform: translateY(-1px);
}

.campanha-rodada:focus-visible {
  outline: 2px solid var(--border-active);
  outline-offset: 1px;
}

.campanha-rodada.V { border-left-color: var(--accent-green); }
.campanha-rodada.E { border-left-color: var(--accent-gold); }
.campanha-rodada.D { border-left-color: var(--accent-red); }

.campanha-rodada.futuro {
  border-left-color: #475569;
  opacity: 0.75;
  cursor: default;
}

.campanha-rodada-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-muted);
}

.campanha-rodada-num {
  color: #38bdf8;
}

.campanha-rodada-adv {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.campanha-rodada-mando {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.campanha-rodada-placar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  margin-top: 0.2rem;
}

.campanha-rodada-score {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}

.campanha-rodada-res {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  text-align: center;
  line-height: 18px;
  font-size: 0.64rem;
  font-weight: 800;
  color: #ffffff;
}

.campanha-rodada.V .campanha-rodada-res { background: var(--accent-green); }
.campanha-rodada.E .campanha-rodada-res { background: var(--accent-gold); }
.campanha-rodada.D .campanha-rodada-res { background: var(--accent-red); }

.campanha-rodada-pts {
  margin-top: 0.15rem;
  font-size: 0.63rem;
  color: var(--text-muted);
}

.campanha-chart-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
}

.campanha-chart-title {
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.campanha-chart-container {
  height: 240px;
}

/* A regra de densidade do index.html fixa .chart-container em 185px; a
   campanha usa um gráfico mais alto para acompanhar a altura da grade. */
.campanha-chart-wrap .campanha-chart-container {
  height: 300px !important;
}

.campanha-nota {
  margin-top: 0.6rem;
  font-size: 0.73rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.campanha-nota strong {
  color: #fbbf24;
}

@media (max-width: 1024px) {
  .campanha-corpo {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .campanha-grade {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    max-height: none;
  }

  .campanha-oficial {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

/* ==========================================================================
   CAMPEONATO: RODADA, CLASSIFICAÇÃO E DESTAQUES
   ========================================================================== */

.campeonato-section {
  margin-bottom: 2rem;
  scroll-margin-top: 120px;
}

.camp-header {
  align-items: flex-start;
}

.camp-titulo-linha {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.camp-titulo-comp {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #06121f;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-radius: var(--radius-full);
  padding: 0.12rem 0.55rem;
  line-height: 1.2;
  white-space: nowrap;
}

.camp-controls {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.camp-control {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.camp-control > span {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.camp-control .filter-select {
  min-width: 150px;
}

.camp-loading {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.camp-empty {
  text-align: center;
  padding: 2rem 1.5rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
}

.camp-empty-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.camp-empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.3rem;
}

.camp-empty-text {
  font-size: 0.84rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
}

.camp-round-bar {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.8rem;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(15, 23, 42, 0.55));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.camp-round-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: #e2e8f0;
  border-radius: var(--radius-full);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-fast);
}

.camp-round-btn:hover:not(:disabled) {
  border-color: var(--border-active);
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

.camp-round-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.camp-round-center {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.camp-round-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.camp-round-select {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  padding: 0 0.15rem;
  line-height: 1.1;
}

.camp-round-select:focus {
  outline: 2px solid var(--border-active);
  outline-offset: 2px;
  border-radius: 4px;
}

.camp-round-select option {
  background: #0f172a;
  color: #ffffff;
  font-size: 0.9rem;
}

.camp-round-datas {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.camp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1rem;
  align-items: start;
}

.camp-main {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.camp-block {
  background: rgba(15, 23, 42, 0.34);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.7rem;
  min-width: 0;
}

.camp-block-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.camp-block-title {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #cbd5e1;
}

.camp-block-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.camp-matches {
  display: flex;
  flex-direction: column;
}

.camp-match-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 26px 52px 26px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.42rem 0.35rem;
  margin: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.84rem;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.camp-match-row:last-child {
  border-bottom: none;
}

.camp-match-row:hover {
  background: rgba(56, 189, 248, 0.07);
}

.camp-match-row:focus-visible {
  outline: 2px solid var(--border-active);
  outline-offset: 1px;
}

.camp-match-row--clube {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.12), transparent 55%);
}

.camp-match-row--clube:hover {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.18), rgba(56, 189, 248, 0.04));
}

.camp-match-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.camp-match-home {
  text-align: right;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camp-match-away {
  text-align: left;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camp-match-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.camp-score {
  text-align: center;
  font-weight: 800;
  font-size: 0.92rem;
  color: #ffffff;
  white-space: nowrap;
}

.camp-score--futuro {
  font-size: 0.74rem;
  color: #fbbf24;
  font-weight: 700;
}

.camp-match-extra {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.camp-matches-empty {
  padding: 1.2rem 0.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.camp-tabela-wrap {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.3) rgba(15, 23, 42, 0.6);
}

.camp-tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  min-width: 560px;
}

.camp-tabela th {
  padding: 0.38rem 0.3rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.camp-tabela th.camp-col-clube {
  text-align: left;
}

.camp-tabela td {
  padding: 0.34rem 0.3rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  white-space: nowrap;
  color: var(--text-secondary);
}

.camp-tabela tbody tr:last-child td {
  border-bottom: none;
}

.camp-tabela tbody tr:hover {
  background: rgba(56, 189, 248, 0.05);
}

.camp-tabela tr.camp-destaque {
  background: rgba(56, 189, 248, 0.1);
  box-shadow: inset 3px 0 0 #38bdf8;
}

.camp-tabela tr.camp-destaque td {
  color: #e0f2fe;
  font-weight: 700;
}

.camp-tabela td.camp-col-pos {
  color: var(--text-muted);
  font-weight: 700;
  width: 28px;
}

.camp-tabela td.camp-col-clube {
  text-align: left;
}

.camp-clube-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: #e2e8f0;
}

.camp-clube-cell .camp-match-badge {
  width: 21px;
  height: 21px;
  font-size: 0.5rem;
}

.camp-tabela .camp-pontos {
  color: #ffffff;
  font-weight: 800;
}

.camp-sg--pos {
  color: #34d399 !important;
}

.camp-sg--neg {
  color: #f87171 !important;
}

.camp-tabela-vazia {
  padding: 1.2rem 0.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.camp-side {
  display: grid;
  gap: 0.75rem;
  align-content: start;
  min-width: 0;
}

.camp-side-card {
  background: rgba(15, 23, 42, 0.34);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.7rem;
}

.camp-side-card--cobertura {
  border-color: rgba(56, 189, 248, 0.2);
}

.camp-side-header {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.camp-side-icon {
  font-size: 1rem;
  line-height: 1.2;
}

.camp-side-title {
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #e2e8f0;
}

.camp-side-heading {
  flex: 1;
  min-width: 0;
}

.camp-side-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  min-width: 0;
}

.camp-side-title-row .camp-side-title {
  white-space: nowrap;
}

.camp-artilharia-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  flex-shrink: 0;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.12rem;
}

.camp-artilharia-tab {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.66rem;
  font-weight: 800;
  padding: 0.22rem 0.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.camp-artilharia-tab:hover {
  color: #e2e8f0;
}

.camp-artilharia-tab.active {
  background: rgba(56, 189, 248, 0.22);
  color: #7dd3fc;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.3);
}

.camp-artilharia-tab--alerta::after {
  content: "•";
  color: #fbbf24;
  margin-left: 0.18rem;
}

.camp-artilharia-indisponivel {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.6rem;
  font-size: 0.73rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.camp-artilharia-indisponivel-title {
  font-size: 0.76rem;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 0.2rem;
}

.camp-artilharia-indisponivel strong {
  color: #e2e8f0;
}

.camp-artilharia-parcial {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.55rem;
  font-size: 0.7rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.camp-artilharia-parcial-title {
  font-size: 0.74rem;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 0.15rem;
}

.camp-artilharia-parcial p {
  margin: 0;
}

.camp-side-sub {
  font-size: 0.67rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  line-height: 1.3;
}

.camp-artilharia-list,
.camp-assistencias-list {
  display: flex;
  flex-direction: column;
}

.camp-scorer-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.65rem;
  margin-bottom: 0.45rem;
  background: linear-gradient(135deg, #7f1d1d, #991b1b 55%, #450a0a);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.camp-scorer-hero--assist {
  background: linear-gradient(135deg, #065f46, #047857 55%, #022c22);
  border-color: rgba(52, 211, 153, 0.35);
}

.camp-scorer-hero::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -24px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}

.camp-scorer-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.78);
}

.camp-scorer-hero-clube {
  font-weight: 700;
}

.camp-scorer-hero-name {
  margin-top: 0.15rem;
  font-size: 0.98rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
}

.camp-scorer-hero-gols {
  margin-top: 0.2rem;
  font-size: 1.65rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.camp-scorer-hero-gols span {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-left: 0.3rem;
  color: rgba(255, 255, 255, 0.75);
}

.camp-scorer-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 0.4rem;
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.camp-scorer-item:last-child {
  border-bottom: none;
}

.camp-scorer-rank {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

.camp-scorer-name {
  font-size: 0.79rem;
  font-weight: 700;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camp-scorer-club {
  font-size: 0.64rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camp-scorer-gols {
  font-size: 0.88rem;
  font-weight: 800;
  color: #38bdf8;
  white-space: nowrap;
}

.camp-scorer-gols span {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-left: 0.15rem;
}

.camp-scorer-item--extra {
  display: none;
}

.camp-artilharia-list--expandida .camp-scorer-item--extra {
  display: grid;
}

.camp-artilharia-toggle {
  margin-top: 0.35rem;
  background: none;
  border: none;
  color: #38bdf8;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.15rem 0;
}

.camp-artilharia-toggle:hover {
  text-decoration: underline;
}

.camp-lista-vazia {
  padding: 0.75rem 0.2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.camp-cobertura {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.camp-cob-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.24rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.72rem;
}

.camp-cob-item:last-child {
  border-bottom: none;
}

.camp-cob-label {
  color: var(--text-muted);
}

.camp-cob-value {
  color: #e2e8f0;
  font-weight: 700;
  text-align: right;
}

.camp-cob-value--ok {
  color: #34d399;
}

.camp-cob-value--parcial {
  color: #fbbf24;
}

.camp-cob-value--off {
  color: #f87171;
}

.camp-nota {
  margin-top: 0.45rem;
  font-size: 0.67rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.camp-nota strong {
  color: #fbbf24;
}

@media (max-width: 1024px) {
  .camp-layout {
    grid-template-columns: 1fr;
  }

  .camp-side {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  }
}

@media (max-width: 640px) {
  .camp-header {
    align-items: stretch;
  }

  .camp-controls {
    width: 100%;
  }

  .camp-control {
    flex: 1 1 140px;
  }

  .camp-control .filter-select {
    width: 100%;
    min-width: 0;
  }

  .camp-match-row {
    grid-template-columns: 36px minmax(0, 1fr) 22px 42px 22px minmax(0, 1fr);
    gap: 0.28rem;
    font-size: 0.76rem;
  }

  .camp-match-extra {
    display: none;
  }

  .camp-match-home,
  .camp-match-away {
    font-size: 0.76rem;
  }

  .camp-match-badge {
    width: 21px;
    height: 21px;
    font-size: 0.48rem;
  }

  .camp-score {
    font-size: 0.82rem;
  }

  .camp-score--futuro {
    font-size: 0.68rem;
  }

  .camp-side {
    grid-template-columns: 1fr;
  }

  .camp-round-center {
    gap: 0.35rem;
  }

  .camp-round-datas {
    font-size: 0.68rem;
  }

  .camp-tabela {
    font-size: 0.72rem;
    min-width: 520px;
  }
}

/* ==========================================================================
   TABELA DE PARTIDAS & DRILL-DOWN LINKS
   ========================================================================== */

.matches-section {
  margin-top: 2rem;
}

.matches-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.3) rgba(15, 23, 42, 0.6);
}

.matches-table-container::-webkit-scrollbar {
  height: 6px;
}

.matches-table-container::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}

.matches-table-container::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 4px;
}

.matches-table-container::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.6);
}

.matches-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.matches-table th {
  background: var(--bg-surface);
  padding: 0.55rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  letter-spacing: 0.03em;
}

/* Ordenação por clique nos cabeçalhos da tabela de partidas filtradas */
.matches-table th[data-sort-key] {
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.matches-table th[data-sort-key]:hover {
  color: #34d399;
}

.matches-table th.fp-sort-active {
  color: #34d399;
}

.fp-sort-indicator {
  display: inline-block;
  margin-left: 0.3rem;
  font-size: 0.72em;
  opacity: 0.45;
}

.matches-table th.fp-sort-active .fp-sort-indicator {
  opacity: 1;
}

.matches-table td {
  padding: 0.55rem 0.65rem;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* Tabela Específica de Drill-down em Modais */
.modal-drilldown-table {
  font-size: 0.76rem;
}

.modal-drilldown-table th {
  padding: 0.45rem 0.55rem;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

.modal-drilldown-table td {
  padding: 0.45rem 0.55rem;
  font-size: 0.76rem;
}

.matches-table tr:hover td {
  background: rgba(56, 189, 248, 0.04);
  color: #ffffff;
}

.result-badge {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  text-align: center;
  line-height: 24px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffffff;
}

.result-badge.V { background-color: var(--accent-green); }
.result-badge.E { background-color: var(--accent-gold); }
.result-badge.D { background-color: var(--accent-red); }

.score-cell {
  font-weight: 800;
  font-size: 1.05rem;
  color: #ffffff;
}

.btn-detail-link {
  background: none;
  border: 1px solid var(--border-subtle);
  color: #38bdf8;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-detail-link:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
}

/* ==========================================================================
   MODAL DE DETALHES (DRILL-DOWN COMPLETO)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  max-width: 1160px;
  width: 96%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 1.5rem 1.75rem;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

/* Modal de filtro por campo do dicionário SQL */
.modal-card-sm {
  max-width: 560px;
  width: 94%;
}

.schema-field-modal {
  padding: 1.5rem 1.6rem;
}

.schema-field-title {
  margin: 0 2.5rem 0.35rem 0;
  font-size: 1.15rem;
  color: #f8fafc;
}

.schema-field-subtitle {
  margin: 0 0 1.1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: 'Fira Code', monospace;
}

.schema-field-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.schema-field-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.schema-field-form .fp-select,
.schema-field-form .fp-input {
  width: 100%;
}

#schema-field-value-block {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.schema-field-hint {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.45;
}

.schema-field-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.35rem;
  flex-wrap: wrap;
}

.schema-field-actions button {
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

#schema-field-apply:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Configuração do Gemini Modal */
.modal-gemini-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: inherit;
  margin: 1rem 0;
  outline: none;
}

.modal-gemini-input:focus {
  border-color: #38bdf8;
}

/* Animações */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsividade adicional */
@media (max-width: 768px) {
  .app-header {
    padding: 0.75rem 1rem;
  }
  .ia-hero-card {
    padding: 1.25rem;
  }
  .ia-input-wrapper {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem;
  }
  .ia-input-actions {
    justify-content: flex-end;
    margin-top: 0.5rem;
  }
}

/* ==========================================================================
   FILTRO PERSONALIZADO & CONSTRUTOR MULTIDIMENSIONAL
   ========================================================================== */

.btn-nav-filtro {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #34d399;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-normal);
}

.btn-nav-filtro:hover {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #ffffff;
  border-color: #34d399;
  box-shadow: 0 0 15px rgba(52, 211, 153, 0.4);
}

.filtro-personalizado-card {
  background: var(--bg-card);
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(16, 185, 129, 0.08);
  position: relative;
  overflow: visible;
  transition: border-color var(--transition-normal);
}

.filtro-personalizado-card:hover {
  border-color: rgba(52, 211, 153, 0.45);
}

.fp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.fp-header-left {
  max-width: none;
  flex: 1 1 640px;
  min-width: 0;
}

.fp-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 0.4rem;
  margin-bottom: 0.35rem;
  background: linear-gradient(90deg, #ffffff 40%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.fp-subtitle {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
}

.fp-header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* Botões do Filtro Personalizado */
.btn-fp-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 1px solid #34d399;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-normal);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-fp-primary:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 6px 18px rgba(52, 211, 153, 0.5);
  transform: translateY(-1px);
}

.btn-fp-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-fp-secondary:hover {
  background: rgba(51, 65, 85, 0.8);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-fp-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-fp-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
  border-color: #ef4444;
}

.btn-fp-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-fp-action:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #ffffff;
}

/* Presets Rápidos (1 clique) */
.fp-presets-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.fp-presets-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.fp-presets-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.fp-preset-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.fp-preset-pill:hover {
  background: rgba(52, 211, 153, 0.18);
  border-color: #34d399;
  color: #ffffff;
  transform: translateY(-1px);
}

.fp-preset-pill.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.35), rgba(6, 182, 212, 0.3));
  border-color: #34d399;
  color: #34d399;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.25);
}

/* Tabs de Navegação */
.fp-tabs-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.fp-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.fp-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.2);
}

.fp-tab-btn.active {
  color: #34d399;
  background: rgba(16, 185, 129, 0.18);
  border-color: #34d399;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.25);
}

.fp-tab-icon {
  font-size: 1rem;
}

.fp-tab-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  background: #10b981;
  color: #ffffff;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 16px;
  text-align: center;
}

/* Corpo das Abas e Grid de Formulário */
.fp-tabs-body {
  min-height: 200px;
}

.fp-tab-pane {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.fp-tab-pane.active {
  display: block;
}

.fp-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.5rem 1.25rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
  width: 100%;
}

.fp-col-full {
  grid-column: 1 / -1;
}

.fp-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  justify-content: flex-start;
  min-width: 0;
  width: 100%;
  height: 100%;
}

.fp-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  min-height: 2.2rem;
  display: flex;
  align-items: flex-end;
  line-height: 1.25;
}

.fp-form-group.fp-col-full .fp-label {
  min-height: auto;
}

.fp-form-group > .fp-select,
.fp-form-group > .fp-input,
.fp-form-group > .fp-range-inputs,
.fp-form-group > .fp-segmented-group {
  margin-top: auto;
}

.fp-select, .fp-input {
  background: #0b1324;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0.65rem 0.85rem;
  outline: none;
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.fp-select:focus, .fp-input:focus {
  border-color: #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.25);
}

.fp-hint-text {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Card Unificado de Temporadas */
.fp-temp-control-card {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1.25rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  align-items: center;
}

@media (max-width: 768px) {
  .fp-temp-control-card {
    grid-template-columns: 1fr;
  }
}

.fp-temp-left, .fp-temp-right {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* Caixas de abrangência mais baixas e combo um pouco mais alto, alinhados
   pelo centro. A largura do combo de ano único fica compacta de propósito. */
.fp-temp-control-card .fp-segmented-group {
  min-height: 32px;
  padding: 0.15rem;
}

.fp-temp-control-card .fp-segmented-option span {
  padding: 0.24rem 0.45rem;
  font-size: 0.78rem;
}

.fp-temp-control-card .fp-select {
  min-height: 34px;
  padding: 0.3rem 0.5rem;
}

#fp-group-temp-unica .fp-select {
  width: 120px;
  max-width: 120px;
}

.fp-all-seasons-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-sm);
  color: #38bdf8;
  font-size: 0.85rem;
  font-weight: 700;
  min-height: 42px;
  box-sizing: border-box;
}

/* Segmented Control (Radio Pills) */
.fp-segmented-group {
  display: flex;
  flex-wrap: nowrap;
  background: rgba(11, 19, 36, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  gap: 0.25rem;
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
}

.fp-segmented-option {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  cursor: pointer;
}

.fp-segmented-option input[type="radio"] {
  display: none;
}

.fp-segmented-option span {
  width: 100%;
  text-align: center;
  padding: 0.24rem 0.45rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(22, 34, 56, 0.4);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fp-segmented-option:hover span {
  background: rgba(30, 41, 59, 0.7);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.12);
}

.fp-segmented-option input[type="radio"]:checked + span {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(6, 182, 212, 0.25));
  color: #34d399;
  font-weight: 700;
  border-color: #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.3);
}

/* Range Inputs */
.fp-range-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}

.fp-range-inputs .fp-input,
.fp-range-inputs .fp-select {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
}

input[type="date"].fp-input {
  padding: 0.55rem 0.45rem;
  font-size: 0.82rem;
  min-width: 0;
  cursor: pointer;
}

.fp-range-sep {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Result Buttons (V / E / D) */
.fp-result-toggles {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.fp-res-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.fp-res-btn.active[data-res="V"] {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--accent-green);
  color: #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.fp-res-btn.active[data-res="E"] {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--accent-gold);
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.fp-res-btn.active[data-res="D"] {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--accent-red);
  color: #f87171;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.fp-res-badge {
  display: inline-block;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffffff;
}

.fp-res-badge.V { background-color: var(--accent-green); }
.fp-res-badge.E { background-color: var(--accent-gold); }
.fp-res-badge.D { background-color: var(--accent-red); }

/* Checkboxes Estilo Tag */
.fp-chips-checkboxes {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.fp-chip-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.fp-chip-check:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.fp-chip-check input[type="checkbox"] {
  accent-color: #10b981;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.fp-chip-check input[type="checkbox"]:checked ~ span {
  color: #34d399;
  font-weight: 700;
}

/* Barra de Ações Inferior */
.fp-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.fp-actions-left {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.fp-inline-control {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.fp-label-inline {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.fp-select-inline {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  outline: none;
  cursor: pointer;
}

.fp-actions-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Chips dos critérios em uso (renderizados na barra do topo). */
.fp-chip-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #f8fafc;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.fp-chip-tag--fixo {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(8, 47, 73, 0.55);
}

.fp-chip-lock {
  font-size: 0.72rem;
  line-height: 1;
  opacity: 0.9;
}

.fp-chip-remove {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #94a3b8;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.fp-chip-remove:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Mini KPIs do Filtro */
.fp-kpis-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.fp-kpi-pill {
  background: var(--bg-surface-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.fp-kpi-icon {
  font-size: 1.5rem;
}

.fp-kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.fp-kpi-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.fp-kpi-sub {
  font-size: 0.74rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}

/* Barra de Controle de Resultados */
.fp-results-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.fp-results-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #34d399;
}

.fp-results-subtitle {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.fp-results-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Empty State */
.fp-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  margin-top: 1.5rem;
}

.fp-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.65rem;
}

.fp-empty-title {
  font-size: 1.15rem;
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.fp-empty-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
}

/* SQL Drawer Retrátil */
.fp-sql-drawer {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
}

.fp-sql-toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0;
  transition: color var(--transition-fast);
}

.fp-sql-toggle-btn:hover {
  color: #38bdf8;
}

.fp-sql-box {
  background: #060a12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 0.5rem;
  overflow-x: auto;
}

.fp-sql-pre {
  font-family: 'Fira Code', monospace;
  font-size: 0.82rem;
  color: #38bdf8;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ==========================================================================
   GUIA E DICIONÁRIO DE VISÕES & CAMPOS SQLITE
   ========================================================================== */

.fp-schema-guide {
  background: rgba(8, 14, 28, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
}

.fp-schema-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.fp-schema-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.02em;
}

.fp-schema-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.fp-schema-tab-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-family: 'Fira Code', monospace;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.fp-schema-tab-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #e0f2fe;
  border-color: rgba(56, 189, 248, 0.4);
}

.fp-schema-tab-btn.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(6, 182, 212, 0.25));
  border-color: #38bdf8;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.fp-schema-desc {
  font-size: 0.78rem;
  color: #cbd5e1;
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.fp-schema-desc strong {
  color: #38bdf8;
}

.fp-schema-desc code {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  color: #34d399;
}

.fp-schema-chips {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  max-height: 180px;
  overflow-y: auto;
  padding: 0.2rem 0;
}

.fp-col-chip {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: var(--transition-fast);
  color: #e2e8f0;
  font-size: 0.75rem;
  text-align: left;
}

.fp-col-chip code {
  color: #38bdf8;
  font-family: 'Fira Code', monospace;
  font-weight: 700;
  font-size: 0.78rem;
}

.fp-col-chip span {
  color: #94a3b8;
  font-size: 0.72rem;
}

.fp-col-chip:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.25);
}

.fp-col-chip:hover code {
  color: #ffffff;
}

.fp-col-chip:hover span {
  color: #e2e8f0;
}

.fp-col-chip.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.32), rgba(6, 182, 212, 0.25));
  border-color: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.3);
}

.fp-col-chip.active code {
  color: #a7f3d0;
}

.fp-col-chip.active span {
  color: #d1fae5;
}

.fp-col-chip:active {
  transform: translateY(0);
}

.fp-quick-clauses {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.fp-quick-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #f59e0b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fp-clause-btn {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fef3c7;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.fp-clause-btn:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #ffffff;
  transform: translateY(-1px);
}

/* ==========================================================================
   DENSIDADE COMPACTA
   Reduz a distância entre blocos e a altura dos componentes sem diminuir a
   legibilidade. Aplicado por último para vencer as regras-base.
   ========================================================================== */

:root {
  --compact-gap: 0.65rem;
  --compact-pad: 0.85rem;
  --compact-section: 1rem;
}

/* Cabeçalho e estrutura */
.app-header { padding: 0.5rem 1.15rem; }
.header-container { gap: 0.9rem; }
.brand-icon { width: 36px; height: 36px; font-size: 1.15rem; }
.brand-title { font-size: 1.22rem; }
.header-filters { gap: 0.5rem; }
.filter-group { padding: 0.18rem 0.4rem; }
.filter-select { font-size: 0.82rem; }
.btn-nav-ia { padding: 0.35rem 0.8rem; font-size: 0.82rem; }
.main-content { margin: 0.9rem auto 1.75rem; padding: 0 1.1rem; }

/* Assistente de IA */
.ia-hero-card {
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
}
.ia-card-header { margin-bottom: 0.6rem; gap: 0.6rem; }
.ia-title { font-size: 1.35rem; margin-top: 0.2rem; }
.ia-subtitle { font-size: 0.86rem; margin-top: 0.15rem; }
.ia-input-wrapper {
  margin: 0.8rem 0 0.6rem;
  padding: 0.25rem 0.4rem 0.25rem 0.8rem;
}
.ia-input-field { font-size: 0.98rem; padding: 0.42rem 0.4rem; }
.btn-mic { width: 38px; height: 38px; font-size: 1rem; }
.btn-send { padding: 0.5rem 1.05rem; font-size: 0.88rem; }
.ia-suggestions { margin-top: 0.5rem; gap: 0.35rem; }
.suggestion-chip { padding: 0.25rem 0.7rem; font-size: 0.78rem; }
.ia-response-box { margin-top: 0.9rem; padding: 1rem 1.1rem; }
.ia-response-header { margin-bottom: 0.55rem; padding-bottom: 0.5rem; }
.ia-response-text { font-size: 0.98rem; line-height: 1.55; }
.ia-context-pill { margin-bottom: 0.55rem; padding: 0.2rem 0.6rem; }
.ai-filter-banner { padding: 0.6rem 1rem; margin-bottom: 0.7rem; }
.ia-audit-toggle { margin-top: 0.8rem; }
.ia-audit-content { margin-top: 0.5rem; padding: 0.75rem; }
.time-breakdown-cards { gap: 0.6rem; margin: 0.8rem 0; }
.breakdown-card { padding: 0.7rem; }
.breakdown-value { font-size: 1.4rem; }

/* Editor SQL e feedback */
.sql-editor-header { margin-bottom: 0.55rem; }
.sql-editor-container { margin-bottom: 0.5rem; }
.sql-editor-textarea { padding: 0.6rem 0.75rem; font-size: 0.82rem; line-height: 1.45; }
.sql-editor-actions { gap: 0.5rem; margin-bottom: 0.7rem; }
.sql-feedback-container { margin-bottom: 0.8rem; }
.sql-error-card { padding: 0.8rem 1rem; }
.sql-error-explanation { margin-bottom: 0.5rem; }
.sql-error-suggestion { padding: 0.55rem 0.75rem; margin-bottom: 0.5rem; }
.sql-code-block { padding: 0.6rem; margin-bottom: 0.5rem; }
.sql-results-header { margin-top: 0.7rem; }

/* Filtro personalizado */
.filtro-personalizado-card {
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
}
.fp-card-header { gap: 0.75rem; margin-bottom: 0.8rem; }
.fp-title { font-size: 1.35rem; margin-top: 0.2rem; margin-bottom: 0.2rem; }
.fp-subtitle { font-size: 0.86rem; }
.fp-tabs-body { min-height: 150px; }
.fp-form-grid {
  gap: 0.8rem 0.75rem;
  margin-bottom: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.fp-form-group { gap: 0.3rem; }
.fp-label { min-height: 1.5rem; font-size: 0.74rem; }
.fp-select, .fp-input { padding: 0.48rem 0.65rem; min-height: 36px; font-size: 0.84rem; }
.fp-temp-control-card { gap: 0.75rem; padding: 0.7rem 0.9rem; }
.fp-segmented-group { min-height: 36px; }
.fp-all-seasons-badge { min-height: 36px; padding: 0.45rem 0.8rem; }
.fp-kpis-summary {
  gap: 0.55rem;
  margin-top: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.fp-kpi-pill { padding: 0.6rem 0.75rem; gap: 0.6rem; }
.fp-kpi-val { font-size: 1.1rem; }
.fp-results-control-bar { margin-top: 0.8rem; margin-bottom: 0.55rem; gap: 0.6rem; }

/* KPIs e painéis analíticos */
.kpi-grid {
  gap: 0.7rem;
  margin-bottom: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
}
.kpi-card { padding: 0.85rem 0.95rem; }
.kpi-header { margin-bottom: 0.2rem; }
.kpi-value { font-size: 1.7rem; }
.kpi-subtext { margin-top: 0.2rem; font-size: 0.76rem; }
.analytics-grid { gap: 0.9rem; margin-bottom: 1rem; }
.panel-card { padding: 1rem; }
.panel-header { margin-bottom: 0.65rem; gap: 0.4rem; }
.panel-title { font-size: 1.05rem; }
.chart-container { height: 240px; }
.ranking-list { gap: 0.45rem; }
.ranking-item { padding: 0.5rem 0.6rem; }

/* Modais e detalhes do filtro personalizado */
.modal-card { padding: 1.1rem 1.25rem; border-radius: var(--radius-md); }
.schema-field-modal { padding: 1rem 1.1rem; }
.fp-presets-section { padding: 0.5rem 0.7rem; margin-bottom: 0.8rem; gap: 0.5rem; }
.fp-presets-wrapper { gap: 0.35rem; }
.fp-preset-pill { padding: 0.25rem 0.65rem; font-size: 0.78rem; }
.fp-tabs-nav { padding-bottom: 0.5rem; margin-bottom: 0.8rem; gap: 0.35rem; }
.fp-tab-btn { padding: 0.4rem 0.7rem; font-size: 0.8rem; gap: 0.35rem; }
.fp-empty-state { padding: 1.5rem 1rem; margin-top: 0.8rem; }
.fp-sql-drawer { margin-top: 0.8rem; padding-top: 0.6rem; }

/* Tabela de partidas */
.matches-section { margin-top: 1rem; }
.matches-table th { padding: 0.42rem 0.5rem; }
.matches-table td { padding: 0.42rem 0.5rem; font-size: 0.76rem; }

@media (max-width: 768px) {
  .app-header { padding: 0.45rem 0.8rem; }
  .main-content { margin: 0.7rem auto 1.25rem; padding: 0 0.8rem; }
  .ia-hero-card, .filtro-personalizado-card { padding: 0.8rem 0.9rem; }
  .kpi-grid { gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
  .kpi-value { font-size: 1.45rem; }
  .chart-container { height: 210px; }
  .fp-form-grid { grid-template-columns: 1fr; }
}

/* Reforço de densidade: segunda passada, mais compacta. */
.app-header { padding: 0.4rem 1rem; }
.main-content { margin: 0.7rem auto 1.4rem; }
.ia-hero-card { padding: 0.85rem 1.05rem; margin-bottom: 0.8rem; }
.ia-card-header { margin-bottom: 0.45rem; }
.ia-title { font-size: 1.28rem; }
.ia-input-wrapper { margin: 0.6rem 0 0.45rem; }
.ia-suggestions { margin-top: 0.35rem; }
.ia-response-box { margin-top: 0.7rem; padding: 0.85rem 0.95rem; }
.ia-response-header { margin-bottom: 0.4rem; padding-bottom: 0.4rem; }
.filtro-personalizado-card { padding: 0.85rem 1.05rem; margin-bottom: 0.8rem; }
.fp-card-header { margin-bottom: 0.6rem; }
.fp-title { font-size: 1.25rem; }
.fp-form-grid { gap: 0.65rem 0.6rem; margin-bottom: 0.65rem; }
.fp-kpis-summary { margin-top: 0.65rem; }
.kpi-grid { gap: 0.6rem; margin-bottom: 0.8rem; }
.kpi-card { padding: 0.7rem 0.8rem; }
.kpi-value { font-size: 1.55rem; }
.analytics-grid { gap: 0.75rem; margin-bottom: 0.8rem; }
.panel-card { padding: 0.85rem; }
.panel-header { margin-bottom: 0.5rem; }
.chart-container { height: 210px; }
.ranking-item { padding: 0.4rem 0.5rem; }
.matches-section { margin-top: 0.8rem; }
.matches-table th, .matches-table td { padding: 0.35rem 0.45rem; }

@media (max-width: 768px) {
  .main-content { margin: 0.6rem auto 1.1rem; }
  .ia-hero-card, .filtro-personalizado-card { padding: 0.7rem 0.8rem; }
  .chart-container { height: 190px; }
}

/* Nome do jogador no cartão de artilharia do Campeonato: link para o card de gols. */
.camp-scorer-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.camp-scorer-link:hover, .camp-scorer-link:focus-visible { text-decoration: underline; }

/* Ícone de alerta com tooltip para ressalvas de cobertura dos dados. */
.aviso-tooltip {
  position: relative;
  display: inline-block;
  color: #f59e0b;
  cursor: help;
  font-style: normal;
  font-weight: 700;
}
.aviso-tooltip::after {
  content: attr(data-tooltip);
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 6px);
  width: max-content;
  max-width: 260px;
  padding: 0.45rem 0.6rem;
  background: #0d0d0d;
  color: #f0efec;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  pointer-events: none;
  z-index: 60;
}
/* Só existe quando visível: oculto, ele alargaria a página e criaria rolagem lateral. */
.aviso-tooltip:hover::after, .aviso-tooltip:focus-visible::after { display: block; }
@media (max-width: 640px) {
  .aviso-tooltip::after {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
    max-width: none;
    transform: none;
  }
}

/* Pênaltis, faltas e assistências ficam juntos na linha de baixo do artilheiro. */
.ranking-meta-tipos { display: block; white-space: nowrap; }

/* A caixa de perguntas encolhe em vez de invadir o botão do microfone. */
.ia-input-field { min-width: 0; width: 100%; }
.ia-input-actions { flex-shrink: 0; }
.ia-input-field { padding-right: 0.9rem; }
.ia-input-field { width: auto; margin-right: 0.9rem; }
