/* Estilos para o painel de configura��o do Perspective */

.finops-perspective-dashboard .right-sidepanel {
    background: #fafafa;
    box-shadow: -10px 0 18px 0px rgba(58, 79, 135, 0.15);
    max-height: calc(100% + 1.5rem);
    grid-column-end: 13;
    grid-row-start: 1;
    grid-row-end: 1;
    z-index: 9;
     
    /* O conteudo (.right-sidepanel-content) tem min-width: 400px; com padding
       de 1rem em cada lado, o painel precisa de >= 432px. Sem isto, quando
       fixado o grid resolve width:25% para ~119px e o formulario transborda
       para fora do fundo colorido (form desalinhado / fundo ocupando so parte). */
  
    box-sizing: border-box;
    position: fixed;
    right: 0;
    padding: 1rem;
    margin-top: -0.75rem;
}

.finops-perspective-dashboard .right-sidepanel.pinned {
    position: relative;
   
}

.finops-perspective-dashboard .right-sidepanel.focused {
    position: fixed !important;
    top: 90px;
    width: 100%;
    left: 0;
    height: calc(100vh - 80px);
}

/* T�tulo do painel */
.finops-perspective-dashboard .right-sidepanel .title-sidebar {
    color: var(--text-dark);
    font-family: "Ubuntu", sans-serif;
    font-size: 18px;
    font-style: normal;
    font-weight: 300;
    line-height: 160%;
}

/* Itens da lista de views */
.finops-perspective-dashboard .config-panel-item {
    font-size: 12px;
    height: 38px;
    width: 100%;
    padding-left: 10px;
    padding-right: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 500;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.finops-perspective-dashboard .config-panel-item:hover {
    background-color: #EBEBEB !important;
}

.finops-perspective-dashboard .config-panel-item.selected {
    border: 1px solid #FFBE15;
}

/* Bot�es de a��o nos itens */
.finops-perspective-dashboard .config-panel-item .functions {
    display: none;
    gap: 0.25rem;
}

.finops-perspective-dashboard .config-panel-item:hover .functions {
    display: flex;
}

/* Bot�o de reset */
.finops-perspective-dashboard .config-panel-reset {
    display: flex;
    font-size: 12.8px;
    font-family: "Ubuntu", sans-serif;
    color: #2E1956;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.finops-perspective-dashboard .config-panel-reset:hover {
    background-color: #EBEBEB;
}

/* Scrollbar customizada */
.finops-perspective-dashboard .scrollable-v::-webkit-scrollbar {
    width: 8px;
    height: 0;
}

.finops-perspective-dashboard .scrollable-v::-webkit-scrollbar-thumb {
    background: #cccccf;
    height: 8px;
    border-radius: 4px;
}

.finops-perspective-dashboard .scrollable-v::-webkit-scrollbar-thumb:hover {
    background: #ddd;
}

.finops-perspective-dashboard .scrollable-v::-webkit-scrollbar-track {
    border-radius: 4px;
}

/* Labels de view */
.finops-perspective-dashboard .view-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
}

/* Formul�rio de nova view */
.finops-perspective-dashboard .new-view-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.5rem;
}

/* Ajustes para Material-UI components */
.finops-perspective-dashboard .MuiTextField-root {
    margin: 0 !important;
}

.finops-perspective-dashboard .MuiButton-root {
    text-transform: none;
}

/* Separadores */
.finops-perspective-dashboard hr {
    border: none;
    border-top: 1px solid #E2E6F3;
    margin: 0.5rem 0;
}
/**
 * CSS específico para o FinOps Analytics Dashboard com Perspective
 */

.finops-perspective-dashboard {
    height: 100%;
    width: 100%;
}

.finops-perspective-dashboard .card-frame {
    height: 100%;
}

.finops-perspective-dashboard .card-content-body {
    height: 100%;
}

