/* ===== [FILE:scores_view.css] ===== */

/* =================== Toolbar & utilidades =================== */
.is-hidden { display: none !important; }

.sv-toolbar { display:flex; gap:.5rem; align-items:center; flex-wrap:wrap; }
.sv-toolbar .form-select,
.sv-toolbar .btn { height: 32px; padding: 2px 8px; font-size: .9rem; }

.sv-cols-dropdown { min-width: 260px; max-height: 30vh; overflow:auto; }
.sv-cols-dropdown .form-check { margin: .25rem .5rem; }

/* Mantém posicionamento relativo da área da tabela */
.table-wrap.sticky-controls {
  position: relative;
  padding-top: 0;          /* sem espaço para badge */
}

/* Badge removido da UI */
.sv-floating-badge { display: none !important; }

/* =================== Variáveis de largura (edite aqui) =================== */
:root {
  /* Identificação */
  --col-num: 50px;
  --col-nome: 120px;         /* Nome/Piloto (expande quando maior) */
  --col-arquivo: 120px;

  /* Decolagem/Pouso/Altitude/Duração */
  --col-hora-decolagem: 120px;
  --col-hora-pouso: 132px;
  --col-alt-max: 110px;
  --col-tempo-voo: 120px;

  /* SP/FP e Válidos */
  --col-hora-sp: 120px;
  --col-hora-fp: 120px;
  --col-tp-total: 80px;
  --col-hg-total: 80px;
  --col-tg-total: 80px;

  /* Métricas */
  --col-spfp-min: 120px;
  --col-dist-km: 120px;
  --col-velocidade: 140px;

  /* TGs dinâmicos (aplica a todas as 3 por TG) */
  --col-tg-decl: 120px;
  --col-tg-voado: 120px;
  --col-tg-erro: 120px;

  /* FP declarado/voado/erro */
  --col-decl-fp: 120px;
  --col-voado-fp: 120px;
  --col-erro-fp: 120px;

  /* Colunas finais */
  --col-score-tg-bruto: 140px;
  --col-penalidade: 130px;
  --col-dq: 80px;
  --col-score-tp: 130px;
  --col-score-hg: 130px;
  --col-score-tg: 130px;
  --col-score-vel: 130px;
  --col-sum-scores: 130px;
  --col-score-geral: 150px;
}

/* =================== Tabela & alinhamentos =================== */
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;border:1px solid rgba(0,0,0,.1);border-radius:.5rem;background:#fff}
table.nowrap-table thead th,
table.nowrap-table tbody td{white-space:nowrap;vertical-align:middle;text-align:center}

/* Alinhamento à esquerda para Nome e Arquivo */
th.col-name, td.col-name,
th.col-file, td.col-file { text-align:left !important; }

/* Números monoespaçados e alinhados à direita */
.nowrap-table tbody td { text-align: right; }
.nowrap-table tbody td.col-name,
.nowrap-table tbody td.col-file { text-align: left; }
.nowrap-table td.mono, .nowrap-table th.mono { font-variant-numeric: tabular-nums; }

/* =================== Larguras mínimas por coluna =================== */
/* Base genérica */
.nowrap-table thead th { min-width: 90px; }

/* Identificação */
.nowrap-table thead th.col-idx,
.nowrap-table thead th[data-col="num"]            { min-width: var(--col-num); }
.nowrap-table thead th.col-name,
.nowrap-table thead th[data-col="nome"]           { min-width: var(--col-nome); }
.nowrap-table thead th.col-file,
.nowrap-table thead th[data-col="arquivo"]        { min-width: var(--col-arquivo); }

/* Decolagem / Pouso / Altitude / Duração */
.nowrap-table thead th[data-col="hora_decolagem"] { min-width: var(--col-hora-decolagem); }
.nowrap-table thead th[data-col="hora_pouso"]     { min-width: var(--col-hora-pouso); }
.nowrap-table thead th[data-col="alt_max"]        { min-width: var(--col-alt-max); }
.nowrap-table thead th[data-col="tempo_voo"]      { min-width: var(--col-tempo-voo); }

/* SP/FP e Válidos */
.nowrap-table thead th[data-col="hora_sp"]        { min-width: var(--col-hora-sp); }
.nowrap-table thead th[data-col="hora_fp"]        { min-width: var(--col-hora-fp); }
.nowrap-table thead th[data-col="tp_total"]       { min-width: var(--col-tp-total); }
.nowrap-table thead th[data-col="hg_total"]       { min-width: var(--col-hg-total); }
.nowrap-table thead th[data-col="tg_total"]       { min-width: var(--col-tg-total); }

/* Métricas */
.nowrap-table thead th[data-col="t_spfp_min"]     { min-width: var(--col-spfp-min); }
.nowrap-table thead th[data-col="dist_km"]        { min-width: var(--col-dist-km); }
.nowrap-table thead th[data-col="velocidade"]     { min-width: var(--col-velocidade); }

/* TGs dinâmicos */
.nowrap-table thead th[data-col^="tg_decl_"]      { min-width: var(--col-tg-decl); }
.nowrap-table thead th[data-col^="tg_voado_"]     { min-width: var(--col-tg-voado); }
.nowrap-table thead th[data-col^="tg_erro_"]      { min-width: var(--col-tg-erro); }

/* FP declarado/voado/erro */
.nowrap-table thead th[data-col="decl_fp"]        { min-width: var(--col-decl-fp); }
.nowrap-table thead th[data-col="voado_fp"]       { min-width: var(--col-voado-fp); }
.nowrap-table thead th[data-col="erro_fp"]        { min-width: var(--col-erro-fp); }

/* Colunas finais mais largas (ajuste fino) */
.nowrap-table thead th[data-col="score_tg_bruto"] { min-width: var(--col-score-tg-bruto); }
.nowrap-table thead th[data-col="penalidade"]     { min-width: var(--col-penalidade); }
.nowrap-table thead th[data-col="dq"]             { min-width: var(--col-dq); text-align:center; }

.nowrap-table thead th[data-col="score_tp"]       { min-width: var(--col-score-tp); }
.nowrap-table thead th[data-col="score_hg"]       { min-width: var(--col-score-hg); }
.nowrap-table thead th[data-col="score_tg"]       { min-width: var(--col-score-tg); }
.nowrap-table thead th[data-col="score_vel"]      { min-width: var(--col-score-vel); }
.nowrap-table thead th[data-col="sum_scores"]     { min-width: var(--col-sum-scores); }
.nowrap-table thead th[data-col="score_geral"]    { min-width: var(--col-score-geral); }

/* Mantém o menu "Colunas" acima dos cards/tabela */
.sv-toolbar { position: relative; z-index: 2000; }
.sv-toolbar .dropdown-menu,
.sv-cols-dropdown { position: absolute; z-index: 2000; }
