/*
 * PROSPECTA CORBAN V295 — Relatorio Projecao.
 * Camada visual do modo escuro, usando as classes reais do projeto.
 * Alinhamento inicial corrigido, sem mudar HTML, JS, busca, ordenacao,
 * edicao de meta, remocao/retorno de participantes ou calculos.
 * O simbolo da Prospecta e os indicadores semanticos permanecem intactos.
 */

/* Alinhamento da janela independente: nao herdar as margens do launcher. */
html[data-app-theme="dark"][data-report-window="projecao"] #section-reports.reports-launcher {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 12px 14px 26px !important;
  background:
    radial-gradient(ellipse at 90% 3%, rgba(35, 116, 234, .065), transparent 38%),
    linear-gradient(180deg, #081625, #071321 80%) !important;
}
html[data-app-theme="dark"][data-report-window="projecao"] #reports-projection {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  color: #eaf7ff !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 12.5px;
  --projection-v295-accent: #75d7ff;
  --projection-v295-muted: #9bbfd9;
  --projection-v295-border: rgba(98, 175, 243, .35);
}
html[data-app-theme="dark"][data-report-window="projecao"] #reports-projection .projection-report-shell {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 0 24px !important;
}
/* Remove as luzes verde-menta do antigo tema; preservar layout do pseudo. */
html[data-app-theme="dark"][data-report-window="projecao"] #reports-projection::before {
  inset: 0 !important;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(39, 122, 237, .09), transparent 41%),
    radial-gradient(ellipse at 85% 16%, rgba(44, 155, 244, .045), transparent 38%) !important;
}
html[data-app-theme="dark"][data-report-window="projecao"] #reports-projection::after {
  inset: 0 !important;
  opacity: .10;
  background-image:
    linear-gradient(rgba(118, 192, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118, 192, 255, .025) 1px, transparent 1px) !important;
}

/* Cards reais: Mes, Dias restantes e Fora da Projecao. */
html[data-app-theme="dark"] #reports-projection .projection-report-topbar {
  gap: 12px !important;
  margin-bottom: 14px !important;
  grid-template-columns: minmax(220px, .8fr) minmax(210px, .65fr) minmax(130px, .45fr) minmax(310px, 1.65fr);
}
html[data-app-theme="dark"] #reports-projection .projection-report-topbar:has(.projection-company-field.hidden) {
  grid-template-columns: minmax(235px, .93fr) minmax(148px, .45fr) minmax(330px, 1.72fr);
}
html[data-app-theme="dark"] #reports-projection :is(
  .projection-report-topbar > div,
  .projection-company-field,
  .projection-month-field
) {
  border: 1px solid rgba(99, 180, 247, .42) !important;
  border-radius: 17px !important;
  color: #eaf7ff !important;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(36, 126, 242, .18), transparent 72%),
    linear-gradient(143deg, #102b49, #091c34 83%) !important;
  box-shadow: 0 10px 26px rgba(1, 9, 28, .17), inset 0 1px 0 rgba(180, 230, 255, .09) !important;
  backdrop-filter: none !important;
}
html[data-app-theme="dark"] #reports-projection :is(
  .projection-report-topbar span,
  .projection-company-field > span,
  .projection-month-field > span
) {
  color: #a1c8e1 !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: .07em !important;
}
html[data-app-theme="dark"] #reports-projection .projection-month-trigger {
  border-radius: 16px !important;
  color: #f2faff !important;
}
html[data-app-theme="dark"] #reports-projection .projection-month-trigger:is(:hover, [aria-expanded="true"]) {
  background: linear-gradient(133deg, rgba(42, 123, 213, .25), rgba(8, 37, 71, .36)) !important;
  box-shadow: inset 0 0 0 1px rgba(107, 203, 255, .25) !important;
}
html[data-app-theme="dark"] #reports-projection .projection-month-trigger strong {
  color: #eff9ff !important;
  font-size: clamp(16px, 1.6vw, 19px) !important;
  letter-spacing: -.01em !important;
  font-weight: 800 !important;
}

/* Remove a barra/caret visual apos o mes, sem alterar o seletor nem a data. */
html[data-app-theme="dark"] #reports-projection #projection-month-trigger,
html[data-app-theme="dark"] #reports-projection #projection-month-label {
  caret-color: transparent !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}
