/*
 * Prospecta Corban | Indicadores Financeiros v308
 * Exclusivo do relatório Indicadores — sem alterar cálculos, tabelas ou outros relatórios.
 * Corrige continuidade de fundo/viewport nas janelas independentes e no Master.
 */

/* Um único fundo atravessa o viewport inteiro (não só a coluna esquerda).
   Os seletores de janela são mais específicos que os legados do relatório. */
html[data-report-window="indicadores"],
html[data-report-window="indicadores"] body,
html[data-report-window="indicadores"] #app-view,
html[data-report-window="indicadores"] .app-view .main {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 100vh !important;
  background: #071629 !important;
}
html[data-report-window="indicadores"] #app-view {
  display: block !important;
  max-width: none !important;
}
html[data-report-window="indicadores"] .app-view .main {
  max-width: none !important;
  margin: 0 !important;
  overflow-x: clip !important;
  background:
    radial-gradient(ellipse 65% 48% at 7% -13%, rgba(28,99,169,.18), transparent 80%),
    radial-gradient(ellipse 45% 38% at 98% 6%, rgba(28,70,140,.12), transparent 82%),
    linear-gradient(160deg,#071629 0%,#08182d 50%,#071527 100%) !important;
}

/* Fora da janela independente, a mesma superfície premium só ativa quando
   Indicadores está realmente aberto. Os outros relatórios ficam intocados. */
#section-reports.reports-launcher:has(> #reports-indicators:not(.hidden)) {
  min-width: 0 !important;
  background:
    radial-gradient(ellipse 65% 45% at 6% -12%, rgba(35,111,184,.17), transparent 80%),
    linear-gradient(160deg,#071629 0%,#08182d 50%,#071527 100%) !important;
}
html[data-report-window="indicadores"] #section-reports.reports-launcher {
  display:block !important;
  width:100% !important;
  max-width:none !important;
  min-width:0 !important;
  box-sizing:border-box !important;
  min-height:100vh !important;
  margin:0 !important;
  padding:0 24px 64px !important;
  background:transparent !important;
}

#reports-indicators.master-indicator-workspace {
  --ind-ink:#ecf6ff;
  --ind-muted:#a0bdd8;
  --ind-line:rgba(98,158,218,.23);
  --ind-panel:rgba(12,35,61,.96);
  --ind-surface:rgba(17,46,77,.87);
  --ind-accent:#61c4ff;
  display:block;
  width:100% !important;
  min-width:0 !important;
  max-width:none !important;
  box-sizing:border-box;
  position:relative;
  color:var(--ind-ink);
  isolation:isolate;
}
#reports-indicators.master-indicator-workspace.hidden { display:none !important; }
#reports-indicators .master-indicator-shell {
  width: min(100%, 1560px) !important;
  max-width: 1560px !important;
  min-width:0 !important;
  box-sizing:border-box;
  margin:0 auto !important;
  padding:34px 0 72px !important;
}

/* Cabeçalho executivo com hierarquia mais nítida, sem cards decorativos. */
#reports-indicators .master-indicator-head {
  position:relative;
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:18px 26px;
  margin:0 0 24px !important;
  padding:4px 0 22px;
  border-bottom:1px solid var(--ind-line);
}
#reports-indicators .master-indicator-head::after {
  position:absolute;
  content:"";
  bottom:-1px;
  left:0;
  width:clamp(60px,12vw,155px);
  height:2px;
  background:linear-gradient(90deg,#3fb9ff,rgba(64,194,255,0));
  box-shadow:0 0 12px rgba(59,176,255,.3);
}
#reports-indicators .master-indicator-head > div:first-child { min-width:min(100%,350px);flex:1 1 470px; }
#reports-indicators .master-indicator-head small {
  display:inline-flex;
  align-items:center;
  gap:9px;
  font-size:10px !important;
  font-weight:830;
  letter-spacing:.17em;
  color:#79cffa;
}
#reports-indicators .master-indicator-head small::before {
  content:"";
  display:inline-block;
  width:7px;height:7px;border-radius:50%;
  background:#50c9ff;
  box-shadow:0 0 10px rgba(54,192,255,.6);
}
#reports-indicators .master-indicator-head h2 {
  color:var(--ind-ink);
  font-size:clamp(27px,2.7vw,37px) !important;
  letter-spacing:-.055em;
  font-weight:850;
  line-height:1.1;
  margin:8px 0 0 !important;
}
#reports-indicators .master-indicator-head p {
  max-width:720px;
  font-size:12px !important;
  line-height:1.65;
  color:var(--ind-muted);
  margin:10px 0 0 !important;
}
#reports-indicators .master-indicator-controls {
  gap:11px;
  align-items:center;
  flex-wrap:wrap;
}
#reports-indicators .master-indicator-month-field,
#reports-indicators .master-indicator-filter {
  border:1px solid rgba(100,173,240,.35);
  border-radius:13px;
  background:linear-gradient(140deg,rgba(20,56,91,.94),rgba(10,33,59,.95));
  box-shadow:inset 0 1px 0 rgba(146,209,255,.07);
}
#reports-indicators .master-indicator-filter > span {
  font-size:10px;letter-spacing:.11em;color:#a6c6e2;
}
#reports-indicators .master-indicator-filter select {
  border-color:rgba(115,177,235,.27);
  background:#102b49;
  color:#edf7ff;
}
#reports-indicators .master-indicator-refresh {
  min-height:49px;
  border:1px solid rgba(76,173,253,.48);
  border-radius:12px;
  padding:0 20px;
  background:linear-gradient(115deg,rgba(18,88,154,.86),rgba(15,115,201,.86));
  box-shadow:inset 0 1px 0 rgba(198,237,255,.12),0 8px 20px rgba(6,40,96,.14);
  color:#f4faff;
  transition:transform .18s ease,box-shadow .18s ease,filter .18s ease;
}
#reports-indicators .master-indicator-refresh:hover {
  filter:brightness(1.13);
  transform:translateY(-1px);
  box-shadow:0 11px 25px rgba(13,100,195,.23);
}

