/* ==========================================================================
   DRE ORÇAMENTADA (PLANEJAMENTO ORÇAMENTÁRIO) - ESTILOS VISUAIS
   Design Dark Mode Premium · Bezerra Irrigações
   ========================================================================== */

/* Container Principal da View DRE */
.dre-view-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.3s ease-out;
}

/* Barra de Navegação Temporal (Ano + Meses) */
.dre-nav-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.dre-nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Seletor de Ano (2025 / 2026) */
.dre-year-selector {
  display: flex;
  background: #09101d;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.dre-year-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dre-year-btn:hover {
  color: #fff;
}

.dre-year-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

/* Pílulas de Meses */
.dre-month-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: thin;
}

.dre-month-pill {
  background: #0f172a;
  border: 1px solid #1e293b;
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.dre-month-pill:hover {
  background: #1e293b;
  color: #f1f5f9;
  border-color: #334155;
}

.dre-month-pill.active {
  background: rgba(45, 212, 191, 0.15);
  border-color: #2dd4bf;
  color: #2dd4bf;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.25);
}

.dre-month-pill.accumulated {
  background: rgba(56, 189, 248, 0.1);
  border-color: #0284c7;
  color: #38bdf8;
}

.dre-month-pill.accumulated.active {
  background: #0284c7;
  color: #fff;
  border-color: #38bdf8;
}

/* Ações no Topo da DRE */
.dre-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-dre-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0f172a;
  border: 1px solid #1e293b;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-dre-action:hover {
  background: #1e293b;
  border-color: #38bdf8;
  color: #fff;
}

.btn-dre-action.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: #38bdf8;
  color: #38bdf8;
}

/* Banner de Instrução */
.dre-hint-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(14, 165, 233, 0.08);
  border: 1px dashed rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  color: #94a3b8;
  font-size: 0.85rem;
}

.dre-hint-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dre-hint-icon {
  color: #38bdf8;
  display: flex;
  align-items: center;
}

.dre-hint-banner strong {
  color: #38bdf8;
}

/* Mini Cards de KPIs da DRE (Resumo Executivo Superior) */
.dre-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1024px) {
  .dre-summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .dre-summary-cards {
    grid-template-columns: 1fr;
  }
}

.dre-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.dre-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
}

