.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 220px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  padding: 10px 12px 8px;
  background:
    linear-gradient(160deg, rgba(212, 175, 55, 0.12), transparent 24%),
    linear-gradient(180deg, #04101b 0%, #082238 58%, #03101a 100%);
  color: #fff;
  box-shadow: 12px 0 34px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 10px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.28);
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  place-items: center;
  border: 2px solid #d4af37;
  border-radius: 10px;
  color: #d4af37;
  background: rgba(1, 11, 20, 0.78);
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: #fff;
  font-family: Georgia, serif;
  font-size: 20px;
  line-height: 1;
}

.brand strong span {
  color: #d4af37;
}

.brand small {
  margin-top: 4px;
  color: #d7dde5;
  font-size: 9px;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: uppercase;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 6px;
  flex: 1;
  overflow-y: auto;
}

.menu-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 2px;
}

.menu-section-label {
  padding: 4px 12px 2px;
  color: rgba(212, 175, 55, 0.55);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.menu-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 10px;
  color: rgba(241, 246, 251, 0.75);
  background: transparent;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.menu-item .material-icons-round {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(212, 175, 55, 0.7);
  font-size: 14px;
  transition: background 0.18s ease, color 0.18s ease;
}

.menu-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.menu-item:hover .material-icons-round {
  background: rgba(212, 175, 55, 0.15);
  color: #d4af37;
}

.menu-item.active {
  color: #fff;
  border-color: rgba(212, 175, 55, 0.3);
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.18), rgba(255, 255, 255, 0.05));
}

.menu-item.active .material-icons-round {
  background: rgba(212, 175, 55, 0.2);
  color: #d4af37;
}

.menu-item.active::before {
  position: absolute;
  inset: 7px auto 7px -1px;
  width: 3px;
  border-radius: 999px;
  background: #d4af37;
  content: "";
}

.sidebar-support {
  margin-top: 6px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 7px;
  padding: 8px 10px;
  background: rgba(1, 11, 20, 0.48);
}

.sidebar-support strong,
.sidebar-support span {
  display: block;
}

.sidebar-support strong {
  color: #fff;
  font-size: 11px;
}

.sidebar-support span {
  margin-top: 2px;
  color: #d7dde5;
  font-size: 10px;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  margin-top: 6px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 7px;
  padding: 0 10px;
  color: #fff;
  background: rgba(212, 175, 55, 0.12);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}

.sidebar-logout span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, 0.65);
  border-radius: 6px;
  color: #d4af37;
  font-size: 12px;
}

.sidebar-logout:hover {
  border-color: rgba(212, 175, 55, 0.85);
  background: rgba(212, 175, 55, 0.22);
}

.app {
  width: calc(100% - 220px);
  margin-left: 220px;
  padding: 60px 4px 4px;
}