/* Métricas: quatro cards iguais, valores evidentes e detalhes discretos. */
#reports-indicators .master-indicator-metrics {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin:0 0 23px !important;
}
#reports-indicators .master-indicator-metric {
  --ind-card-accent:#65bcff;
  --ind-card-glow:rgba(63,140,231,.10);
  position:relative;
  overflow:hidden;
  isolation:isolate;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  min-width:0;
  min-height:140px;
  padding:23px 22px 21px;
  border:1px solid rgba(91,166,236,.30);
  border-radius:19px;
  background:
    radial-gradient(ellipse 130% 135% at 100% 0%,var(--ind-card-glow),transparent 67%),
    linear-gradient(145deg,rgba(23,59,94,.92),rgba(10,31,55,.95));
  box-shadow:0 12px 33px rgba(0,12,33,.17),inset 0 1px rgba(164,215,255,.075);
  transition:transform .21s ease,border-color .21s ease,box-shadow .21s ease;
}
#reports-indicators .master-indicator-metric:nth-child(2){
  --ind-card-accent:#6fe0f4;
  --ind-card-glow:rgba(17,172,209,.12);
}
#reports-indicators .master-indicator-metric:nth-child(3){
  --ind-card-accent:#9eadff;
  --ind-card-glow:rgba(104,99,224,.11);
}
#reports-indicators .master-indicator-metric:nth-child(4){
  --ind-card-accent:#ffcf92;
  --ind-card-glow:rgba(192,139,59,.10);
}
#reports-indicators .master-indicator-metric::before {
  content:"";
  position:absolute;top:0;left:18px;right:45%;height:2px;
  background:linear-gradient(90deg,var(--ind-card-accent),transparent);
  box-shadow:0 0 12px var(--ind-card-glow);
}
#reports-indicators .master-indicator-metric::after {
  content:"";
  position:absolute;
  width:120px;height:120px;right:-71px;top:-79px;
  transform:rotate(-25deg);
  border:1px solid rgba(137,199,248,.13);
  border-radius:27px;
  pointer-events:none;
}
#reports-indicators .master-indicator-metric:hover {
  transform:translateY(-3px);
  border-color:rgba(103,189,254,.51);
  box-shadow:0 17px 39px rgba(0,14,40,.27),0 0 28px var(--ind-card-glow);
}
#reports-indicators .master-indicator-metric span {
  font-size:10px !important;
  letter-spacing:.14em;
  text-transform:uppercase;
  font-weight:850;
  color:#b0c9de;
}
#reports-indicators .master-indicator-metric strong {
  display:block;
  max-width:100%;
  overflow-wrap:anywhere;
  font-size:clamp(20px,2vw,28px) !important;
  letter-spacing:-.045em;
  line-height:1.18;
  font-weight:890;
  color:var(--ind-ink);
  font-variant-numeric:tabular-nums;
  margin:9px 0 7px;
}
#reports-indicators .master-indicator-metric small {
  color:var(--ind-muted);
  font-size:11px !important;
  line-height:1.4;
  font-weight:550;
}