html[data-app-theme="dark"] #reports-projection #projection-month-label::before,
html[data-app-theme="dark"] #reports-projection #projection-month-label::after {
  content: none !important;
  display: none !important;
}
html[data-app-theme="dark"] #reports-projection .projection-month-chevron {
  border-right-color: #93ddff !important;
  border-bottom-color: #93ddff !important;
}
html[data-app-theme="dark"] #reports-projection .projection-days-card strong {
  color: #78dafa !important;
  font-size: 29px !important;
  font-weight: 800 !important;
  text-shadow: 0 0 15px rgba(68, 182, 249, .13) !important;
}
html[data-app-theme="dark"] #reports-projection .projection-days-card small {
  color: #9bbbd0 !important;
  font-size: 10px !important;
}
html[data-app-theme="dark"] #reports-projection .projection-company-field select {
  border-color: rgba(97, 179, 247, .38) !important;
  border-radius: 9px !important;
  background: #0b2340 !important;
  color: #e8f6ff !important;
  font-size: 12px !important;
  color-scheme: dark;
}
html[data-app-theme="dark"] #reports-projection .projection-company-field select:focus-visible {
  border-color: #83dfff !important;
  box-shadow: 0 0 0 3px rgba(56, 150, 243, .13) !important;
}

/* Calendario / mes com foco e botoes azuis. */
html[data-app-theme="dark"] #reports-projection .projection-month-menu {
  border: 1px solid rgba(91, 181, 250, .46) !important;
  border-radius: 15px !important;
  background: linear-gradient(160deg, #112d4f, #081c33 90%) !important;
  box-shadow: 0 18px 50px rgba(0, 7, 28, .46), 0 0 22px rgba(46, 145, 242, .10) !important;
  backdrop-filter: none !important;
}
html[data-app-theme="dark"] #reports-projection .projection-month-menu-head strong {
  color: #f3faff !important;
  font-size: 12.5px !important;
}
html[data-app-theme="dark"] #reports-projection .projection-month-menu-head small {
  color: #9cbbd4 !important;
  font-size: 10px !important;
}
html[data-app-theme="dark"] #reports-projection .projection-year-control > strong {
  color: #eaf7ff !important;
  font-size: 12px !important;
}
html[data-app-theme="dark"] #reports-projection :is(.projection-year-control button, .projection-month-option) {
  border: 1px solid rgba(92, 167, 237, .36) !important;
  border-radius: 9px !important;
  background: rgba(16, 48, 85, .71) !important;
  color: #b7d9ef !important;
  font-size: 11px !important;
}
html[data-app-theme="dark"] #reports-projection :is(.projection-year-control button, .projection-month-option):is(:hover, :focus-visible) {
  border-color: rgba(116, 210, 255, .76) !important;
  color: #f3fbff !important;
  background: rgba(41, 120, 199, .35) !important;
}
html[data-app-theme="dark"] #reports-projection .projection-month-option.is-active {
  border-color: rgba(117, 219, 255, .84) !important;
  color: #92e3ff !important;
  background: linear-gradient(110deg, rgba(38, 131, 224, .44), rgba(20, 72, 135, .38)) !important;
}

/* Participantes fora da projecao: chips agora ciano/azul. */
html[data-app-theme="dark"] #reports-projection .projection-excluded-card {
  padding: 10px 13px !important;
}
html[data-app-theme="dark"] #reports-projection .projection-excluded-head span {
  color: #b0d8ef !important;
}
html[data-app-theme="dark"] #reports-projection .projection-excluded-head small,
html[data-app-theme="dark"] #reports-projection .projection-excluded-empty {
  color: #8fb2cc !important;
  font-size: 10px !important;
}
html[data-app-theme="dark"] #reports-projection .projection-excluded-head > strong {
  color: #9de4ff !important;
  font-size: 14px !important;
}
html[data-app-theme="dark"] #reports-projection .projection-excluded-list {
  scrollbar-color: rgba(80, 168, 241, .44) transparent;
}
html[data-app-theme="dark"] #reports-projection .projection-restore-chip {
  border: 1px solid rgba(102, 184, 247, .43) !important;
  border-radius: 999px !important;
  color: #b7e2f8 !important;
  background: linear-gradient(135deg, rgba(28, 96, 171, .29), rgba(13, 44, 84, .75)) !important;
  font-size: 10px !important;
  box-shadow: inset 0 1px 0 rgba(172, 225, 255, .06) !important;
}
html[data-app-theme="dark"] #reports-projection .projection-restore-chip b {
  color: #72d8ff !important;
}
html[data-app-theme="dark"] #reports-projection .projection-restore-chip:not(.is-readonly):hover {
  border-color: rgba(138, 227, 255, .74) !important;
  color: #f2fbff !important;
  background: rgba(42, 128, 210, .33) !important;
}
html[data-app-theme="dark"] #reports-projection .projection-restore-chip.is-readonly {
  opacity: .62;
}