.dre-card-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.dre-card-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.dre-card-sub {
  font-size: 0.75rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dre-card.accent-revenue { border-left: 3px solid #38bdf8; }
.dre-card.accent-margin { border-left: 3px solid #2dd4bf; }
.dre-card.accent-fixed { border-left: 3px solid #f59e0b; }
.dre-card.accent-profit { border-left: 3px solid #10b981; }
.dre-card.accent-diff { border-left: 3px solid #8b5cf6; }

/* Tabela Principal da DRE */
.dre-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.3);
}

.dre-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

/* Cabeçalho da Tabela */
.dre-table thead th {
  background: #09101d;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 20px;
  border-bottom: 2px solid #1e293b;
  position: sticky;
  top: 0;
  z-index: 10;
}

.dre-table th.col-conta { width: 38%; }
.dre-table th.col-previsto { width: 16%; text-align: right; }
.dre-table th.col-realizado { width: 16%; text-align: right; }
.dre-table th.col-av { width: 12%; text-align: right; }
.dre-table th.col-diferenca { width: 18%; text-align: right; }

/* Linhas e Células */
.dre-table tbody tr {
  border-bottom: 1px solid rgba(30, 41, 59, 0.6);
  transition: background-color 0.15s ease;
}

.dre-table tbody td {
  padding: 11px 20px;
  vertical-align: middle;
}

/* Nível 1: Macrocontas */
.dre-row-macro {
  background: rgba(15, 23, 42, 0.7);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.dre-row-macro:hover {
  background: rgba(30, 41, 59, 0.5);
}

.dre-row-macro .cell-conta {
  color: #f1f5f9;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Nível 2: Subgrupos */
.dre-row-subgroup {
  background: rgba(15, 23, 42, 0.35);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.dre-row-subgroup:hover {
  background: rgba(30, 41, 59, 0.3);
}

.dre-row-subgroup .cell-conta {
  padding-left: 28px;
  color: #93c5fd;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Nível 3: Contas Analíticas */
.dre-row-account {
  background: transparent;
  font-weight: 400;
}

.dre-row-account:hover {
  background: rgba(255, 255, 255, 0.02);
}

.dre-row-account .cell-conta {
  padding-left: 56px;
  color: #cbd5e1;
  font-size: 0.85rem;
}

/* Linhas de Resultado / Subtotais (Margem, Lucro, etc.) */
.dre-row-summary {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.12), rgba(15, 23, 42, 0.6));
  border-top: 2px solid rgba(56, 189, 248, 0.4);
  border-bottom: 2px solid rgba(56, 189, 248, 0.4);
  font-weight: 800;
}

.dre-row-summary .cell-conta {
  color: #38bdf8;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dre-row-summary.summary-profit {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.14), rgba(15, 23, 42, 0.6));
  border-top: 2px solid rgba(16, 185, 129, 0.5);
  border-bottom: 2px solid rgba(16, 185, 129, 0.5);
}

.dre-row-summary.summary-profit .cell-conta {
  color: #34d399;
}

/* Chevrons Indicadores */
.dre-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #64748b;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}

.dre-chevron.expanded {
  transform: rotate(90deg);
  color: #38bdf8;
}

/* Coluna: Previsto (Editável) */
.cell-previsto {
  text-align: right;
  font-family: 'Inter', monospace;
  font-variant-numeric: tabular-nums;
  color: #10b981;
  font-weight: 600;
  position: relative;
}

.cell-previsto.cell-editable {
  cursor: pointer;
}

.cell-previsto.cell-editable:hover {
  background: rgba(16, 185, 129, 0.05);
}

.dre-editable-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.08);
  border: 1px dashed rgba(16, 185, 129, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.dre-editable-badge:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  color: #34d399;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.dre-edit-pen {
  font-size: 0.68rem;
  opacity: 0.5;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.dre-editable-badge:hover .dre-edit-pen {
  opacity: 1;
  transform: scale(1.15);
}

/* Container do Editor Inline */
.dre-inline-editor {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #09101d;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
  animation: fadeIn 0.15s ease;
}

.dre-inline-input {
  width: 115px;
  background: transparent;
  border: none;
  color: #34d399;
  font-family: 'Inter', monospace;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: right;
  padding: 2px 4px;
  outline: none;
}

.dre-btn-inline-save,
.dre-btn-inline-cancel {
  border: none;
  cursor: pointer;
  border-radius: 4px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  transition: all 0.15s ease;
}

.dre-btn-inline-save {
  background: #10b981;
  color: #042f2e;
}

.dre-btn-inline-save:hover {
  background: #34d399;
  transform: scale(1.1);
}

.dre-btn-inline-cancel {
  background: rgba(244, 63, 94, 0.2);
  color: #f43f5e;
}

.dre-btn-inline-cancel:hover {
  background: rgba(244, 63, 94, 0.4);
  transform: scale(1.1);
}

/* Notificação Toast */
.dre-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 18px;
  background: #0f172a;
  border: 1px solid #38bdf8;
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 0.85rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeIn 0.25s ease;
}

/* Coluna: Realizado */
.cell-realizado {
  text-align: right;
  font-family: 'Inter', monospace;
  font-variant-numeric: tabular-nums;
  color: #f1f5f9;
  font-weight: 600;
}

.cell-realizado.negative,
.cell-previsto.negative {
  color: #cbd5e1;
}

/* Coluna: Análise Vertical (AV %) */
.cell-av {
  text-align: right;
  vertical-align: middle;
}

.av-badge-wrapper {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.av-badge {
  font-family: 'Inter', monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.80rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
  line-height: 1.25;
}

.av-account {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.av-subgroup {
  color: #93c5fd;
  background: rgba(147, 197, 253, 0.12);
  font-weight: 700;
  border: 1px solid rgba(147, 197, 253, 0.25);
}

.av-macro {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.16);
  font-weight: 800;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.av-base-100 {
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.18);
  font-weight: 800;
  border: 1px solid rgba(45, 212, 191, 0.45);
}

.av-margin {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.16);
  font-weight: 800;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.av-profit-pos {
  color: #34d399;
  background: rgba(52, 211, 153, 0.16);
  font-weight: 800;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.av-profit-neg {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.16);
  font-weight: 800;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.av-prev-only {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.av-neutral {
  color: #64748b;
  font-size: 0.85rem;
}

.av-subtext {
  font-family: 'Inter', monospace;
  font-size: 0.67rem;
  color: #64748b;
  font-weight: 500;
  opacity: 0.85;
}

/* Coluna: Diferença (R$ e %) */
.cell-diferenca {
  text-align: right;
}

.diff-badge-wrapper {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.diff-amount {
  font-family: 'Inter', monospace;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.diff-pct {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.85;
}

.diff-positive {
  color: #10b981;
}

.diff-negative {
  color: #f43f5e;
}

.diff-neutral {
  color: #64748b;
}

/* Animação suave para expansão e recolhimento */
.dre-child-hidden {
  display: none !important;
}

/* ==========================================================================
   MODAL DE UPLOAD DE PLANILHA DFC
   ========================================================================== */

.btn-dre-upload-trigger {
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.15), rgba(56, 189, 248, 0.15)) !important;
  border-color: rgba(45, 212, 191, 0.4) !important;
  color: #2dd4bf !important;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-dre-upload-trigger:hover {
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.25), rgba(56, 189, 248, 0.25)) !important;
  border-color: #2dd4bf !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(45, 212, 191, 0.2);
}

.dre-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.dre-modal-box {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 95%;
  max-width: 820px;
  max-height: 90vh;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(45, 212, 191, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.dre-modal-header {
  padding: 18px 24px;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.dre-modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dre-modal-icon {
  font-size: 1.5rem;
  background: rgba(45, 212, 191, 0.1);
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(45, 212, 191, 0.2);
}

.dre-modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
}

.dre-modal-subtitle {
  font-size: 0.78rem;
  color: #94a3b8;
  display: block;
  margin-top: 2px;
}

.dre-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.15s;
}

.dre-modal-close:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
}

.dre-modal-body {
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(90vh - 135px);
  overflow-y: auto;
}

.dre-modal-body::-webkit-scrollbar {
  width: 6px;
}

.dre-modal-body::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
}

.dre-modal-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
}

.dre-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(45, 212, 191, 0.4);
}

/* DROPZONE */
.dfc-dropzone {
  border: 2px dashed rgba(45, 212, 191, 0.35);
  background: rgba(45, 212, 191, 0.03);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dfc-dropzone:hover, .dfc-dropzone.dragover {
  border-color: #2dd4bf;
  background: rgba(45, 212, 191, 0.08);
  transform: scale(1.01);
}

.dfc-dropzone-icon {
  margin-bottom: 10px;
}

.dfc-dropzone-title {
  margin: 0 0 4px 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: #e2e8f0;
}

.dfc-dropzone-sub {
  margin: 0 0 8px 0;
  font-size: 0.85rem;
  color: #94a3b8;
}

.dfc-browse-link {
  background: none;
  border: none;
  color: #2dd4bf;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.dfc-dropzone-hint {
  font-size: 0.74rem;
  color: #64748b;
  max-width: 480px;
  margin: 0 auto;
}

/* ARQUIVOS SELECIONADOS */
.dfc-selected-files-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dfc-selected-files-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dfc-selected-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(45, 212, 191, 0.25);
  border-radius: 10px;
  transition: border-color 0.15s;
}

.dfc-selected-file:hover {
  border-color: rgba(45, 212, 191, 0.4);
}

.dfc-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dfc-excel-badge {
  background: #10b981;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.dfc-pdf-badge {
  background: #f43f5e;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.dfc-file-details {
  display: flex;
  flex-direction: column;
}

.dfc-file-name {
  font-size: 0.88rem;
  color: #f1f5f9;
  word-break: break-all;
}

.dfc-file-size {
  font-size: 0.74rem;
  color: #94a3b8;
}

.dfc-btn-remove-file {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: #f43f5e;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.dfc-btn-remove-file:hover {
  background: rgba(244, 63, 94, 0.2);
}

.dfc-add-more-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(45, 212, 191, 0.04);
  border: 1px dashed rgba(45, 212, 191, 0.25);
  border-radius: 8px;
  gap: 12px;
}

.dfc-btn-add-more {
  background: none;
  border: none;
  color: #2dd4bf;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.15s;
}

.dfc-btn-add-more:hover {
  background: rgba(45, 212, 191, 0.12);
  color: #5eead4;
}

.dfc-add-more-hint {
  font-size: 0.74rem;
  color: #64748b;
}

/* PRÉVIA DOS DADOS (PREVIEW CARD) */
.dfc-preview-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.65), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(45, 212, 191, 0.25);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
}