/* Segmented control limpo, com borda e indicador de seleção azul. */
#reports-indicators .master-indicator-tabs {
  display:inline-flex;
  flex-wrap:wrap;
  align-items:center;
  gap:5px;
  width:auto;
  max-width:100%;
  margin:0 0 17px !important;
  padding:6px;
  border:1px solid rgba(98,166,232,.27);
  border-radius:15px;
  background:linear-gradient(135deg,rgba(18,51,83,.94),rgba(10,30,54,.96));
  box-shadow:inset 0 1px 0 rgba(184,225,255,.065),0 8px 20px rgba(0,13,31,.10);
}
#reports-indicators .master-indicator-tabs button {
  position:relative;
  min-height:40px;
  padding:0 18px;
  border:1px solid transparent;
  border-radius:10px;
  color:#a5c0da;
  background:transparent;
  font-size:11px !important;
  font-weight:800;
  transition:background .17s ease,color .17s ease,box-shadow .17s ease,transform .17s ease;
}
#reports-indicators .master-indicator-tabs button:hover {
  color:#edfaff;
  background:rgba(44,127,200,.19);
}
#reports-indicators .master-indicator-tabs button.is-active {
  color:#eefbff;
  background:linear-gradient(135deg,rgba(23,106,177,.92),rgba(26,142,217,.66));
  border-color:rgba(105,199,255,.47);
  box-shadow:inset 0 1px 0 rgba(204,245,255,.18),0 5px 15px rgba(20,105,194,.19);
}

/* Tabelas financeiras: cabeçalho navy (não esverdeado), scroll interno,
   números alinhados e hover sutil sem tocar no DOM nem nos dados. */
#reports-indicators #master-indicator-content {min-width:0;max-width:100%;}
#reports-indicators .master-indicator-panel {
  min-width:0;
  width:100%;
  box-sizing:border-box;
  overflow:hidden;
  border:1px solid rgba(91,154,215,.28);
  border-radius:19px;
  background:linear-gradient(155deg,rgba(15,39,66,.97),rgba(9,28,51,.98));
  box-shadow:0 13px 34px rgba(0,13,34,.18),inset 0 1px 0 rgba(165,218,255,.055);
}
#reports-indicators .master-indicator-panel-head {
  position:relative;
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px;
  padding:19px 22px 18px;
  border-bottom:1px solid rgba(92,160,220,.22);
  background:linear-gradient(110deg,rgba(22,60,100,.68),rgba(10,35,64,.40));
}
#reports-indicators .master-indicator-panel-head::before {
  content:"";
  position:absolute;
  left:0;top:16px;bottom:16px;width:2px;
  border-radius:3px;
  background:linear-gradient(#42c6ff,#326fca);
  box-shadow:0 0 8px rgba(44,146,255,.30);
}
#reports-indicators .master-indicator-panel-head strong {
  display:block;
  font-size:14px !important;
  font-weight:850;
  letter-spacing:-.015em;
  color:#f1f8ff;
}
#reports-indicators .master-indicator-panel-head small {
  display:block;
  margin-top:4px;
  font-size:10px !important;
  line-height:1.45;
  color:#a1bfd8;
}
#reports-indicators .master-indicator-table-scroll {
  overflow-x:auto;
  overflow-y:hidden;
  max-width:100%;
  scrollbar-width:thin;
  scrollbar-color:rgba(65,143,216,.55) rgba(8,26,49,.75);
}
#reports-indicators .master-indicator-table {
  width:100%;
  min-width:880px;
  border-spacing:0;
  border-collapse:separate;
  table-layout:auto;
}
#reports-indicators .master-indicator-table th {
  position:relative;
  padding:14px 17px !important;
  background:#0a2239 !important;
  color:#8eafc9 !important;
  font-size:10px !important;
  letter-spacing:.075em;
  border-bottom:1px solid rgba(95,168,230,.27);
}
#reports-indicators .master-indicator-table td {
  background:transparent;
  padding:15px 17px !important;
  border-bottom:1px solid rgba(83,138,191,.15);
  font-size:11px !important;
  line-height:1.45;
  color:#d5e5f5;
  font-variant-numeric:tabular-nums;
}
#reports-indicators .master-indicator-table tbody tr {
  transition:background .15s ease;
}
#reports-indicators .master-indicator-table tbody tr:nth-child(even) {
  background:rgba(39,86,131,.075);
}
#reports-indicators .master-indicator-table tbody tr:hover {
  background:rgba(42,123,197,.15);
}
#reports-indicators .master-indicator-table tbody tr:hover td {
  border-bottom-color:rgba(85,173,246,.30);
}
#reports-indicators .master-indicator-table td:first-child strong {
  font-weight:800;
  color:#edf7ff;
}
#reports-indicators .master-indicator-table td.is-money,
#reports-indicators .master-indicator-table td.is-number,
#reports-indicators .master-indicator-table th.is-money,
#reports-indicators .master-indicator-table th.is-number {
  text-align:right;
}
#reports-indicators .master-indicator-table td.is-positive {
  color:#7bd6ee !important;
  font-weight:800;
}
#reports-indicators .master-indicator-history {
  margin-top:16px;
}
#reports-indicators .master-indicator-rank {
  border-color:rgba(105,176,232,.35);
  background:rgba(29,89,152,.20);
  color:#8ad9ff;
}
#reports-indicators .master-indicator-empty,
#reports-indicators .master-indicator-loading {
  min-height:200px;
  color:#a5c1db;
  background:rgba(9,30,55,.60);
  font-size:12px !important;
}