/* Card da tabela: livrar do fundo musgo antigo, manter rolagem e sticky total. */
html[data-app-theme="dark"] #reports-projection .projection-table-card {
  position: relative;
  border: 1px solid rgba(92, 168, 237, .36) !important;
  border-radius: 18px !important;
  padding: 9px !important;
  background:
    radial-gradient(ellipse at 15% -10%, rgba(28, 116, 218, .12), transparent 55%),
    linear-gradient(162deg, #0b223d, #07192e 92%) !important;
  box-shadow: 0 13px 37px rgba(0, 7, 24, .17),
              inset 0 1px 0 rgba(180, 225, 255, .065) !important;
  backdrop-filter: none !important;
}
html[data-app-theme="dark"] #reports-projection .projection-table-card::before {
  border-color: rgba(84, 172, 245, .11) !important;
  background: none !important;
  box-shadow: none !important;
}
/* A lista cresce conforme o numero de consultores ate perto do rodape.
 * max-height (e nao height) evita uma area vazia quando ha poucas linhas.
 * Apos o limite, somente a tabela rola; o TOTAL sticky permanece visivel. */
html[data-app-theme="dark"] #reports-projection .projection-table-scroll {
  height: auto !important;
  max-height: calc(100dvh - 166px) !important;
  min-height: 0;
  overflow: auto !important;
  padding: 0 2px 5px !important;
  border-radius: 13px !important;
  scrollbar-color: rgba(75, 166, 240, .55) transparent;
}
html[data-app-theme="dark"] #reports-projection .projection-table-scroll::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
html[data-app-theme="dark"] #reports-projection .projection-table-scroll::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: rgba(74, 161, 239, .48);
}
html[data-app-theme="dark"] #reports-projection .projection-table-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(103, 205, 255, .7);
}
html[data-app-theme="dark"] #reports-projection .projection-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0 6px !important;
  font-variant-numeric: tabular-nums;
}
html[data-app-theme="dark"] #reports-projection .projection-table th {
  height: 40px !important;
  padding: 0 12px !important;
  border-top-color: rgba(104, 185, 247, .27) !important;
  border-bottom-color: rgba(104, 185, 247, .27) !important;
  color: #a7cbe3 !important;
  background: linear-gradient(180deg, #103253, #0c2947) !important;
  box-shadow: inset 0 1px 0 rgba(188, 234, 255, .09) !important;
  font-size: 10px !important;
  font-weight: 850 !important;
  letter-spacing: .025em !important;
}
html[data-app-theme="dark"] #reports-projection .projection-table th:first-child {
  min-width: 152px;
  border-left-color: rgba(104, 185, 247, .28) !important;
}
html[data-app-theme="dark"] #reports-projection .projection-table th:nth-child(2) {
  min-width: 133px;
}
html[data-app-theme="dark"] #reports-projection .projection-table th:nth-child(n+3):nth-child(-n+8) {
  min-width: 115px;
}
html[data-app-theme="dark"] #reports-projection .projection-table th:last-child {
  border-right-color: rgba(104, 185, 247, .28) !important;
}
html[data-app-theme="dark"] #reports-projection .projection-sort-button {
  min-height: 29px;
  color: #acd1e8 !important;
  background: transparent !important;
  font-size: 10px !important;
  font-weight: 850 !important;
  border-radius: 8px;
}
html[data-app-theme="dark"] #reports-projection .projection-sort-button:hover {
  color: #eaf9ff !important;
  background: rgba(44, 129, 216, .16) !important;
  box-shadow: inset 0 0 0 1px rgba(94, 191, 255, .10) !important;
}
html[data-app-theme="dark"] #reports-projection .projection-sort-button.is-active {
  color: #86deff !important;
}
html[data-app-theme="dark"] #reports-projection .projection-sort-button::after {
  color: #81b4d6 !important;
}
html[data-app-theme="dark"] #reports-projection .projection-sort-button.is-active::after {
  color: #81dcff !important;
}
html[data-app-theme="dark"] #reports-projection .projection-table tbody td {
  height: 49px !important;
  padding: 0 12px !important;
  border-top-color: rgba(78, 151, 217, .17) !important;
  border-bottom-color: rgba(78, 151, 217, .17) !important;
  background: linear-gradient(113deg, rgba(15, 44, 73, .96), rgba(9, 28, 49, .98)) !important;
  box-shadow: inset 0 1px 0 rgba(172, 221, 255, .038) !important;
  color: #e8f6ff !important;
  font-size: 11px !important;
  font-weight: 650 !important;
  white-space: nowrap;
}
html[data-app-theme="dark"] #reports-projection .projection-table tbody tr:nth-child(even) td {
  background: linear-gradient(113deg, rgba(19, 53, 85, .97), rgba(11, 35, 62, .98)) !important;
}
html[data-app-theme="dark"] #reports-projection .projection-table tbody tr:hover td {
  border-color: rgba(106, 198, 255, .42) !important;
  background: linear-gradient(115deg, rgba(32, 96, 160, .39), rgba(14, 46, 83, .96)) !important;
  box-shadow: inset 0 1px 0 rgba(165, 228, 255, .075) !important;
}
html[data-app-theme="dark"] #reports-projection .projection-table tbody tr:hover td:first-child {
  box-shadow: inset 2px 0 rgba(111, 216, 255, .6) !important;
}
/* As classes reais dos valores estao no td/span, nao em data-column. */
html[data-app-theme="dark"] #reports-projection .projection-table .is-money {
  font-weight: 780 !important;
}
html[data-app-theme="dark"] #reports-projection .projection-table .is-integrated {
  color: #b394ff !important; /* mantem identificacao do integrado */
  text-shadow: none !important;
}
html[data-app-theme="dark"] #reports-projection .projection-table .is-clean {
  color: #74dfff !important; /* substitui o antigo verde pela identidade ciano */
  text-shadow: none !important;
}
html[data-app-theme="dark"] #reports-projection .projection-table .is-dirty {
  color: #ff858e !important; /* preserva alerta de esteira suja */
  text-shadow: none !important;
}
html[data-app-theme="dark"] #reports-projection .projection-table .is-daily {
  color: #83c8ff !important;
  text-shadow: none !important;
}
html[data-app-theme="dark"] #reports-projection .projection-table .is-projecting {
  color: #ebf8ff !important;
}
html[data-app-theme="dark"] #reports-projection .projection-goal-display {
  color: #f2faff !important;
  font-size: 11px !important;
}
html[data-app-theme="dark"] #reports-projection .projection-goal-display.is-editable:hover {
  background: rgba(48, 133, 212, .16) !important;
  box-shadow: inset 0 0 0 1px rgba(89, 192, 255, .28) !important;
}
html[data-app-theme="dark"] #reports-projection .projection-goal-input {
  border-color: rgba(107, 196, 251, .49) !important;
  color: #f2faff !important;
  background: #0d2a4b !important;
  box-shadow: inset 0 1px 0 rgba(204, 239, 255, .09) !important;
  font-size: 11px !important;
}
html[data-app-theme="dark"] #reports-projection .projection-goal-input:focus {
  border-color: #86dfff !important;
  box-shadow: 0 0 0 3px rgba(52, 163, 250, .14) !important;
}
/* Remocao de participante e acao potencialmente destrutiva; manter vermelho. */
html[data-app-theme="dark"] #reports-projection .projection-remove-button {
  border-color: rgba(239, 125, 136, .34) !important;
  background: rgba(110, 38, 52, .17) !important;
}
html[data-app-theme="dark"] #reports-projection .projection-remove-button:hover {
  color: #ffa8ad !important;
  border-color: rgba(250, 148, 157, .68) !important;
  background: rgba(142, 53, 68, .24) !important;
}