.dfc-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.dfc-preview-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dfc-badge-pill {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(45, 212, 191, 0.12);
  color: #2dd4bf;
  border: 1px solid rgba(45, 212, 191, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dfc-badge-pill.secondary {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.25);
}

.dfc-preview-status-pill {
  font-size: 0.76rem;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dfc-preview-tiles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.dfc-prev-tile {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.dfc-prev-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
}

.dfc-prev-tile.sales {
  border-left: 3px solid #10b981;
}

.dfc-prev-tile.expenses {
  border-left: 3px solid #f43f5e;
}

.dfc-prev-tile.result {
  border-left: 3px solid #38bdf8;
}

.dfc-prev-tile-label {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.2;
}

.dfc-prev-tile-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: #f8fafc;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.25;
  margin-top: 2px;
}

.dfc-prev-tile.sales .dfc-prev-tile-value {
  color: #34d399;
}

.dfc-prev-tile.expenses .dfc-prev-tile-value {
  color: #fb7185;
}

.dfc-prev-tile.result.positive .dfc-prev-tile-value {
  color: #38bdf8;
}

.dfc-prev-tile.result.negative .dfc-prev-tile-value {
  color: #fb7185;
}

.dfc-prev-tile-sub {
  font-size: 0.7rem;
  color: #64748b;
  line-height: 1.3;
}

.dfc-preview-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dfc-breakdown-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.dfc-breakdown-tags {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 768px) {
  .dfc-breakdown-tags {
    grid-template-columns: repeat(2, 1fr);
  }
  .dfc-preview-tiles-grid {
    grid-template-columns: 1fr;
  }
  .dfc-options-grid {
    grid-template-columns: 1fr;
  }
}

.dfc-tag-chip {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: all 0.15s ease;
}

.dfc-tag-chip:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(45, 212, 191, 0.3);
}