/* Modo claro igualmente financeiro, sem quadrados escuros isolados. */
html[data-app-theme="light"][data-report-window="indicadores"],
html[data-app-theme="light"][data-report-window="indicadores"] body,
html[data-app-theme="light"][data-report-window="indicadores"] #app-view,
html[data-app-theme="light"][data-report-window="indicadores"] .app-view .main {
  background:linear-gradient(145deg,#edf5ff 0%,#f7fbff 52%,#eaf3fc 100%) !important;
}
html[data-app-theme="light"] #section-reports.reports-launcher:has(> #reports-indicators:not(.hidden)) {
  background:linear-gradient(145deg,#edf5ff 0%,#f7fbff 52%,#eaf3fc 100%) !important;
}
html[data-app-theme="light"] #reports-indicators {
  --ind-ink:#183651;
  --ind-muted:#526f88;
  --ind-line:rgba(75,138,196,.22);
  color:var(--ind-ink);
}
html[data-app-theme="light"] #reports-indicators .master-indicator-head small {color:#226ba4}
html[data-app-theme="light"] #reports-indicators .master-indicator-head h2 {color:#142f4a}
html[data-app-theme="light"] #reports-indicators .master-indicator-metric,
html[data-app-theme="light"] #reports-indicators .master-indicator-panel {
  background:linear-gradient(148deg,#fff,#f0f7ff);
  border-color:rgba(106,164,217,.37);
  box-shadow:0 12px 28px rgba(47,94,141,.08),inset 0 1px 0 #fff;
}
html[data-app-theme="light"] #reports-indicators .master-indicator-metric span{color:#50718e}
html[data-app-theme="light"] #reports-indicators .master-indicator-metric strong{color:#173752}
html[data-app-theme="light"] #reports-indicators .master-indicator-metric small{color:#5c7590}
html[data-app-theme="light"] #reports-indicators .master-indicator-tabs,
html[data-app-theme="light"] #reports-indicators .master-indicator-filter,
html[data-app-theme="light"] #reports-indicators .master-indicator-month-field {
  background:linear-gradient(140deg,#fff,#eaf4ff);
  border-color:#b9d5ed;
}
html[data-app-theme="light"] #reports-indicators .master-indicator-tabs button {color:#4d6e8c}
html[data-app-theme="light"] #reports-indicators .master-indicator-tabs button.is-active {color:#fff}
html[data-app-theme="light"] #reports-indicators .master-indicator-panel-head {
  background:linear-gradient(125deg,#eef6ff,#e7f1fc);
  border-bottom-color:#c9deef;
}
html[data-app-theme="light"] #reports-indicators .master-indicator-panel-head strong{color:#183c5b}
html[data-app-theme="light"] #reports-indicators .master-indicator-panel-head small{color:#55718c}
html[data-app-theme="light"] #reports-indicators .master-indicator-table th {
  background:#e4f0fa !important;color:#52718b !important;border-bottom-color:#cbdce9;
}
html[data-app-theme="light"] #reports-indicators .master-indicator-table td {
  color:#284660;border-bottom-color:#dce9f3;
}
html[data-app-theme="light"] #reports-indicators .master-indicator-table td:first-child strong {color:#173e60}
html[data-app-theme="light"] #reports-indicators .master-indicator-table td.is-positive {color:#176a93 !important}
html[data-app-theme="light"] #reports-indicators .master-indicator-table tbody tr:nth-child(even) {background:rgba(157,195,230,.075)}
html[data-app-theme="light"] #reports-indicators .master-indicator-table tbody tr:hover {background:rgba(100,171,229,.16)}
html[data-app-theme="light"] #reports-indicators .master-indicator-empty,
html[data-app-theme="light"] #reports-indicators .master-indicator-loading {background:#f1f8ff;color:#526f8b}
html[data-app-theme="light"] #reports-indicators .master-indicator-filter select {
  background:#f9fcff;color:#234a69;border-color:#c5ddec;
}