.finops-perspective-dashboard .card-content-body-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Estilo para o card de informa??es da view */
.finops-perspective-dashboard .view-info-card {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

/* Estilo para a lista de views com scroll */
.view-list {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Estilo para o card principal do Perspective */
.finops-perspective-dashboard .perspective-main-card {
    height: 100%;
    overflow: hidden;
}

.finops-perspective-dashboard .perspective-main-card>div {
    height: 100%;
}

/* Garantir que o perspective-viewer ocupe toda a altura dispon?vel */
.finops-perspective-dashboard perspective-viewer {
    height: 100% !important;
    width: 100% !important;
}

/* Ajustes para o loading sobreposto */
.finops-perspective-dashboard .lc-loading-container {
    height: 100%;
}

/* Garantir que o container principal tenha posi??o relativa */
.finops-perspective-dashboard {
    position: relative;
}

/* Estilo para o loading sobreposto */
.finops-perspective-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease-in-out;
}

/* Garantir que o Perspective n?o seja afetado pelo loading */
.finops-perspective-dashboard .perspective-main-card perspective-viewer {
    pointer-events: auto;
}

/* Persistent, non-modal Pivot toolbox. The generic LCDashboard owns the
   title/pin/close row; this shell owns the view context, tabs and lifecycle. */
.finops-perspective-dashboard .fadp-toolbox-sidebar {
    background: #fff;
}

.finops-perspective-dashboard .fadp-toolbox-sidebar .filter-content {
    min-height: 0;
}

.finops-perspective-dashboard .fadp-toolbox-sidebar .right-sidepanel-content {
    gap: 0.65rem;
}

.finops-perspective-dashboard .fadp-toolbox-sidebar .title-sidebar.fadp-toolbox-panel-title {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    line-height: 1.25;
}

.fadp-toolbox-panel-title-content {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

.fadp-toolbox-panel-title-label {
    flex: 0 0 auto;
    color: #6b7280;
    color: var(--color-neutral-gray-60, #6b7280);
    font-size: 0.65em;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.fadp-toolbox-panel-title-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fadp-toolbox {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    position: relative;
    color: #2b304f;
    color: var(--text-dark, #2b304f);
}

.fadp-toolbox-dirty-dot,
.fadp-toolbox-tab-dirty {
    display: inline-block;
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f59e0b;
}

.fadp-toolbox-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-gap: 0.2rem;
    gap: 0.2rem;
    padding: 0.7rem 0 0.55rem;
    border-bottom: 1px solid #e7eaf2;
}

.fadp-toolbox-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.5rem 0.35rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #4b5563;
    color: var(--color-neutral-gray-70, #4b5563);
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 500;
}

.fadp-toolbox-tab:hover,
.fadp-toolbox-tab:focus-visible {
    color: #173192;
    color: var(--color-primary-blue, #173192);
    outline: none;
}

.fadp-toolbox-tab:focus-visible {
    box-shadow: 0 0 0 2px rgba(23, 49, 146, 0.22);
    border-radius: 4px;
}

.fadp-toolbox-tab.is-active {
    border-bottom-color: #173192;
    border-bottom-color: var(--color-primary-blue, #173192);
    color: #173192;
    color: var(--color-primary-blue, #173192);
    font-weight: 600;
}

.fadp-toolbox-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.fadp-toolbox-pane {
    height: 100%;
    min-height: 0;
    overflow: auto;
}

.fadp-toolbox-pane[hidden] {
    display: none;
}

.fadp-toolbox-pane > div {
    min-height: 100%;
}

.fadp-toolbox-footer {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    margin-top: 0.5rem;
    padding: 0.7rem 0 0;
    border-top: 1px solid #e7eaf2;
}

.fadp-toolbox-status {
    min-width: 0;
    color: #6b7280;
    color: var(--color-neutral-gray-60, #6b7280);
    font-size: 0.75rem;
}

.fadp-toolbox-deferred-period {
    color: #92580a;
}

.fadp-toolbox-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-gap: 0.45rem;
    gap: 0.45rem;
}

.fadp-toolbox-button {
    min-width: 0;
    border-radius: 4px;
    padding: 0.42rem 0.65rem;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 500;
}

.fadp-toolbox-actions > .fadp-toolbox-button {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fadp-toolbox-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.fadp-toolbox-button-primary {
    border: 1px solid #173192;
    border: 1px solid var(--color-primary-blue, #173192);
    background: #173192;
    background: var(--color-primary-blue, #173192);
    color: #fff;
}

.fadp-toolbox-button-secondary {
    border: 1px solid #d7dce8;
    background: #fff;
    color: #2b304f;
    color: var(--text-dark, #2b304f);
}

.fadp-dirty-switch-prompt {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.8rem;
    border: 1px solid #f1c46c;
    border-radius: 6px;
    background: #fffbeb;
    box-shadow: 0 8px 20px rgba(43, 48, 79, 0.18);
    color: #714d00;
    font-size: 0.8rem;
}

.fadp-dirty-switch-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.fadp-save-as-new {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.85rem;
    border: 1px solid #d7dce8;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(43, 48, 79, 0.18);
    color: #2b304f;
    color: var(--text-dark, #2b304f);
    font-size: 0.8rem;
}

.fadp-save-as-new-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.15rem;
}

.fadp-save-as-close {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
}

.fadp-save-as-new input[type='text'],
.fadp-save-as-new textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cfd5e3;
    border-radius: 4px;
    padding: 0.45rem;
    color: inherit;
    font: inherit;
}

.fadp-save-as-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.fadp-save-as-actions {
    justify-content: flex-end;
    margin-top: 0.25rem;
}

.fadp-toolbox-pane #fadp-views-panel-root,
.fadp-toolbox-pane #fadp-assistant-panel-root {
    height: 100% !important;
    min-height: 0;
}

@media (max-width: 1199px) {
    .finops-perspective-dashboard .fadp-toolbox-sidebar {
        padding: 0.75rem;
    }
}

@media (max-height: 740px) {
    .fadp-toolbox-tabs {
        padding-top: 0.45rem;
        padding-bottom: 0.35rem;
    }

    .fadp-toolbox-footer {
        gap: 0.4rem;
        margin-top: 0.35rem;
        padding-top: 0.45rem;
    }
}

@media (max-height: 699px) {
    .finops-perspective-dashboard .fadp-toolbox-sidebar {
        padding: 0.6rem 0.7rem;
    }

    .finops-perspective-dashboard .fadp-toolbox-sidebar .right-sidepanel-content {
        gap: 0.45rem;
    }

    .finops-perspective-dashboard .fadp-toolbox-sidebar .title-sidebar.fadp-toolbox-panel-title {
        font-size: 1rem;
        line-height: 1.15;
    }

    .fadp-toolbox-tabs {
        padding-top: 0.3rem;
        padding-bottom: 0.25rem;
    }

    .fadp-toolbox-tab {
        padding: 0.35rem 0.2rem;
        font-size: 0.73rem;
    }

    .fadp-toolbox-footer {
        gap: 0.35rem;
        margin-top: 0.25rem;
        padding-top: 0.35rem;
    }

    .fadp-toolbox-status {
        font-size: 0.68rem;
        line-height: 1.25;
    }

    .fadp-toolbox-actions {
        gap: 0.3rem;
    }

    .fadp-toolbox-actions > .fadp-toolbox-button {
        padding: 0.32rem 0.3rem;
        font-size: 0.7rem;
    }
}
/* FinOps Perspective Components Styles */

/* Container principal */
.finops-perspective-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

/* ===== Z-INDEX MANAGEMENT ===== */

/* Garantir que split-panel-child sempre tenha z-index: 2 */
.split-panel-child {
  z-index: 2 !important;
}

/* Seletores específicos para diferentes contextos */
perspective-viewer .split-panel-child,
.perspective-viewer .split-panel-child,
.finops-perspective-container .split-panel-child,
.perspective-viewer-container .split-panel-child {
  z-index: 2 !important;
}

/* Elementos filhos dentro de split-panel-child */
.split-panel-child > *,
.split-panel-child .perspective-viewer,
.split-panel-child perspective-viewer {
  z-index: inherit;
}

/* Split panel principal com z-index menor */
.split-panel {
  z-index: 1 !important;
}

/* Settings panel com z-index menor */
#settings_panel {
  z-index: 1 !important;
}

/* ===== REGRAS ADICIONAIS PARA GARANTIR Z-INDEX: 2 ===== */

/* Seletores por atributo e classe */
[class*="split-panel-child"],
[class^="split-panel-child"],
[class$="split-panel-child"] {
  z-index: 2 !important;
}

/* Seletores por ID (caso existam) */
#split-panel-child,
[id*="split-panel-child"] {
  z-index: 2 !important;
}

/* Contextos específicos do Perspective FINOS */
perspective-viewer-datagrid .split-panel-child,
perspective-viewer-d3fc .split-panel-child,
perspective-viewer-openlayers .split-panel-child {
  z-index: 2 !important;
}

/* Elementos dentro de containers específicos */
.perspective-container .split-panel-child,
.pivot-container .split-panel-child,
.dashboard-container .split-panel-child {
  z-index: 2 !important;
}

/* Regra universal para qualquer elemento com split-panel-child */
*[class*="split-panel-child"] {
  z-index: 2 !important;
}

.finops-perspective-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

/* Toolbar styles */
.perspective-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 8px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
  gap: 8px;
  min-height: 40px;
}

.perspective-toolbar .toolbar-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.perspective-toolbar .toolbar-title {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  margin-right: auto;
}

.perspective-toolbar .record-count {
  font-size: 12px;
  color: #666;
  background: #e9ecef;
  padding: 2px 8px;
  border-radius: 12px;
}

/* Perspective viewer customizations */
perspective-viewer {
  --plugin--background: #ffffff;
  --active--color: #1976d2;
  --inactive--color: #666666;
  --plugin--border: #e0e0e0;
  --select--background: #f5f5f5;
  --column--background: #fafafa;
  --row--background: #ffffff;
  --cell--background: #ffffff;
  --cell--color: #333333;
  --header--background: #f8f9fa;
  --header--color: #333333;
  --header--border: #e0e0e0;
  --button--background: #ffffff;
  --button--border: #d0d7de;
  --button--color: #24292f;
  --button--hover--background: #f3f4f6;
  --button--active--background: #e9ecef;
}

/* Tema escuro (opcional) */
perspective-viewer[theme="Pro Dark"] {
  --plugin--background: #1e1e1e;
  --active--color: #90caf9;
  --inactive--color: #999999;
  --plugin--border: #333333;
  --select--background: #2d2d2d;
  --column--background: #252525;
  --row--background: #1e1e1e;
  --cell--background: #1e1e1e;
  --cell--color: #ffffff;
  --header--background: #2d2d2d;
  --header--color: #ffffff;
  --header--border: #333333;
}

/* Configura��es espec�ficas para FinOps */
perspective-viewer .perspective-viewer-datagrid-container {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 13px;
}

perspective-viewer .perspective-viewer-datagrid-container th {
  background-color: #f8f9fa;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
  padding: 8px 12px;
  text-align: left;
}

perspective-viewer .perspective-viewer-datagrid-container td {
  padding: 6px 12px;
  border-bottom: 1px solid #e9ecef;
}

/* Formata��o de n�meros */
perspective-viewer .perspective-viewer-datagrid-container td[data-type="float"],
perspective-viewer .perspective-viewer-datagrid-container td[data-type="integer"] {
  text-align: right;
  font-family: 'Courier New', monospace;
  font-weight: 500;
}

/* Cores para valores negativos */
perspective-viewer .perspective-viewer-datagrid-container td[data-type="float"]:has-text("-"),
perspective-viewer .perspective-viewer-datagrid-container td[data-type="integer"]:has-text("-") {
  color: #dc3545;
}

/* Cores para valores positivos altos */
perspective-viewer .perspective-viewer-datagrid-container td[data-type="float"][data-value-high],
perspective-viewer .perspective-viewer-datagrid-container td[data-type="integer"][data-value-high] {
  color: #28a745;
  font-weight: 600;
}

/* Panel de views salvas */
.perspective-views-panel {
  position: absolute;
  top: 50px;
  right: 16px;
  width: 320px;
  max-width: 90vw;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(140, 149, 159, 0.2);
  z-index: 1000;
  max-height: 500px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.perspective-views-panel-header {
  padding: 16px;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
}

.perspective-views-panel-header h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: #24292f;
}

.perspective-views-panel-save {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.perspective-views-panel-save input {
  flex: 1 1;
  padding: 6px 12px;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  font-size: 14px;
  background: #ffffff;
}

.perspective-views-panel-save input:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.perspective-views-panel-list {
  flex: 1 1;
  overflow-y: auto;
  padding: 8px;
}

.perspective-view-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #f1f3f4;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.perspective-view-item:hover {
  background-color: #f8f9fa;
}

.perspective-view-item:last-child {
  border-bottom: none;
}

.perspective-view-item-name {
  flex: 1 1;
  font-size: 14px;
  color: #24292f;
  font-weight: 500;
}

.perspective-view-item-actions {
  display: flex;
  gap: 4px;
}

.perspective-view-item-meta {
  font-size: 12px;
  color: #656d76;
  margin-top: 4px;
}

/* Estados de loading */
.perspective-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #666;
  font-size: 14px;
}

.perspective-no-data {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: #666;
  font-size: 16px;
}

.perspective-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #dc3545;
  font-size: 14px;
  padding: 20px;
  text-align: center;
}

.perspective-error button {
  margin-top: 16px;
  padding: 8px 16px;
  background: #1976d2;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.perspective-error button:hover {
  background: #1565c0;
}

/* Responsividade */
@media (max-width: 768px) {
  .perspective-views-panel {
    width: 280px;
    right: 8px;
  }

  .perspective-toolbar {
    padding: 6px 12px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .perspective-toolbar .toolbar-title {
    font-size: 13px;
  }

  .perspective-toolbar .record-count {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .perspective-views-panel {
    width: calc(100vw - 16px);
    right: 8px;
    left: 8px;
  }

  .finops-perspective-container {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* Anima��es */
.perspective-views-panel {
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.perspective-view-item {
  transition: all 0.2s ease;
}

.perspective-view-item:hover {
  transform: translateX(2px);
}

/* Customiza��es para gr�ficos */
perspective-viewer[plugin="d3_bar"] .chart-container,
perspective-viewer[plugin="d3_line"] .chart-container,
perspective-viewer[plugin="d3_area"] .chart-container {
  background: #ffffff;
}

/* Scrollbars customizadas */
.perspective-views-panel-list::-webkit-scrollbar {
  width: 6px;
}

.perspective-views-panel-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.perspective-views-panel-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.perspective-views-panel-list::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* ===== CUSTOMIZAÇÃO DO LOADING DO PERSPECTIVE PIVOT ===== */

/* Personalizar cores do loading Orbit */
.perspective-pivot-loading .container-orbit {
  --uib-color: #2563eb; /* Azul moderno */
  --uib-size: 32px; /* Tamanho maior */
  --uib-speed: 1.2s; /* Velocidade mais rápida */
}

/* Personalizar cores do loading Helix */
.perspective-pivot-loading .container-helix {
  --uib-color: #059669; /* Verde esmeralda */
  --uib-size: 50px; /* Tamanho maior */
  --uib-speed: 2s; /* Velocidade personalizada */
}

/* Estilo do overlay de loading */
.perspective-pivot-loading {
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(2px);
          backdrop-filter: blur(2px);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Personalizar texto do loading */
.perspective-pivot-loading .title-loading {
  color: #374151;
  font-weight: 500;
  font-size: 16px;
  margin-top: 16px;
}

/* Animação de entrada suave */
.perspective-pivot-loading {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Variações de cores por tema */
.perspective-pivot-loading.theme-financial {
  --uib-color: #dc2626; /* Vermelho financeiro */
}

.perspective-pivot-loading.theme-success {
  --uib-color: #16a34a; /* Verde sucesso */
}

.perspective-pivot-loading.theme-warning {
  --uib-color: #ea580c; /* Laranja aviso */
}

.perspective-pivot-loading.theme-info {
  --uib-color: #0ea5e9; /* Azul informação */
}

/* ===== GARANTIR QUE MENU-BAR SEMPRE SEJA OCULTO ===== */

/* Ocultar menu-bar em todos os contextos especificados */
:host #main_column #status_bar #menu-bar,
:host #main_column #status_bar.titled #menu-bar {
  display: none !important;
}

/* ===== GARANTIR Z-INDEX DO SETTINGS PANEL ===== */

/* Forçar z-index do settings panel para sempre ser 1 */
:host {
  --settings-panel-z-index: 1 !important;
}

/* ===== CORREÇÕES PARA ERROS DE SVG/D3FC ===== */

/* Ocultar elementos SVG com transformações inválidas */
perspective-viewer g[transform*="NaN"],
perspective-viewer g[transform*="translate(0, NaN)"] {
  display: none !important;
}

/* Garantir que elementos SVG tenham valores válidos */
perspective-viewer svg g {
  transform: translate(0, 0) !important;
}

/* Corrigir problemas de renderização em gráficos D3FC */
perspective-viewer d3fc-svg,
perspective-viewer d3fc-canvas {
  overflow: hidden;
}

/* Prevenir erros de coordenadas inválidas */
perspective-viewer .d3fc-axis {
  transform: translate(0, 0) !important;
}

/* Ocultar elementos com valores NaN */
perspective-viewer [transform*="NaN"] {
  visibility: hidden !important;
}