.dfc-tag-chip-label {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dfc-tag-chip-val {
  font-size: 0.86rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* OPÇÕES */
.dfc-options-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.dfc-option-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dfc-option-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dfc-select {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #f8fafc;
  padding: 10px 12px;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s;
}

.dfc-select:focus {
  border-color: #2dd4bf;
}

/* PROGRESSO */
.dfc-progress-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dfc-progress-bar-container {
  height: 6px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.dfc-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2dd4bf, #38bdf8);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.dfc-progress-status {
  font-size: 0.82rem;
  color: #38bdf8;
  text-align: center;
  font-weight: 500;
}

/* RESULTADO */
.dfc-result-box {
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.dfc-result-box.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.dfc-result-box.error {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
}

/* FOOTER */
.dre-modal-footer {
  padding: 16px 24px;
  background: #1e293b;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-dre-modal-cancel {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-dre-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

.btn-dre-modal-submit {
  background: linear-gradient(135deg, #0d9488, #0284c7);
  border: none;
  color: #ffffff;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-dre-modal-submit:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}

.btn-dre-modal-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   VISÃO RESUMO EXECUTIVO (GRÁFICOS DE FATURAMENTO & SALDO LÍQUIDO)
   ========================================================================== */

/* Alternador de Modo: Tabela vs Resumo */
.dre-view-mode-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  padding: 3px;
  gap: 3px;
}

.btn-dre-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-dre-mode:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
}

.btn-dre-mode.active {
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.2), rgba(56, 189, 248, 0.15));
  color: #2dd4bf;
  border: 1px solid rgba(45, 212, 191, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Grid de Gráficos */
.dre-summary-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 20px;
  margin-top: 10px;
  margin-bottom: 24px;
}

@media (max-width: 992px) {
  .dre-summary-charts-grid {
    grid-template-columns: 1fr;
  }
}

.dre-chart-card {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s;
}

.dre-chart-card:hover {
  border-color: rgba(45, 212, 191, 0.25);
}

.dre-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}

.dre-chart-title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dre-chart-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}

.dre-chart-subtitle {
  font-size: 0.76rem;
  color: #94a3b8;
}

.dre-chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.74rem;
  color: #94a3b8;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  display: inline-block;
}