/* Ajuste responsivo: nada pode cortar colunas ou gerar fundo de meia tela. */
@media(max-width:1280px) {
  #reports-indicators .master-indicator-metrics {grid-template-columns:repeat(2,minmax(0,1fr));}
  #reports-indicators .master-indicator-metric {min-height:126px;}
}
@media(max-width:760px) {
  html[data-report-window="indicadores"] #section-reports.reports-launcher {padding:0 12px 32px !important;}
  #reports-indicators .master-indicator-shell {padding:22px 0 42px !important;}
  #reports-indicators .master-indicator-head {align-items:stretch;flex-direction:column;gap:16px;}
  #reports-indicators .master-indicator-controls {width:100%;}
  #reports-indicators .master-indicator-metric {padding:19px;}
  #reports-indicators .master-indicator-panel-head {padding:16px;}
  #reports-indicators .master-indicator-table td {padding:12px 13px !important;}
  #reports-indicators .master-indicator-table th {padding:12px 13px !important;}
}
@media(max-width:520px) {
  #reports-indicators .master-indicator-metrics {grid-template-columns:1fr;gap:10px;}
  #reports-indicators .master-indicator-metric {min-height:112px;}
  #reports-indicators .master-indicator-tabs {display:flex;width:100%;box-sizing:border-box;}
  #reports-indicators .master-indicator-tabs button {flex:1;min-width:0;padding:0 7px;font-size:10px !important;}
}
@media(prefers-reduced-motion:reduce){
  #reports-indicators .master-indicator-metric,
  #reports-indicators .master-indicator-tabs button,
  #reports-indicators .master-indicator-refresh {transition:none;}
}


/* Compacto: sem título/subtítulo; filtros no topo e métricas logo abaixo. */
#reports-indicators .master-indicator-shell {
  padding-top: 18px !important;
}
#reports-indicators .master-indicator-head.master-indicator-head--compact {
  justify-content: flex-end !important;
  align-items: center !important;
  margin: 0 0 16px !important;
  padding: 0 !important;
  min-height: 49px;
  border-bottom: 0 !important;
}
#reports-indicators .master-indicator-head.master-indicator-head--compact::after {
  display: none !important;
}
#reports-indicators .master-indicator-head--compact .master-indicator-controls {
  margin-left: auto;
}
@media (max-width: 760px) {
  #reports-indicators .master-indicator-head.master-indicator-head--compact {
    flex-direction: row !important;
    justify-content: flex-end !important;
  }
  #reports-indicators .master-indicator-head--compact .master-indicator-controls {
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}


/* Barra única de filtros: visões à esquerda, período e atualização à direita. */
#reports-indicators .master-indicator-head.master-indicator-head--filterbar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px 20px !important;
  min-height: 52px;
  margin-bottom: 17px !important;
  overflow: visible;
}
#reports-indicators .master-indicator-head--filterbar > .master-indicator-tabs {
  justify-self: start;
  align-self: center;
  flex-shrink: 0;
  margin: 0 !important;
  width: max-content;
  max-width: 100%;
}
#reports-indicators .master-indicator-head--filterbar > .master-indicator-controls {
  justify-self: end;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  width: auto !important;
  min-width: 0;
  margin: 0 !important;
}
#reports-indicators .master-indicator-head--filterbar .master-indicator-month-field {
  flex-shrink: 0;
}
#reports-indicators .master-indicator-head--filterbar .master-indicator-refresh {
  flex-shrink: 0;
}
@media (max-width: 1040px) {
  #reports-indicators .master-indicator-head.master-indicator-head--filterbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px !important;
  }
  #reports-indicators .master-indicator-head--filterbar > .master-indicator-controls {
    justify-self: end;
  }
}
@media (max-width: 600px) {
  #reports-indicators .master-indicator-head--filterbar > .master-indicator-tabs {
    display: flex;
    width: 100%;
    box-sizing: border-box;
  }
  #reports-indicators .master-indicator-head--filterbar > .master-indicator-controls {
    width: 100% !important;
    justify-content: flex-end;
  }
}
