/* ==========================================================
   LKJ DRE Dashboard - Modern Clean White Aesthetic Stylesheet
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-main: #FFFFFF;
  --bg-surface: #F8FAFC;
  --bg-card: #FFFFFF;
  --border-color: #E2E8F0;
  --border-light: #F1F5F9;
  
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  
  --primary-blue: #0284C7;
  --primary-blue-light: #E0F2FE;
  --primary-blue-dark: #0369A1;

  --accent-emerald: #059669;
  --accent-emerald-light: #ECFDF5;
  
  --accent-rose: #E11D48;
  --accent-rose-light: #FFF1F2;
  
  --accent-amber: #D97706;
  --accent-amber-light: #FEF3C7;

  --totalizer-bg: #F1F5F9;
  --group-bg: #F8FAFC;
  --subgroup-bg: #FFFFFF;
  --account-bg: #FFFFFF;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #F8FAFC;
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar Personalizada */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #F1F5F9;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Tabela DRE Estilizada */
.dre-table-container {
  overflow-x: auto;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

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

.dre-table thead th {
  background: #F8FAFC;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.775rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 14px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.dre-table th.col-conta,
.dre-table td.col-conta {
  position: sticky;
  left: 0;
  z-index: 5;
  background: inherit;
  min-width: 320px;
  max-width: 420px;
  border-right: 1px solid var(--border-color);
}

.dre-table thead th.col-conta {
  z-index: 15;
  background: #F8FAFC;
}

/* Linhas de Grandes Grupos e Totalizadores */
.row-totalizer {
  background-color: #F1F5F9 !important;
  font-weight: 700;
  color: #0F172A;
  border-top: 2px solid #CBD5E1;
  border-bottom: 2px solid #CBD5E1;
}

.row-totalizer td {
  padding: 12px 14px;
  font-size: 0.925rem;
}

.row-grupo {
  background-color: #F8FAFC !important;
  font-weight: 700;
  color: #1E293B;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.row-grupo:hover {
  background-color: #EDF2F7 !important;
}

.row-grupo td {
  padding: 11px 14px;
  font-size: 0.885rem;
}

.row-subgrupo {
  background-color: #FFFFFF !important;
  font-weight: 600;
  color: #334155;
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.row-subgrupo:hover {
  background-color: #F8FAFC !important;
}

.row-subgrupo td {
  padding: 9px 14px;
}

.row-conta {
  background-color: #FFFFFF;
  color: #475569;
  border-bottom: 1px solid #F8FAFC;
  transition: background-color 0.15s ease;
}

.row-conta:hover {
  background-color: #F0F9FF !important;
}

.row-conta td {
  padding: 8px 14px;
  font-size: 0.825rem;
}

.val-positive {
  color: #059669;
}

.val-negative {
  color: #DC2626;
}

.val-neutral {
  color: #64748B;
}

.cell-clickable {
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.cell-clickable:hover {
  background-color: #E0F2FE;
  color: #0284C7;
  font-weight: 600;
  text-decoration: underline;
}

/* Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.725rem;
  font-weight: 600;
}

.badge-quitado {
  background-color: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.badge-aberto {
  background-color: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

/* Modal e Drawer */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 50;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.drawer-backdrop.active {
  display: block;
  opacity: 1;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 90%;
  max-width: 950px;
  background: #FFFFFF;
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.15);
  z-index: 55;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.drawer-backdrop.active .drawer-panel {
  transform: translateX(0);
}

/* Animações suaves de expand/collapse */
.toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  margin-right: 8px;
  transition: transform 0.2s ease, background-color 0.15s ease;
  color: #64748B;
}

.toggle-icon:hover {
  background-color: #E2E8F0;
  color: #0F172A;
}

.toggle-icon.expanded {
  transform: rotate(90deg);
}

/* Indicador de % AV */
.av-badge {
  font-size: 0.7rem;
  color: #64748B;
  display: block;
  font-weight: 400;
  margin-top: 1px;
}

/* Utilitário para ocultar elementos com máxima especificidade */
.hidden {
  display: none !important;
}

/* Fixação e Ancoragem do Chat Valuta AI estritamente no Canto Inferior Direito */
#valuta-chat-modal {
  position: fixed !important;
  right: 1.5rem !important;
  left: auto !important;
  bottom: 5rem !important;
  transform-origin: bottom right;
}

@media (max-width: 640px) {
  #valuta-chat-modal {
    right: 0.75rem !important;
    left: auto !important;
    bottom: 5rem !important;
  }
}


