/* Aba Postos — tabela sempre dentro da largura da página, sem arrastar pro lado */
/* Tabela de postos: SEMPRE cabe na largura da página (zoom 100%, telas
   de notebook) — colunas com largura fixa em %, texto quebra linha em
   vez de empurrar a tabela pro lado. Nada de rolagem lateral. */
#tela-postos .tabela-wrap { overflow:hidden; background:var(--card); border:1px solid var(--border); border-radius:14px; }
#tela-postos table.tb-ranking { width:100%; min-width:0; table-layout:fixed; }
#tela-postos table.tb-ranking th, #tela-postos table.tb-ranking td { padding:11px 8px; overflow-wrap:anywhere; word-break:normal; }
#tela-postos table.tb-ranking th { white-space:normal; line-height:1.35; letter-spacing:.5px; }
#tela-postos table.tb-ranking th:nth-child(1) { width:4%; }
#tela-postos table.tb-ranking th:nth-child(2) { width:21%; }
#tela-postos table.tb-ranking th:nth-child(3) { width:12%; }
#tela-postos table.tb-ranking th:nth-child(4) { width:11%; }
#tela-postos table.tb-ranking th:nth-child(5) { width:8%; }
#tela-postos table.tb-ranking th:nth-child(6) { width:6%; }
#tela-postos table.tb-ranking th:nth-child(7) { width:16%; }
#tela-postos table.tb-ranking th:nth-child(8) { width:13%; }
#tela-postos table.tb-ranking th:nth-child(9) { width:9%; }
#tela-postos table.tb-ranking th:first-child, #tela-postos table.tb-ranking td:first-child { padding-left:14px; padding-right:4px; }
#tela-postos table.tb-ranking th:last-child, #tela-postos table.tb-ranking td:last-child { padding-right:12px; text-align:right; }
#tela-postos table.tb-ranking .placa-cel { font-size:12.5px; }
#tela-postos table.tb-ranking th:nth-child(5), #tela-postos table.tb-ranking th:nth-child(6),
#tela-postos table.tb-ranking td:nth-child(5), #tela-postos table.tb-ranking td:nth-child(6) { text-align:center; }
#tela-postos table.tb-ranking td:nth-child(5) { white-space:nowrap; font-size:13px; }
#tela-postos table.tb-ranking .pt-badge-info, #tela-postos .pt-homol span, #tela-postos .pt-rede-tag { white-space:normal; max-width:100%; }
#tela-postos table.tb-ranking td:nth-child(8) .pt-badge-info { margin:2px 0; }
#tela-postos table.tb-ranking td:last-child .btn-sm { white-space:nowrap; padding:7px 10px; }
/* tela estreita: esconde as colunas de apoio (Rede, Lançamentos, Gerente) pra caber sem arrastar */
@media (max-width:860px) {
  #tela-postos table.tb-ranking th:nth-child(4), #tela-postos table.tb-ranking td:nth-child(4),
  #tela-postos table.tb-ranking th:nth-child(6), #tela-postos table.tb-ranking td:nth-child(6),
  #tela-postos table.tb-ranking th:nth-child(8), #tela-postos table.tb-ranking td:nth-child(8) { display:none; }
  #tela-postos table.tb-ranking th:nth-child(1) { width:8%; }
  #tela-postos table.tb-ranking th:nth-child(2) { width:32%; }
  #tela-postos table.tb-ranking th:nth-child(3) { width:18%; }
  #tela-postos table.tb-ranking th:nth-child(5) { width:14%; }
  #tela-postos table.tb-ranking th:nth-child(7) { width:28%; }
  #tela-postos table.tb-ranking th:nth-child(9) { width:16%; }
  #tela-postos table.tb-ranking td:last-child .btn-sm { padding:6px 8px; font-size:11px; }
}
table.pt-imp-tabela td:nth-child(3) { max-width:260px; }
table.pt-imp-tabela td:nth-child(5) select, table.pt-imp-tabela td:nth-child(6) select { min-width:240px; }
.pt-imp-escolha { font-size:10.5px; color:var(--sub); margin-top:4px; max-width:330px; line-height:1.35; }
table.pt-imp-tabela td:nth-child(3) { min-width:210px; }
/* celular: cada posto vira um cartão (sem colunas espremidas e sem arrastar pro lado) */
@media (max-width:600px) {
  #tela-postos table.tb-ranking thead { display:none; }
  #tela-postos table.tb-ranking, #tela-postos table.tb-ranking tbody, #tela-postos table.tb-ranking tr { display:block; width:100%; }
  #tela-postos table.tb-ranking tr { position:relative; padding:12px 12px 10px; border-bottom:1px solid var(--border); }
  #tela-postos table.tb-ranking tr:last-child { border-bottom:none; }
  #tela-postos table.tb-ranking td, #tela-postos table.tb-ranking td:nth-child(4), #tela-postos table.tb-ranking td:nth-child(6), #tela-postos table.tb-ranking td:nth-child(8) {
    display:block; width:auto; border:none; padding:2px 0 !important; text-align:left !important; font-size:12.5px; }
  #tela-postos table.tb-ranking td:first-child { position:absolute; top:12px; left:12px; padding:0 !important; }
  #tela-postos table.tb-ranking td:nth-child(2) { padding:0 78px 4px 28px !important; }
  #tela-postos table.tb-ranking td:last-child { position:absolute; top:9px; right:10px; padding:0 !important; }
  #tela-postos table.tb-ranking td:nth-child(n+3):not(:last-child) { padding-left:28px !important; }
  #tela-postos table.tb-ranking td:nth-child(4)::before { content:'Rede: '; color:var(--sub); }
  #tela-postos table.tb-ranking td:nth-child(5)::before { content:'Valor médio: '; color:var(--sub); font-weight:400; }
  #tela-postos table.tb-ranking td:nth-child(6)::before { content:'Lançamentos: '; color:var(--sub); }
  #tela-postos table.tb-ranking td.vazio { padding:16px !important; text-align:center !important; position:static; }
}
#tela-postos .pt-homol span { font-size:10px; padding:2px 7px; letter-spacing:0; }