.app-topbar {
  position: fixed;
  inset: 0 0 auto 220px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 56px;
  padding: 0 20px;
  background:
    linear-gradient(160deg, rgba(212, 175, 55, 0.12), transparent 24%),
    linear-gradient(180deg, #04101b 0%, #082238 58%, #03101a 100%);
  border-bottom: 1px solid rgba(212, 175, 55, 0.28);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

/* Botão hambúrguer — só some/aparece via a media query mobile em views.css.
   Em telas largas o menu já fica sempre visível na lateral, então isso fica
   escondido por padrão. */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  color: #d4af37;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Fundo escurecido atrás do menu quando ele abre por cima do conteúdo no
   celular (ver .sidebar na media query de views.css). Em telas largas nunca
   fica visível — pointer-events:none garante que não intercepta clique
   nem por engano. */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(4, 10, 18, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

body.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.app-topbar-profile-wrap {
  position: relative;
}

.app-topbar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 10px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.app-topbar-profile:hover,
.app-topbar-profile.active {
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(255, 255, 255, 0.06);
}

.app-topbar-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  place-items: center;
  border: 2px solid #d4af37;
  border-radius: 999px;
  color: #d4af37;
  background: rgba(1, 11, 20, 0.78);
  font-weight: 800;
  font-size: 14px;
}

.app-topbar-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.app-topbar-user-info strong {
  color: #fff;
  font-size: 13px;
  line-height: 1.3;
}

.app-topbar-user-info small {
  display: flex;
  align-items: center;
  gap: 2px;
  color: rgba(241, 246, 251, 0.65);
  font-size: 11px;
}

.app-topbar-caret {
  font-size: 15px;
}

.app-topbar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  flex-direction: column;
  min-width: 200px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 10px;
  padding: 6px;
  background: #0b1320;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}

.app-topbar-dropdown.open {
  display: flex;
}

.app-topbar-dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 10px 10px;
  color: #d7dde5;
  font-size: 11px;
  text-transform: uppercase;
}

.app-topbar-dropdown-info strong {
  margin-top: 3px;
  color: #fff;
  font-size: 11px;
  text-transform: none;
}

.app-topbar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 7px;
  padding: 9px 10px;
  color: #fff;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.app-topbar-dropdown-item:hover {
  background: rgba(212, 175, 55, 0.15);
}

.app-topbar-dropdown-item .material-icons-round {
  font-size: 18px;
  color: #d4af37;
}

.app-topbar-dropdown-danger {
  color: #ff8a8a;
}

.app-topbar-dropdown-danger .material-icons-round {
  color: #ff8a8a;
}

.app-topbar-dropdown-divider {
  margin: 6px 4px;
  border-top: 1px solid rgba(212, 175, 55, 0.25);
}

.view {
  display: none;
}

.view.active-view {
  display: block;
}

.topbar,
.section-heading,
.top-actions,
.legend {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 20px;
}

h2 {
  font-size: 15px;
}

.top-actions {
  /* alinhado pela base, não pelo centro — igual .filters (tables.css): campo
     com rótulo em cima (ex: "Banco do extrato", os filtros de PDV/OS/Produção)
     fica mais alto que um botão simples, então centralizar deixava o campo e
     o botão em alturas diferentes. Pedido do usuário (2026-09-01). */
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#launchView .topbar {
  align-items: flex-start;
}

#launchView .top-actions {
  max-width: 760px;
}

#launchView .top-actions button {
  white-space: nowrap;
}

/* Produtos & Serviços — pedido do usuário (2026-08-30): tirar o "eyebrow"
   (já removido do HTML), encolher os cards de resumo (eram do mesmo
   tamanho do Dashboard, sem necessidade — só um número e um rótulo curto)
   e apertar os espaçamentos ao redor, pra caber cabeçalho + abas + resumo +
   começo da tabela numa tela só, sem rolar, na maioria dos monitores. */
#productsView .topbar {
  margin-bottom: 12px;
}

#productsView .page-subtitle {
  margin-top: 2px;
}

#productsView #productTopActions .secondary-button,
#productsView #productTopActions .text-button,
#productsView #productTopActions .primary-button {
  min-height: 34px;
  padding-left: 12px;
  padding-right: 12px;
  font-size: 12px;
}

/* Abas superiores (Produtos/Movimentações/Lotes) — pedido do usuário
   (2026-08-31): "poluido", os títulos de aba (pills brancas uppercase de
   58px de altura) e os cards de resumo das 3 sub-abas todos precisavam
   encolher, não só a aba Produtos. */
#productsView .report-tabs {
  margin-bottom: 10px !important;
}

#productsView .report-tabs .report-tab {
  min-height: 34px;
  font-size: 12px;
  padding-top: 0;
  padding-bottom: 0;
}

#productsView .product-type-tabs {
  margin-bottom: 8px;
}

#productsView .product-type-tab {
  padding: 3px 10px;
  font-size: 12px;
}