/* TOTAL: faixa bronze/ambar premium, contrastando com as linhas azuis.
 * Preserva o footer sticky, os valores, as classes semanticas e os cantos. */
html[data-app-theme="dark"] #reports-projection .projection-table tfoot td {
  height: 53px !important;
  border-top: 1px solid rgba(252, 205, 116, .82) !important;
  border-bottom: 1px solid rgba(220, 158, 81, .42) !important;
  background: linear-gradient(110deg, #3a291b, #302319 54%, #291f1a) !important;
  box-shadow: 0 -6px 24px rgba(151, 93, 35, .13), inset 0 1px 0 rgba(255, 231, 181, .17) !important;
  color: #fff0d5 !important;
  font-size: 11.3px !important;
  font-weight: 850 !important;
}
html[data-app-theme="dark"] #reports-projection .projection-table tfoot td:first-child {
  border-left: 1px solid rgba(245, 189, 98, .57) !important;
  box-shadow: inset 3px 0 0 rgba(255, 204, 112, .9), inset 0 1px 0 rgba(255, 231, 181, .17) !important;
  color: #ffe3a8 !important;
  letter-spacing: .045em !important;
}
html[data-app-theme="dark"] #reports-projection .projection-table tfoot td:last-child {
  border-right: 1px solid rgba(245, 189, 98, .57) !important;
}
/* Destaques numericos exclusivos do TOTAL; as demais linhas nao mudam. */
html[data-app-theme="dark"] #reports-projection .projection-table tfoot td:nth-child(2),
html[data-app-theme="dark"] #reports-projection .projection-table tfoot td:nth-child(6),
html[data-app-theme="dark"] #reports-projection .projection-table tfoot td.is-projecting {
  color: #ffe2a5 !important;
}
html[data-app-theme="dark"] #reports-projection .projection-table tfoot td.is-integrated {
  color: #dabaff !important;
}
html[data-app-theme="dark"] #reports-projection .projection-table tfoot td.is-clean {
  color: #b6eaff !important;
}
html[data-app-theme="dark"] #reports-projection .projection-table tfoot td.is-dirty {
  color: #ff9ca6 !important;
}
html[data-app-theme="dark"] #reports-projection .projection-table tfoot td.is-daily {
  color: #ffd18c !important;
}
html[data-app-theme="dark"] #reports-projection .projection-empty {
  color: #aac9de !important;
  background: rgba(13, 44, 77, .81) !important;
  font-size: 12px !important;
}
@media (max-width: 1180px) {
  html[data-app-theme="dark"] #reports-projection .projection-report-topbar,
  html[data-app-theme="dark"] #reports-projection .projection-report-topbar:has(.projection-company-field.hidden) {
    grid-template-columns: minmax(0, 1fr) 170px !important;
  }
  html[data-app-theme="dark"] #reports-projection .projection-excluded-card,
  html[data-app-theme="dark"] #reports-projection .projection-company-field {
    grid-column: 1 / -1;
  }
}
@media (max-width: 700px) {
  html[data-app-theme="dark"][data-report-window="projecao"] #section-reports.reports-launcher {
    padding: 8px 9px 20px !important;
  }
  html[data-app-theme="dark"] #reports-projection .projection-report-topbar,
  html[data-app-theme="dark"] #reports-projection .projection-report-topbar:has(.projection-company-field.hidden) {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  html[data-app-theme="dark"] #reports-projection .projection-excluded-card,
  html[data-app-theme="dark"] #reports-projection .projection-company-field {
    grid-column: auto;
  }
  html[data-app-theme="dark"] #reports-projection .projection-table {
    min-width: 1120px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html[data-app-theme="dark"] #reports-projection :is(.projection-month-trigger, .projection-goal-display, .projection-table td) {
    transition: none !important;
  }
}

/* Topo aumenta de altura em telas estreitas; reduzir o limite
 * preserva uma folga na parte inferior sem travar a lista. */
@media (max-width: 1180px) {
  html[data-app-theme="dark"] #reports-projection .projection-table-scroll {
    max-height: calc(100dvh - 245px) !important;
  }
}
@media (max-width: 700px) {
  html[data-app-theme="dark"] #reports-projection .projection-table-scroll {
    max-height: calc(100dvh - 270px) !important;
  }
}
