/* V1656 — Riscos e oportunidades da carteira: matriz Nível × Evolução e fila "Quem analisar primeiro". */
.gpm-v1656, .gpq-v1656 { margin: 18px 0 0; }
.gpm-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin: 0 0 10px; }
.gpm-cab h4 { margin: 0; padding-left: 10px; border-left: 3px solid var(--tq-laranja, #e8741c); font-size: 14.5px; color: #13254a; }
.gpm-cab span { font-size: 12px; color: #718096; }
.gpm-grade { display: grid; grid-template-columns: 170px repeat(3, minmax(0, 1fr)); gap: 8px; }
.gpm-canto { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 0 4px 6px; }
.gpm-canto small { font-size: 10.5px; color: #8a97a8; text-transform: uppercase; letter-spacing: .03em; }
.gpm-ch { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; padding: 8px 6px; border-radius: 10px; background: #f6f8fb; border-bottom: 3px solid var(--c); }
.gpm-ch b { font-size: 13px; color: var(--c); }
.gpm-ch small { font-size: 11px; color: #718096; }
.gpm-rh { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid #e3e9f1; border-left: 4px solid var(--c); }
.gpm-rh .gpn-selo { font-size: 12px; }
.gpm-rh small { font-size: 11px; color: #718096; }
.gpm-c { display: flex; flex-direction: column; gap: 6px; min-height: 64px; padding: 10px 12px; border: 1px dashed #dfe5ec; border-radius: 10px; background: #fbfcfd; }
.gpm-c strong { font-size: 20px; line-height: 1; color: #b4bfcc; }
.gpm-c.gpm-tem { border: 1px solid color-mix(in srgb, var(--c) 35%, #fff); background: var(--f); }
.gpm-c.gpm-tem strong { color: var(--c); font-size: 24px; }
.gpm-c.gpm-quente { box-shadow: inset 0 0 0 2px var(--c); }
.gpm-c em { align-self: flex-start; font-style: normal; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: #fff; background: var(--c); padding: 2px 8px; border-radius: 999px; }
.gpm-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.gpm-chip { border: 1px solid rgba(19, 37, 74, .14); background: #fff; color: #13254a; border-radius: 999px; padding: 3px 10px; font: 600 12px/1.3 inherit; cursor: pointer; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.gpm-chip:hover { border-color: var(--c); color: var(--c); }
.gpm-mais { font-size: 11.5px; color: #5b6b80; align-self: center; }

/* Fila "Quem analisar primeiro" — sem barra de rolagem */
#main .table-wrap:has(.gpq-tab) { overflow: visible !important; }
#main table.gpq-tab.gpq-tab { width: 100% !important; min-width: 0 !important; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
#main table.gpq-tab th { white-space: normal !important; font-size: 10.5px !important; letter-spacing: 0 !important; vertical-align: bottom; }
#main table.gpq-tab .gpq-n { width: 44px; text-align: center; }
#main table.gpq-tab .gpq-forn { width: 19%; }
#main table.gpq-tab .gpq-evo { width: 118px; }
#main table.gpq-tab .gpq-an { width: 15%; }
#main table.gpq-tab .gpq-ac { width: 100px; text-align: right; }
#main table.gpq-tab td { vertical-align: middle; overflow-wrap: break-word; }
.gpq-pos { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #eef2f7; color: #13254a; font-weight: 800; font-size: 12.5px; }
.gpq-critico .gpq-pos { background: #fbe3e1; color: #9f2a20; } .gpq-alerta .gpq-pos { background: #fdecd9; color: #8a3b00; }
.gpq-forn strong { display: block; color: #13254a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gpq-forn small { display: block; margin: 1px 0 5px; font-size: 11.5px; color: #718096; }
.gpq-dots { display: inline-flex; gap: 3px; margin-bottom: 4px; }
.gpq-dots .gpn-dot { width: 10px; height: 10px; margin: 0; }
.gpq-ev { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.gpq-ev-piorou { background: #fdecec; color: #b42318; } .gpq-ev-melhorou { background: #e8f6ee; color: #1e6b40; } .gpq-ev-estavel { background: #f1f4f8; color: #5b6b80; }
.gpq-evo { white-space: nowrap; } .gpq-evo .gpq-dots, .gpq-evo .gpq-ev { display: flex; width: max-content; }
.gpq-txt { font-size: 12.5px; color: #34465c; line-height: 1.4; }
.gpq-txt b { font-weight: 600; color: #13254a; }
.gpq-sem { color: #9aa6b6; font-style: italic; }
.gpq-legenda { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font-size: 11.5px; color: #718096; }
.gpq-legenda span { display: inline-flex; align-items: center; gap: 5px; }
.gpq-legenda .gpn-dot { margin: 0; }

@media (max-width: 1100px) {
  .gpm-grade { grid-template-columns: 120px repeat(3, minmax(0, 1fr)); gap: 6px; }
  #main table.gpq-tab.gpq-tab, #main table.gpq-tab tbody, #main table.gpq-tab tr, #main table.gpq-tab td { display: block; width: 100% !important; }
  #main table.gpq-tab thead { display: none; }
  #main table.gpq-tab tbody { display: grid; gap: 10px; }
  #main table.gpq-tab.gpq-tab.gpq-tab.gpq-tab tr { position: relative; padding: 12px 14px 12px 52px; border: 1px solid #e3e9f1; border-radius: 12px; background: #fff; }
  #main table.gpq-tab.gpq-tab.gpq-tab.gpq-tab.gpq-tab.gpq-tab > tbody > tr > td { border: 0 !important; padding: 4px 0 !important; background: transparent !important; }
  #main table.gpq-tab td.gpq-n { position: absolute; left: 12px; top: 14px; width: auto !important; padding: 0 !important; }
  #main table.gpq-tab td[data-label]:not(.gpq-forn)::before { content: attr(data-label); display: block; font-size: 10.5px; font-weight: 700; color: #8a97a8; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
  #main table.gpq-tab td.gpq-evo .gpq-dots, #main table.gpq-tab td.gpq-evo .gpq-ev { display: inline-flex; margin-right: 8px; }
  #main table.gpq-tab td.gpq-ac { text-align: right; }
}
@media (max-width: 640px) {
  .gpm-grade { grid-template-columns: 1fr; }
  .gpm-canto, .gpm-ch { display: none; }
  .gpm-rh { margin-top: 6px; }
  .gpm-c::before { font-size: 10.5px; font-weight: 700; color: #8a97a8; text-transform: uppercase; }
  .gpm-grade > .gpm-c:nth-child(4n+2)::before { content: "▲ Piorou"; }
  .gpm-grade > .gpm-c:nth-child(4n+3)::before { content: "Estável"; }
  .gpm-grade > .gpm-c:nth-child(4n+4)::before { content: "▼ Melhorou"; }
}

/* V1658 — canto da matriz no mesmo formato dos cabeçalhos; células vazias mais baixas */
.gpm-canto { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; padding: 8px 34px 8px 12px; border-radius: 10px; background: #f6f8fb; border-bottom: 3px solid #13254a; }
.gpm-canto b { font-size: 13px; color: #13254a; }
.gpm-canto small { font-size: 11px; color: #718096; text-transform: none; letter-spacing: 0; line-height: 1.3; }
.gpm-canto .gpm-seta { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 18px; font-weight: 700; color: #8a97a8; }
.gpm-c:not(.gpm-tem) { min-height: 52px; justify-content: center; }
.gpm-c:not(.gpm-tem) strong { font-size: 18px; color: #c3ccd7; }
.gpm-rh { min-height: 52px; }

/* V1659 — cabeçalhos da matriz sem a linha inferior curva: fundo suave na cor da evolução */
.gpm-ch, .gpm-canto { border-bottom: 0 !important; border: 1px solid transparent; border-radius: 10px; padding: 9px 10px; min-height: 52px; justify-content: center; }
.gpm-ch { flex-direction: row !important; align-items: center !important; justify-content: center !important; gap: 10px !important; }
.gpm-ch b { font-size: 13.5px; }
.gpm-ch small { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #fff; color: var(--c); border: 1px solid rgba(0, 0, 0, .06); }
.gpm-ch-piorou { background: #fdf0ef; border-color: #f6d3cf; }
.gpm-ch-estavel { background: #f4f6f9; border-color: #e3e9f1; }
.gpm-ch-melhorou { background: #eef8f2; border-color: #cfe9da; }
.gpm-canto { background: #fff; border-color: #e3e9f1; }
.gpm-ch b, .gpm-ch small { line-height: 1.2; margin: 0; display: inline-flex; align-items: center; }
/* V1660 — célula de prioridade máxima com borda fina (1 px) em vez do contorno duplo */
.gpm-c.gpm-quente { box-shadow: none !important; border: 1px solid var(--c) !important; }

/* V1661 — Riscos/oportunidades, matriz e fila em cartões separados */
.card.gpr-card { margin-top: 16px; }
.card.gpr-card > .gpm-v1656, .card.gpr-card > .gpq-v1656 { margin: 0; }
.gpn-intel-grid { align-items: start; margin-bottom: 0 !important; }
#main .table-wrap:has(> .gpn-intel-grid) { border: 0 !important; overflow: visible !important; background: transparent !important; }

/* V1662 — Planos de ação da carteira (e Monitoramento/Tendência): cartões de resumo fora da moldura; tabela por fornecedor em cartão próprio */
#fp-area .gpn-kpis { gap: 14px !important; margin: 4px 0 4px !important; }
#fp-area .gpn-kpis + .table-wrap { margin-top: 16px !important; }
.gpm-cab > div { display: grid; gap: 3px; }
.gpa-v1662 .gpm-cab { align-items: center; margin-bottom: 14px; }
#main table.gpa-tab.gpa-tab { width: 100% !important; min-width: 0 !important; table-layout: fixed; border-collapse: separate; border-spacing: 0; border: 1px solid #e3e9f1; border-radius: 10px; overflow: hidden; }
#main table.gpa-tab > thead > tr > th { white-space: normal !important; font-size: 10.5px !important; letter-spacing: 0 !important; line-height: 1.25; vertical-align: bottom; text-align: center; padding: 10px 6px !important; background: #f4f7fb !important; color: #42536a !important; }
#main table.gpa-tab > thead > tr > th.gpa-forn, #main table.gpa-tab > thead > tr > th.gpa-aut { text-align: left; }
#main table.gpa-tab .gpa-forn { width: 19%; }
#main table.gpa-tab .gpa-aut { width: 16%; }
#main table.gpa-tab .gpa-ac { width: 100px; text-align: right; }
#main table.gpa-tab.gpa-tab.gpa-tab.gpa-tab > tbody > tr > td { text-align: center; vertical-align: middle; padding: 12px 6px !important; }
#main table.gpa-tab.gpa-tab.gpa-tab.gpa-tab > tbody > tr > td.gpa-forn { text-align: left; padding-left: 14px !important; border-left: 3px solid transparent; }
#main table.gpa-tab.gpa-tab.gpa-tab.gpa-tab > tbody > tr > td.gpa-aut { text-align: left; font-size: 12.5px; color: #34465c; }
#main table.gpa-tab.gpa-tab.gpa-tab.gpa-tab > tbody > tr > td.gpa-ac { text-align: right; padding-right: 12px !important; }
#main table.gpa-tab > thead > tr > th.gpa-forn { padding-left: 14px !important; }
#main table.gpa-tab.gpa-tab.gpa-tab.gpa-tab > tbody > tr.gpa-l-venc > td.gpa-forn { border-left-color: #c8372d; }
#main table.gpa-tab.gpa-tab.gpa-tab.gpa-tab > tbody > tr.gpa-l-pend > td.gpa-forn { border-left-color: #1d5fd1; }
.gpa-forn strong { display: block; color: #13254a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gpa-forn small { display: block; margin-top: 2px; font-size: 11.5px; color: #718096; }
.gpa-qt { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 26px; padding: 0 8px; border-radius: 999px; font: 800 13px/1 var(--tq-fonte, inherit); font-variant-numeric: tabular-nums; }
.gpa-neutro { background: #eef2f7; color: #13254a; }
.gpa-venc { background: #fdecec; color: #b42318; }
.gpa-aviso { background: #fff3e2; color: #8a4b00; }
.gpa-azul { background: #e8f0fd; color: #1d5fd1; }
.gpa-ok { background: #e8f6ee; color: #1e6b40; }
.gpa-zero { color: #b4bfcc; font-weight: 600; }
@media (max-width: 1100px) {
  #main table.gpa-tab.gpa-tab, #main table.gpa-tab tbody, #main table.gpa-tab tr { display: block; width: 100% !important; }
  #main table.gpa-tab.gpa-tab { border: 0; }
  #main table.gpa-tab thead { display: none; }
  #main table.gpa-tab tbody { display: grid; gap: 10px; }
  #main table.gpa-tab.gpa-tab.gpa-tab.gpa-tab > tbody > tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px 12px; padding: 12px 14px; border: 1px solid #e3e9f1; border-radius: 12px; background: #fff; }
  #main table.gpa-tab.gpa-tab.gpa-tab.gpa-tab > tbody > tr > td { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0 !important; border: 0 !important; background: transparent !important; text-align: left; }
  #main table.gpa-tab.gpa-tab.gpa-tab.gpa-tab > tbody > tr > td.gpa-forn, #main table.gpa-tab.gpa-tab.gpa-tab.gpa-tab > tbody > tr > td.gpa-aut, #main table.gpa-tab.gpa-tab.gpa-tab.gpa-tab > tbody > tr > td.gpa-ac { grid-column: 1 / -1; }
  #main table.gpa-tab.gpa-tab.gpa-tab.gpa-tab > tbody > tr > td.gpa-forn { display: block; padding: 0 0 6px !important; border-bottom: 1px solid #eef2f6 !important; }
  #main table.gpa-tab td[data-label]:not(.gpa-forn)::before { content: attr(data-label); font-size: 10.5px; font-weight: 700; color: #8a97a8; text-transform: uppercase; letter-spacing: .03em; }
  #main table.gpa-tab.gpa-tab.gpa-tab.gpa-tab > tbody > tr > td.gpa-ac { justify-content: flex-end; }
}
#fp-area.gp-ancora-padrao .gpn-kpi.gpn-kpi-cor strong, #fp-area .gpn-kpi.gpn-kpi-cor strong { color: var(--kpi-valor) !important; }  /* V1662: valor colorido quando há pendência */