/* Aplica a TODAS as seções de resumo dentro de Produtos & Estoque
   (Produtos, Movimentações e Lotes/Validade usam a mesma estrutura
   .finance-hero-panel > .summary-grid.compact), não só #productsMetrics. */
#productsView .finance-hero-panel {
  margin-bottom: 12px;
  padding: 12px;
}

#productsView .summary-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

#productsView .summary-grid.compact .metric {
  min-height: auto;
  padding: 10px 12px;
}

#productsView .summary-grid.compact .metric span {
  margin-bottom: 3px;
  font-size: 10px;
}

#productsView .summary-grid.compact .metric strong {
  font-size: 17px;
}

@media (max-width: 900px) {
  #productsView .summary-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Botões de ação nas linhas da tabela de produtos — ícone em vez de texto,
   pra reduzir a largura da coluna Ações e poluição visual. */
#productsView .products-table .action-buttons {
  gap: 4px;
}

#productsView .products-table .icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-height: 30px;
  padding: 0;
}

#productsView .products-table .icon-action .material-icons-round {
  font-size: 18px;
}

.home-executive-dashboard {
  min-height: calc(100vh - 48px);
  border-radius: 0 12px 12px 0;
  padding: 24px;
  color: #f7fbff;
  background:
    linear-gradient(135deg, rgba(212, 175, 55, 0.14), transparent 22%),
    linear-gradient(160deg, #04101b 0%, #072236 52%, #03101a 100%);
  box-shadow: var(--shadow);
}

.home-executive-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 18px;
}

.home-brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.home-brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 2px solid #d4af37;
  border-radius: 10px;
  color: #d4af37;
  font-family: Georgia, serif;
  font-size: 34px;
  font-weight: 800;
}

.home-brand-lockup strong {
  display: block;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 28px;
  line-height: 1;
}

.home-brand-lockup strong span {
  color: #d4af37;
}

.home-brand-lockup small,
.home-title-block p,
.home-top-actions span,
.home-kpi-card small {
  color: #dbe5ee;
}

