/* Projeção de Crescimento Anual (js/projecao.js). Herda graficos.css, tema.css e os cartões de número do bi.css. */

#screen-projecao { min-height: 100%; }

/* cores das empresas (as da tela do desktop; par validado nos dois temas), queda e a rampa da sazonalidade (um tom só).
   No :root porque a dica do gráfico mora no body. */
:root { --pj-mcl: #2a78d6; --pj-sw: #eb6834; --pj-neg: #d03b3b; --pj-saz: #2a78d6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pj-mcl: #3987e5; --pj-sw: #d95926; --pj-saz: #5598e7; } }
:root[data-theme="dark"] { --pj-mcl: #3987e5; --pj-sw: #d95926; --pj-saz: #5598e7; }

/* indicadores: o 1º (vendido) em destaque */
.pj-kpis { display: grid; grid-template-columns: 1.55fr repeat(4, minmax(0, 1fr)); gap: 14px; }
.pj-kpi { min-width: 0; gap: 6px; }
.pj-kpi .bi-kpi-val { font-size: 26px; }
.pj-kpi.hero .bi-kpi-val { font-size: 44px; }
.pj-kpi-det { font-size: 12px; color: var(--mut); }
.pj-kpi .gx-med { margin-top: 4px; }
.pj-kpi .gx-chip { align-self: flex-start; margin-top: 2px; }
.pj-med-nota { display: block; margin-top: 3px; font-size: 11px; color: var(--dim); }
@container pj (max-width: 1080px) { .pj-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pj-kpi.hero { grid-column: 1 / -1; } }
@container pj (max-width: 520px) { .pj-kpis { grid-template-columns: 1fr; } .pj-kpi.hero .bi-kpi-val { font-size: 38px; } }

.pj .gx-conteudo { container-name: pj; container-type: inline-size; }
.pj-meio { grid-template-columns: minmax(0, 19fr) minmax(0, 10fr); }
.pj-base { grid-template-columns: minmax(0, 125fr) minmax(0, 100fr); }
.pj-meta-topo { grid-template-columns: minmax(0, 11fr) minmax(0, 16fr); }
.pj-metas-base { grid-template-columns: minmax(0, 17fr) minmax(0, 10fr); }
@container pj (max-width: 1000px) { .pj-meio, .pj-base, .pj-meta-topo, .pj-metas-base { grid-template-columns: minmax(0, 1fr); } }

/* "Dá para bater a meta?" */
.pj-pipe { margin: 10px 0 12px; }
.pj-pipe div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--ln); font-size: 13px; }
.pj-pipe div:last-child { border-bottom: 0; }
.pj-pipe dt { color: var(--mut); }
.pj-pipe dd { margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pj-pipe dd.forte { font-weight: 800; }
.pj-pipe .dest dt { color: var(--txt); font-weight: 800; }
.pj-pipe-chip { margin-top: 10px; }

.pj-q { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }
.pj-leitura { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pj-leitura li { display: flex; gap: 10px; align-items: flex-start; }
.pj-leitura .gx-chip { min-width: 30px; justify-content: center; border-radius: 8px; padding: 3px 0; }
.pj-leitura p { margin: 0; font-size: 12.5px; line-height: 1.5; }

/* linhas e marcas dos gráficos */
.pj-faixa { fill: var(--ac); fill-opacity: .13; stroke: none; }
.pj-l-ant { fill: none; stroke: var(--dim); stroke-width: 2; stroke-linejoin: round; }
.pj-l-meta { fill: none; stroke: var(--tx); stroke-width: 2; }
.pj-l-real { fill: none; stroke: var(--ac); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.pj-l-proj { fill: none; stroke: var(--ac); stroke-width: 2; stroke-dasharray: 6 5; }
.pj-ponto { fill: var(--ac); stroke: var(--surf); stroke-width: 2; }
.pj-l-metaano { stroke: var(--tx); stroke-width: 3; }
.pj-projecao { fill: none; stroke: var(--mu); stroke-width: 1.2; stroke-dasharray: 4 3; }
.pj-l-ritmo { fill: none; stroke: var(--mu); stroke-width: 2; stroke-dasharray: 2 3; }
.pj-p-ritmo { fill: var(--mu); stroke: var(--surf); stroke-width: 2; }

.pj-anual th, .pj-anual td { padding: 7px 8px; }

/* mapa de calor ano × mês (13 tons do azul da MCL; no escuro a rampa inverte: o valor alto é o claro) */
.pj-mapa { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 3px; font-size: 12px; font-variant-numeric: tabular-nums; }
.pj-mapa th { font-size: 11px; font-weight: 700; color: var(--mut); text-align: center; padding: 4px; white-space: nowrap; }
.pj-mapa tbody th { text-align: left; color: var(--txt); font-size: 12px; }
.pj-mapa td { text-align: center; padding: 8px 2px; border-radius: 6px; outline: none; }
.pj-mapa td.e, .pj-mapa th.e { text-align: left; padding-left: 8px; white-space: nowrap; }
.pj-mapa td.forte { font-weight: 800; }
.pj-mapa td[data-gx]:focus-visible, .pj-mapa td.gx-ativo { box-shadow: 0 0 0 2px var(--ac); }
.pj-mapa td.pj-vz { color: var(--dim); }
.pj-mapa .pj-r { font-weight: 800; }
.pj-mapa tr.pj-media td, .pj-mapa tr.pj-media th { border-top: 1px solid var(--ln); }
.pj-mapa tr.pj-chance-t th { text-align: left; padding-top: 10px; color: var(--txt); font-size: 12px; font-weight: 800; }
.pj-barra { display: block; height: 6px; margin: 4px 6px 0; border-radius: 3px; background: var(--p2); overflow: hidden; }
.pj-barra i { display: block; height: 100%; background: var(--ac); border-radius: 3px; }
.pj-r0 { background: #cde2fb; color: #10201A; } .pj-r1 { background: #b7d3f6; color: #10201A; } .pj-r2 { background: #9ec5f4; color: #10201A; }
.pj-r3 { background: #86b6ef; color: #10201A; } .pj-r4 { background: #6da7ec; color: #10201A; } .pj-r5 { background: #5598e7; color: #10201A; }
.pj-r6 { background: #3987e5; color: #fff; } .pj-r7 { background: #2a78d6; color: #fff; } .pj-r8 { background: #256abf; color: #fff; }
.pj-r9 { background: #1c5cab; color: #fff; } .pj-r10 { background: #184f95; color: #fff; } .pj-r11 { background: #104281; color: #fff; }
.pj-r12 { background: #0d366b; color: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pj-r0 { background: #0d366b; color: #fff; } :root:not([data-theme="light"]) .pj-r1 { background: #104281; color: #fff; }
  :root:not([data-theme="light"]) .pj-r2 { background: #184f95; color: #fff; } :root:not([data-theme="light"]) .pj-r3 { background: #1c5cab; color: #fff; }
  :root:not([data-theme="light"]) .pj-r4 { background: #256abf; color: #fff; } :root:not([data-theme="light"]) .pj-r5 { background: #2a78d6; color: #fff; }
  :root:not([data-theme="light"]) .pj-r6 { background: #3987e5; color: #fff; } :root:not([data-theme="light"]) .pj-r7 { background: #5598e7; color: #08230F; }
  :root:not([data-theme="light"]) .pj-r8 { background: #6da7ec; color: #08230F; } :root:not([data-theme="light"]) .pj-r9 { background: #86b6ef; color: #08230F; }
  :root:not([data-theme="light"]) .pj-r10 { background: #9ec5f4; color: #08230F; } :root:not([data-theme="light"]) .pj-r11 { background: #b7d3f6; color: #08230F; }
  :root:not([data-theme="light"]) .pj-r12 { background: #cde2fb; color: #08230F; }
}
:root[data-theme="dark"] .pj-r0 { background: #0d366b; color: #fff; } :root[data-theme="dark"] .pj-r1 { background: #104281; color: #fff; }
:root[data-theme="dark"] .pj-r2 { background: #184f95; color: #fff; } :root[data-theme="dark"] .pj-r3 { background: #1c5cab; color: #fff; }
:root[data-theme="dark"] .pj-r4 { background: #256abf; color: #fff; } :root[data-theme="dark"] .pj-r5 { background: #2a78d6; color: #fff; }
:root[data-theme="dark"] .pj-r6 { background: #3987e5; color: #fff; } :root[data-theme="dark"] .pj-r7 { background: #5598e7; color: #08230F; }
:root[data-theme="dark"] .pj-r8 { background: #6da7ec; color: #08230F; } :root[data-theme="dark"] .pj-r9 { background: #86b6ef; color: #08230F; }
:root[data-theme="dark"] .pj-r10 { background: #9ec5f4; color: #08230F; } :root[data-theme="dark"] .pj-r11 { background: #b7d3f6; color: #08230F; }
:root[data-theme="dark"] .pj-r12 { background: #cde2fb; color: #08230F; }

/* Metas do ano */
.pj-meta-r { font-size: 12px; font-weight: 600; color: var(--mut); }
.pj-meta-v { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin: 2px 0 8px; }
.pj-meta-l { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12.5px; color: var(--mut); }
.pj-meta-l b { color: var(--txt); }
.pj-tipo { margin-top: 12px; }
.pj-tipo > div:first-child { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 5px; font-size: 12.5px; color: var(--mut); }
.pj-tipo b { color: var(--txt); font-size: 13px; }

/* Lançamentos manuais */
.pj-lanc-pe { align-items: center; }
.pj-lanc-pe span { flex: 1 1 220px; font-size: 12.5px; color: var(--mut); }
.pj-lanc-pe span.gx-ok { color: var(--ok-fg); } .pj-lanc-pe span.gx-err { color: var(--err-fg); font-weight: 700; }
.pj-lanc-pe .btn { flex: 0 0 auto; }
#pj-lanc .modal { max-width: 920px; }
#pj-lanc-area { display: flex; flex-direction: column; gap: 12px; }
#pj-lanc-area .gx-nota { margin: 0; }
.pj-barra-l { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.pj-l-emp { font-size: 13.5px; font-weight: 800; margin: 4px 0 -4px; }
.pj-l-rot { margin: 0; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.pj-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.pj-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pj-meses { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 720px) { .pj-2, .pj-3 { grid-template-columns: 1fr; } .pj-meses { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
