:root {
  /* Paleta Principal (Light Mode) inspirado no layout "Money Personal Workspace" */
  --primary-color: #16845B; /* Verde-esmeralda */
  --primary-hover: #126949;
  --bg-color: #F1F4F2;      /* Fundo off-white com levíssimo tom de sage/verde */
  --surface-color: #FFFFFF; /* Branco para os cards */
  --text-color: #1E293B;    /* Texto principal escuro */
  --text-muted: #64748B;    /* Cinza secundário */
  --border-color: #E4EAE6;  /* Borda bem suave */
  
  --sidebar-bg: var(--bg-color); /* Fundo invisível/contínuo no light mode */
  --sidebar-text: #475569;
  --sidebar-hover: rgba(22, 132, 91, 0.08); /* Hover verde bem clarinho */

  /* Semânticas */
  --success-color: #16845B; 
  --error-color: #C2414B;   
  --warning-color: #A16207; 
  --info-color: #2563EB;    
  
  /* Espaçamentos e Bordas */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  
  --radius-md: 0.5rem;
  --radius-lg: 1rem; /* Cards bem mais arredondados, aprox 16px */

  /* Tipografia Escala */
  --font-main: 'Inter', sans-serif;
  --text-balance: 36px;
  --text-page-title: 26px;
  --text-card-balance: 26px;
  --text-section-title: 17px;
  --text-body: 14.5px;
  --text-meta: 12.5px;
}

/* Tema Escuro (Dark Mode) */
[data-theme="dark"] {
  --bg-color: #081711;       /* Fundo verde super escuro, quase preto */
  --surface-color: #0D261C;  /* Verde-pinho escuro para os cards */
  --text-color: #F1F4F2;     
  --text-muted: #94A3B8;
  --border-color: #153A2A;   /* Borda verde escuro */
  
  --sidebar-bg: var(--bg-color);
  --sidebar-text: #F1F4F2;
  --sidebar-hover: #153A2A;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
  font-size: var(--text-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
}

/* Typography Hierarchy */
h1 { font-size: var(--text-page-title); font-weight: 600; margin-bottom: var(--spacing-sm); }
h2 { font-size: var(--text-section-title); font-weight: 600; margin-bottom: var(--spacing-sm); }
h3 { font-size: var(--text-section-title); font-weight: 600; margin-bottom: var(--spacing-sm); }
.text-meta { font-size: var(--text-meta); font-weight: 400; color: var(--text-muted); }
.text-muted { color: var(--text-muted); }

/* Touch friendly inputs and buttons for mobile */
button, input, select, textarea {
  font-family: inherit;
  font-size: var(--text-body);
}

input, select, textarea {
  width: 100%;
  padding: 0.75rem var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--surface-color);
  color: var(--text-color);
  transition: border-color 0.2s, background-color 0.3s, color 0.3s;
  min-height: 48px; /* Touch target size */
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(22, 132, 91, 0.15); 
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem var(--spacing-md);
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  min-height: 48px; /* Touch target size */
  width: 100%;
  text-decoration: none;
}

.btn:hover {
  background-color: var(--primary-hover);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-outline:hover {
  background-color: rgba(22, 132, 91, 0.05); 
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-md);
}

/* Forms */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
  color: var(--text-color);
}

/* Utility */
.text-center { text-align: center; }
.mt-4 { margin-top: var(--spacing-xl); }
.mb-4 { margin-bottom: var(--spacing-xl); }

/* Responsive adjustments */
@media (max-width: 768px) {
  :root {
    --text-balance: 24px;
    --text-page-title: 20px;
    --text-card-balance: 20px;
    --text-section-title: 15px;
    --text-body: 13px;
    --text-meta: 11px;
    
    --spacing-md: 0.75rem;
    --spacing-lg: 1rem;
    --spacing-xl: 1.25rem;
  }
}

@media (min-width: 768px) {
  .btn {
    width: auto;
  }
}