.home-brand-lockup small {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-title-block h1 {
  font-family: Georgia, serif;
  font-size: 34px;
  line-height: 1.1;
}

.home-title-block p {
  margin: 6px 0 0;
}

.home-top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.home-gold-button,
.home-clear-button {
  align-self: end;
  min-height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
}

.home-gold-button {
  border: 0;
  color: #05121e;
  background: linear-gradient(135deg, #f3c35a, #d4af37);
}

.home-clear-button {
  border: 1px solid rgba(212, 175, 55, 0.55);
  color: #fff;
  background: rgba(2, 10, 18, 0.42);
  white-space: normal;
}

/* Mesmo tamanho padrão da barra de filtros do resto do sistema (ver .filters
   em tables.css) — só com as cores do tema do Início (fundo escuro/dourado). */
.home-filter-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.home-filter-row label {
  flex: 0 0 auto;
  min-width: 130px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(1, 11, 20, 0.62);
}

.home-filter-row span,
.home-filter-row select,
.home-kpi-card span,
.home-kpi-card strong,
.home-kpi-card small {
  display: block;
}

.home-filter-row span {
  color: #d4af37;
  font-size: 10px;
  font-weight: 800;
}

.home-filter-row select {
  width: 100%;
  min-height: 22px;
  margin-top: 2px;
  border: 0;
  color: #fff;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  outline: none;
}

.home-filter-row option {
  color: #071423;
}

.home-kpi-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.home-kpi-card {
  position: relative;
  min-height: 156px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  padding: 18px 16px 14px;
  color: #071423;
  background: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.has-tooltip {
  position: relative;
}

.home-kpi-card.has-tooltip {
  overflow: visible;
}

.home-kpi-card.has-tooltip::after,
.home-bottom-strip .has-tooltip::after,
.home-panel-heading.has-tooltip::after,
.home-finance-card.has-tooltip::after {
  position: absolute;
  z-index: 5;
  right: 12px;
  bottom: calc(100% + 10px);
  width: min(260px, 90vw);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  background: #061421;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.home-kpi-card.has-tooltip:hover::after,
.home-bottom-strip .has-tooltip:hover::after,
.home-panel-heading.has-tooltip:hover::after,
.home-finance-card.has-tooltip:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* .home-dashboard-panel usa overflow:hidden pra arredondar o conteúdo interno
   (tabelas/gráficos); isso cortaria a legenda (posicionada acima do
   cabeçalho), então liberamos o overflow só nos painéis que têm tooltip. */
.home-dashboard-panel:has(.home-panel-heading.has-tooltip) {
  overflow: visible;
}

.home-kpi-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 10px;
  border: 1px solid #d4af37;
  border-radius: 50%;
  color: #d4af37;
  background: #061421;
  font-weight: 900;
}

.home-kpi-card span {
  color: #071423;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.home-kpi-card strong {
  margin-top: 8px;
  color: #071423;
  font-size: 22px;
}

.home-kpi-card small {
  margin-top: 4px;
  color: #344456;
  font-size: 12px;
}

.home-finance-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.home-finance-card {
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  padding: 16px 18px;
  color: #071423;
  background: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.home-finance-card span,
.home-finance-card strong,
.home-finance-card small {
  display: block;
}

.home-finance-card span {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.home-finance-card strong {
  margin-top: 8px;
  color: #071423;
  font-size: 24px;
}

.home-finance-card small {
  margin-top: 4px;
  color: #344456;
  font-size: 12px;
}

.home-kpi-change {
  position: absolute;
  top: 22px;
  right: 18px;
  color: #c88405;
  font-size: 14px;
  font-weight: 900;
  text-align: right;
}

.home-kpi-change.down {
  color: #e11d2e;
}

.home-analytics-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(360px, 1fr);
  gap: 14px;
}

/* Sem isso, a tabela de DRE (bem mais larga que o card) empurra a pagina
   inteira pra o lado em vez de só rolar dentro do proprio card. */
.table-wrapper {
  max-width: 100%;
  overflow-x: auto;
}

/* Painel escuro/dourado do resumo de Lançamentos, mesmo visual do topo do
   Dashboard (.home-executive-dashboard). Em vez de sobrescrever cada
   propriedade, redefine as MESMAS variaveis --brand-* que o sistema de tema
   ".view:not(#homeView)" (views.css) ja usa em .metric/.panel/table th/etc —
   assim tudo dentro deste wrapper fica escuro automaticamente, sem duplicar
   regras, e o mesmo padrao serve pra qualquer outra tela no futuro. */
.finance-hero-panel {
  --brand-bg: rgba(1, 11, 20, 0.55);
  --brand-navy: #f7fbff;
  --brand-navy-2: #dbe5ee;
  --brand-ink: #f7fbff;
  --brand-muted: #b8c4d4;
  --brand-line: rgba(212, 175, 55, 0.35);
  --brand-soft: rgba(1, 11, 20, 0.4);
  margin-bottom: 18px;
  padding: 20px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(212, 175, 55, 0.14), transparent 22%),
    linear-gradient(160deg, #04101b 0%, #072236 52%, #03101a 100%);
  box-shadow: var(--shadow);
}

.finance-hero-panel .summary-grid {
  margin-bottom: 14px;
}

.finance-hero-panel .panel,
.finance-hero-panel .metric,
.finance-hero-panel .bank-panel {
  box-shadow: none;
}

/* Inputs/selects continuam com fundo branco (mais legivel pra digitar) —
   por isso o texto deles precisa continuar escuro, mesmo com --brand-navy
   redefinido pra claro (usado no texto sobre fundo escuro dos cards).
   !important necessario pra vencer ".view:not(#homeView) input" (views.css),
   que tem especificidade de ID por causa do :not(#homeView) e nao perde
   pra nenhuma combinacao de classes. */
.finance-hero-panel input,
.finance-hero-panel select,
.finance-hero-panel textarea,
.finance-hero-panel .text-button,
.finance-hero-panel .secondary-button,
.finance-hero-panel .small-action,
.finance-hero-panel .icon-button {
  color: #0b1320 !important;
}

.home-dashboard-panel {
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  color: #071423;
  background: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.home-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 16px;
  color: #fff;
  background: linear-gradient(135deg, #04101b, #0b2b45);
}

.home-panel-heading h2 {
  font-size: 14px;
  text-transform: uppercase;
}

.home-dre-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
}

.home-dre-panel .table-wrapper {
  width: 100%;
  overflow-x: auto;
}

@media (max-width: 720px) {
  .home-dre-panel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .home-dre-panel .table-wrapper {
    overflow-x: visible;
    width: max-content;
    min-width: 100%;
  }

  .home-dre-table {
    table-layout: auto;
    width: max-content;
    min-width: 480px;
  }
}

.home-dre-table th,
.home-dre-table td {
  border-bottom: 1px solid #e4e9f0;
  padding: 9px 10px;
  text-align: right;
  white-space: nowrap;
}

.home-dre-table th:first-child,
.home-dre-table td:first-child {
  width: 15%;
  text-align: left;
  white-space: normal;
}

.home-dre-table th:nth-child(2),
.home-dre-table td:nth-child(2) {
  width: 5%;
}

.home-dre-table th:nth-child(3),
.home-dre-table td:nth-child(3) {
  width: 5%;
}

.home-dre-table th:nth-child(4),
.home-dre-table td:nth-child(4) {
  width: 75%;
}

.home-dre-table th {
  color: #172236;
  background: #f4f7fa;
  font-size: 11px;
  text-transform: uppercase;
}

.home-dre-table tr.total-row td {
  color: #a66d00;
  background: #fff8e8;
  font-weight: 900;
}

.home-dre-table tr.positive-row td {
  color: #008f3a;
  background: #eaf8ef;
  font-weight: 900;
}

.home-dre-table tr.negative-row td {
  color: #071423;
  background: #fff;
  font-weight: 400;
}

.home-chart-stack {
  display: grid;
  gap: 14px;
}

.home-line-chart,
.home-bar-chart {
  min-height: 250px;
  padding: 16px;
}

.home-line-chart svg,
.home-bar-chart svg {
  width: 100%;
  height: 250px;
}

.home-small-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.home-donut-panel {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 180px;
  padding: 16px;
}

.home-donut {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: conic-gradient(#061421 0 30%, #0f6b5b 30% 52%, #d4af37 52% 70%, #62748a 70% 100%);
}

.home-donut-list,
.home-horizontal-bars {
  display: grid;
  gap: 9px;
  padding: 16px;
  font-size: 12px;
}

.home-donut-list {
  padding: 0;
  font-size: 9px;
}

.home-legend-item,
.home-company-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.home-legend-item i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 50%;
}

.home-company-track {
  grid-column: 1 / -1;
  height: 14px;
  border-radius: 99px;
  background: #edf1f5;
  overflow: hidden;
}

.home-company-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #061421, #0d2b45);
}

.home-bottom-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin-top: 14px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 8px;
  background: rgba(1, 11, 20, 0.72);
}

.home-bottom-strip div {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  align-items: center;
  min-height: 76px;
  border-right: 1px solid rgba(212, 175, 55, 0.35);
  padding: 16px 18px;
}

.home-bottom-strip div:last-child {
  border-right: 0;
}

.home-bottom-strip p,
.home-bottom-strip strong {
  display: block;
}

.bottom-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid #d4af37;
  border-radius: 50%;
  color: #d4af37;
  font-size: 15px;
  font-weight: 900;
}

.home-bottom-strip p {
  margin: 0;
  color: #dbe5ee;
  font-size: 13px;
}

.home-bottom-strip strong {
  grid-column: 1 / -1;
  margin-top: 4px;
  color: #fff;
  font-size: 15px;
  padding-left: 46px;
}

.home-hidden-metrics {
  display: none;
}

/* ── Novos indicadores do dashboard ── */
.home-insights-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

/* cashflow ocupa as 2 colunas */
.home-cashflow-panel {
  grid-column: 1 / 2;
}

.home-insights-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* linha 2: 3 painéis iguais */
.home-insights-grid > article:nth-child(3),
.home-insights-grid > article:nth-child(4),
.home-insights-grid > article:nth-child(5) {
  grid-column: auto;
}

.home-insights-grid:has(> .home-top-expenses-panel) {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}

/* Linha 2 fica em grid de 3 colunas via subgrid workaround */
.home-insights-row2 {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* Top 5 — full width */
.home-top-expenses-panel {
  grid-column: 1 / -1;
}

/* Cashflow */
.home-cashflow-chart {
  padding: 16px;
  overflow: hidden;
}

.home-cashflow-legend {
  display: flex;
  gap: 20px;
  padding: 0 16px 10px;
  font-size: 12px;
}

.home-cashflow-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.home-cashflow-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* Saldo projetado */
.home-projected-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-projected-body > strong {
  font-size: 28px;
  color: #04101b;
}

.home-projected-body.projected-negative > strong {
  color: #c0392b;
}

.home-projected-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #556;
}

.home-projected-detail b {
  color: #071423;
}

/* Notas fiscais */
.home-invoices-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 16px;
  gap: 12px;
}

