/*
 * PROSPECTA CORBAN V294 — RELATORIO DETALHADO
 * Reestilizacao visual do relatorio somente no tema escuro.
 * Mantem filtros, selecao de periodo, datas, dados, calculos e permissoes.
 * Carregado depois dos estilos legados embutidos no index.html.
 */
html[data-app-theme="dark"] #reports-detailed {
  --detailed-v294-blue: #6ed3ff;
  --detailed-v294-ink: #eaf7ff;
  --detailed-v294-muted: #9ebed5;
  --detailed-v294-border: rgba(85, 167, 243, .32);
  color: var(--detailed-v294-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12.5px;
}
html[data-app-theme="dark"] #reports-detailed .detailed-report-shell {
  padding-top: 18px;
  padding-bottom: 36px;
}
/* Filtros: painel navy com bordas e profundidade ciano. */
html[data-app-theme="dark"] #reports-detailed .detailed-filter-panel {
  border: 1px solid rgba(96, 178, 246, .39) !important;
  border-radius: 17px !important;
  background:
    radial-gradient(ellipse 68% 105% at 12% 0%, rgba(40, 124, 242, .145), transparent 84%),
    linear-gradient(146deg, #0e2743, #091b32 58%, #08182e) !important;
  box-shadow: 0 15px 42px rgba(0, 6, 23, .20),
              inset 0 1px 0 rgba(180, 232, 255, .085) !important;
}
html[data-app-theme="dark"] #reports-detailed :is(
  .detailed-period-field > span,
  .detailed-basis-field > span,
  .detailed-field > span,
  .detailed-multi summary > span
) {
  color: #9dc6e1 !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: .065em !important;
}
html[data-app-theme="dark"] #reports-detailed :is(
  .detailed-period-control, .detailed-field input, .detailed-field select,
  .detailed-multi summary
) {
  height: 43px !important;
  border: 1px solid rgba(92, 166, 229, .38) !important;
  border-radius: 10px !important;
  color: #edf8ff !important;
  background: linear-gradient(180deg, #102943, #0b2038) !important;
  box-shadow: inset 0 1px 0 rgba(183, 230, 255, .045) !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  color-scheme: dark;
}
html[data-app-theme="dark"] #reports-detailed :is(
  .detailed-period-control, .detailed-field input, .detailed-field select,
  .detailed-multi summary
):is(:hover, :focus-visible) {
  border-color: rgba(128, 217, 255, .73) !important;
  background: linear-gradient(180deg, #153450, #0c2440) !important;
  box-shadow: 0 0 0 3px rgba(52, 159, 249, .095) !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-field select option {
  color: #eaf7ff;
  background: #102943;
}
html[data-app-theme="dark"] #reports-detailed .detailed-multi summary > span {
  font-size: 9px !important;
  color: #9bc0dc !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-multi summary > strong {
  color: #eef9ff !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-period-control svg {
  color: #8dd7ff !important;
}

/* Segmentacao Data Venda / CIP / Alteracao — todos azuis. */
html[data-app-theme="dark"] #reports-detailed .detailed-basis-control {
  border: 1px solid rgba(88, 164, 236, .32) !important;
  border-radius: 11px !important;
  background: rgba(6, 22, 42, .90) !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-basis-control label strong {
  color: #b6d0e3 !important;
  background: transparent;
  font-size: 11px !important;
  font-weight: 750 !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-basis-control label:hover strong {
  color: #eaf8ff !important;
  background: rgba(35, 111, 184, .16);
}
html[data-app-theme="dark"] #reports-detailed .detailed-basis-control input:checked + strong {
  color: #8cdeff !important;
  background: linear-gradient(100deg, rgba(36, 132, 217, .30), rgba(37, 154, 247, .15)) !important;
  box-shadow: inset 0 0 0 1px rgba(90, 198, 255, .49), 0 0 15px rgba(44, 152, 243, .11) !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-basis-control input:focus-visible + strong {
  outline: 2px solid #91dcff;
  outline-offset: 2px;
}

/* Menus do periodo e multi-selecao: sem fundo verde. */
html[data-app-theme="dark"] #reports-detailed :is(.detailed-period-menu, .detailed-multi-menu) {
  border: 1px solid rgba(95, 185, 252, .43) !important;
  border-radius: 13px !important;
  color: #e5f5ff !important;
  background: linear-gradient(158deg, #102c4b, #081b33 75%) !important;
  box-shadow: 0 20px 54px rgba(0, 5, 23, .49), 0 0 22px rgba(43, 147, 250, .10) !important;
  scrollbar-color: rgba(94, 181, 240, .48) transparent;
}
html[data-app-theme="dark"] #reports-detailed .detailed-period-menu-head strong {
  color: #f2f9ff !important;
  font-size: 13px !important;
}
html[data-app-theme="dark"] #reports-detailed :is(
  .detailed-period-menu-head small,
  .detailed-multi-head,
  .detailed-option small
) {
  color: #a1bfd4 !important;
  font-size: 10px !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-multi-head button {
  color: #89d7ff !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-multi-head button:hover {
  color: #c5f0ff !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-option {
  border: 1px solid transparent;
  color: #dbeeff !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-option:hover {
  border-color: rgba(100, 190, 247, .19) !important;
  background: rgba(45, 130, 217, .19) !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-option input {
  accent-color: #60c9ff !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-option strong {
  color: #edf7ff !important;
  font-size: 11px !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-period-presets button {
  border-color: rgba(91, 167, 239, .30) !important;
  color: #c2dcf2 !important;
  background: rgba(19, 54, 92, .59) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-period-presets button:is(:hover, .is-active) {
  border-color: rgba(103, 210, 255, .66) !important;
  color: #b8ecff !important;
  background: rgba(34, 128, 221, .29) !important;
  box-shadow: inset 0 1px 0 rgba(184, 235, 255, .09) !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-period-custom {
  border-top-color: rgba(83, 171, 242, .25) !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-period-custom label span {
  color: #a4c4dc !important;
  font-size: 10px !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-period-custom input {
  border-color: rgba(103, 182, 238, .35) !important;
  color: #eaf8ff !important;
  background: #0c2744 !important;
  font-size: 11px !important;
  color-scheme: dark;
}
html[data-app-theme="dark"] #reports-detailed .detailed-period-custom input:focus-visible {
  border-color: #81dcff !important;
  box-shadow: 0 0 0 3px rgba(51, 150, 249, .12) !important;
}

/* Botoes principais: azul brilhante, brilho sem alterar layout ou eventos. */
html[data-app-theme="dark"] #reports-detailed :is(.detailed-apply, .detailed-reset) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: 43px !important;
  border-radius: 10px !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-apply:not(:disabled) {
  border: 1px solid rgba(159, 232, 255, .75) !important;
  color: #06213d !important;
  background: linear-gradient(110deg, #4097f6, #71d0ff 64%, #a6efff) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.32), 0 6px 20px rgba(41, 150, 243, .17) !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-apply:not(:disabled):hover {
  border-color: #c3f1ff !important;
  background: linear-gradient(110deg, #67b5ff, #a0e8ff) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.37), 0 0 23px rgba(53, 175, 248, .23) !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-reset {
  border: 1px solid rgba(94, 171, 230, .36) !important;
  color: #b9d9ee !important;
  background: linear-gradient(140deg, rgba(29, 75, 123, .35), rgba(8, 27, 50, .95)) !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-reset:hover {
  border-color: rgba(125, 213, 255, .74) !important;
  color: #f0faff !important;
  background: rgba(42, 128, 203, .25) !important;
}
html[data-app-theme="dark"] #reports-detailed :is(.detailed-apply, .detailed-reset):not(:disabled)::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 2;
  left: -65%;
  top: -70%;
  width: 37%;
  height: 240%;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(239, 251, 255, .34), transparent);
  transform: translate3d(0,0,0) skewX(-21deg);
  transition: transform .58s ease, opacity .13s ease;
}
html[data-app-theme="dark"] #reports-detailed :is(.detailed-apply, .detailed-reset):not(:disabled):is(:hover,:focus-visible)::after {
  opacity: 1;
  transform: translate3d(500%,0,0) skewX(-21deg);
}
html[data-app-theme="dark"] #reports-detailed :is(.detailed-apply, .detailed-reset):disabled {
  opacity: .52;
  cursor: not-allowed;
}

/* Cards de resumo em glass navy. Valores monetarios com destaque ciano. */
html[data-app-theme="dark"] #reports-detailed .detailed-summary {
  gap: 11px !important;
  margin: 13px 0 !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-summary article {
  min-height: 90px !important;
  border: 1px solid rgba(86, 168, 236, .33) !important;
  border-radius: 15px !important;
  background: radial-gradient(ellipse at 2% 0%, rgba(37, 128, 242, .12), transparent 83%),
              linear-gradient(155deg, #102841, #0a1d34) !important;
  box-shadow: inset 0 1px 0 rgba(190, 235, 255, .075), 0 10px 25px rgba(3, 11, 33, .15) !important;
  transition: border-color .18s ease, box-shadow .18s ease !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-summary article:hover {
  border-color: rgba(124, 213, 255, .65) !important;
  box-shadow: inset 0 1px 0 rgba(212, 247, 255, .11), 0 0 18px rgba(45, 161, 247, .12) !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-summary article small {
  color: #9cbed6 !important;
  font-size: 10.5px !important;
  letter-spacing: .055em !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-summary article strong {
  color: #edf9ff !important;
  font-size: clamp(19px, 1.8vw, 23px) !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  letter-spacing: -.02em !important;
  font-variant-numeric: tabular-nums;
}
html[data-app-theme="dark"] #reports-detailed .detailed-summary article.is-financial {
  border-color: rgba(94, 195, 253, .48) !important;
  background: radial-gradient(ellipse at 14% 0%, rgba(31, 160, 252, .19), transparent 65%),
              linear-gradient(150deg, #102c4b, #09223d) !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-summary article.is-financial strong {
  color: #7adfff !important;
  text-shadow: 0 0 16px rgba(74, 186, 246, .12) !important;
}

/* Tabela detalhada: cabeçalho, linhas e hover azuis mantendo cores de fase. */
html[data-app-theme="dark"] #reports-detailed .detailed-table-card {
  border: 1px solid rgba(87, 162, 236, .36) !important;
  border-radius: 17px !important;
  background: linear-gradient(160deg, #0d2239, #071a2f) !important;
  box-shadow: 0 12px 35px rgba(0, 7, 26, .19), inset 0 1px 0 rgba(177, 225, 255, .06) !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-table-head {
  border-bottom: 1px solid rgba(84, 166, 242, .25) !important;
  background: linear-gradient(103deg, rgba(26, 95, 175, .22), rgba(9, 30, 55, .43) 70%) !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-table-head strong {
  color: #f2faff !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}
html[data-app-theme="dark"] #reports-detailed :is(.detailed-table-head small, .detailed-table-head > span) {
  color: #9dbdd4 !important;
  font-size: 10.5px !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-table-scroll {
  scrollbar-color: rgba(79, 169, 243, .57) transparent;
}
html[data-app-theme="dark"] #reports-detailed .detailed-table-scroll::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
html[data-app-theme="dark"] #reports-detailed .detailed-table-scroll::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: rgba(72, 158, 238, .46);
}
html[data-app-theme="dark"] #reports-detailed .detailed-table-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 203, 255, .69);
}
html[data-app-theme="dark"] #reports-detailed .detailed-table th {
  height: 42px !important;
  border-bottom-color: rgba(97, 177, 240, .38) !important;
  color: #a5c8e1 !important;
  background: #102e4c !important;
  font-size: 9.5px !important;
  font-weight: 850 !important;
  letter-spacing: .025em;
}
html[data-app-theme="dark"] #reports-detailed .detailed-table td {
  height: 43px !important;
  border-bottom-color: rgba(87, 159, 216, .15) !important;
  color: #dceefb !important;
  font-size: 10.5px !important;
  font-weight: 550;
}
html[data-app-theme="dark"] #reports-detailed .detailed-table tbody tr:nth-child(even) td {
  background: rgba(24, 72, 119, .13) !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-table tbody tr:hover td {
  background: rgba(38, 119, 201, .27) !important;
  box-shadow: inset 0 1px 0 rgba(122, 207, 255, .06) !important;
}
html[data-app-theme="dark"] #reports-detailed .detailed-money {
  color: #ecf8ff !important;
  font-weight: 800 !important;
  font-variant-numeric: tabular-nums;
}
html[data-app-theme="dark"] #reports-detailed .detailed-positive {
  color: #73d9ff !important;
  text-shadow: 0 0 12px rgba(56, 179, 251, .09);
}
html[data-app-theme="dark"] #reports-detailed .detailed-phase {
  color: #d8e8f5 !important;
  font-size: 9.5px !important;
  font-weight: 800 !important;
}
/* Preserva o ponto e o --phase-color, usados nas fases operacionais. */
html[data-app-theme="dark"] #reports-detailed .detailed-empty {
  color: #a5c3d6 !important;
  font-size: 12px !important;
}

/* Responsivo sem modificar DOM, tabelas, menus ou consultas de dados. */
@media (max-width: 1400px) {
  html[data-app-theme="dark"] #reports-detailed .detailed-filter-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
  }
}
@media (max-width: 760px) {
  html[data-app-theme="dark"] #reports-detailed .detailed-filter-panel {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px !important;
  }
  html[data-app-theme="dark"] #reports-detailed .detailed-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  html[data-app-theme="dark"] #reports-detailed .detailed-table-head {
    padding-inline: 12px;
  }
}
@media (max-width: 480px) {
  html[data-app-theme="dark"] #reports-detailed .detailed-summary {
    grid-template-columns: minmax(0, 1fr);
  }
  html[data-app-theme="dark"] #reports-detailed .detailed-basis-control strong {
    font-size: 9.5px !important;
    padding-inline: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html[data-app-theme="dark"] #reports-detailed :is(.detailed-apply,.detailed-reset)::after {
    opacity: 0 !important;
    transition: none !important;
  }
  html[data-app-theme="dark"] #reports-detailed .detailed-summary article {
    transition: none !important;
  }
}

/*
 * V294.1 — Alinhamento do Relatorio Detalhado em janela independente.
 * O container geral de Relatorios ainda tinha 38px de padding superior e
 * 42px nas laterais, somados a mais 18px no shell detalhado. Isso fazia
 * o relatorio comecar longe do topo/esquerda e extrapolar a direita.
 * Isolado em data-report-window=detalhado: outros relatorios nao mudam.
 */
html[data-report-window="detalhado"] #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 24px !important;
}
html[data-report-window="detalhado"] #reports-detailed {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}
html[data-report-window="detalhado"] #reports-detailed .detailed-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;
}
@media (max-width: 760px) {
  html[data-report-window="detalhado"] #section-reports.reports-launcher {
    padding: 8px 9px 20px !important;
  }
}