.legend-dot.dot-teal {
  background: #2dd4bf;
}

.legend-dot.dot-dashed-cyan {
  border: 1.5px dashed #38bdf8;
  background: transparent;
}

.legend-dot.dot-emerald {
  background: #10b981;
}

.legend-dot.dot-rose {
  background: #f43f5e;
}

.dre-chart-container {
  min-height: 270px;
  position: relative;
  width: 100%;
}

/* Gráficos SVG Nativos */
.dre-svg-chart {
  width: 100%;
  height: 270px;
  overflow: visible;
}

.chart-bar {
  transition: opacity 0.2s, transform 0.2s;
  cursor: pointer;
}

.chart-bar:hover {
  opacity: 0.85;
}

.chart-axis-text {
  font-family: inherit;
  font-size: 10.5px;
  fill: #64748b;
  text-anchor: middle;
}

.chart-grid-line {
  stroke: rgba(255, 255, 255, 0.05);
  stroke-dasharray: 4, 4;
}

.chart-target-line {
  stroke: #38bdf8;
  stroke-width: 2;
  stroke-dasharray: 4, 4;
  fill: none;
}

.chart-zero-line {
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 1.5;
}

/* Tabela Resumo Mini */
.dre-summary-table-card {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.dre-summary-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.dre-summary-year-badge {
  background: rgba(45, 212, 191, 0.1);
  color: #2dd4bf;
  border: 1px solid rgba(45, 212, 191, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.dre-summary-mini-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}

.dre-summary-mini-table th {
  padding: 10px 14px;
  color: #94a3b8;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dre-summary-mini-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
}

.dre-summary-mini-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges de Status na Tabela de Resumo */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
}

.status-pill.status-superada {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-pill.status-abaixo {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-pill.status-apuracao {
  background: rgba(100, 116, 139, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

/* Tooltip Customizado para Gráficos */
.dre-chart-tooltip {
  position: absolute;
  background: #0f172a;
  border: 1px solid rgba(45, 212, 191, 0.4);
  border-radius: 8px;
  padding: 10px 12px;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  font-size: 0.78rem;
  line-height: 1.5;
  color: #f8fafc;
  transform: translate(-50%, -115%);
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}