.home-invoices-body > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-invoices-body span {
  font-size: 11px;
  color: #778;
  text-transform: uppercase;
}

.home-invoices-body strong {
  font-size: 18px;
  font-weight: 900;
  color: #04101b;
}

.home-invoices-body small {
  font-size: 11px;
  color: #008f3a;
}

/* Vencimentos */
.home-overdue-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 12px;
}

.home-overdue-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
}

.home-overdue-card span {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
}

.home-overdue-card strong {
  font-size: 28px;
  font-weight: 900;
}

.home-overdue-card b {
  font-size: 12px;
}

.overdue-red { background: #fdecea; color: #c0392b; }
.overdue-yellow { background: #fff8e1; color: #b45309; }

/* Aging */
.home-aging-body {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-aging-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f4f7fa;
}

.home-aging-row b { font-weight: 900; color: #071423; }
.home-aging-critical { background: #fdecea; }
.home-aging-critical b { color: #c0392b; }

/* Orçado vs Realizado */
.home-budget-body {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 220px;
  overflow-y: auto;
}

.home-budget-row {
  font-size: 12px;
}

.home-budget-row-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
  color: #071423;
}

.home-budget-row-header span:last-child { color: #778; }

.home-budget-track {
  height: 7px;
  background: #e5eaf0;
  border-radius: 4px;
  overflow: hidden;
}

.home-budget-track-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s;
}

/* Top 5 despesas */
.home-top-expenses-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  padding: 16px;
}

.home-top-expense-item {
  font-size: 12px;
}

.home-top-expense-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-weight: 700;
  color: #071423;
}

.home-top-expense-track {
  height: 7px;
  background: #e5eaf0;
  border-radius: 4px;
  overflow: hidden;
}

.home-top-expense-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #04101b, #1a4a6e);
}

.calendar-actions label {
  display: grid;
  gap: 6px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-actions select {
  min-width: 160px;
  min-height: 44px;
  border: 1px solid #d4af37;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
}

.economic-calendar-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.economic-calendar-summary .metric {
  border-top: 3px solid #d4af37;
}

.calendar-bank-panel {
  margin-bottom: 18px;
}

.calendar-bank-grid .bank-card {
  border-top: 3px solid #d4af37;
}

.budget-filter-panel {
  margin-bottom: 18px;
}

.economic-calendar-panel {
  border: 1px solid #dfe5ed;
  border-radius: 10px;
  padding: 14px;
  background: #fff;
  overflow: auto;
}

.budget-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
}

