body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f4f8;
    color: #334155;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}
.container {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.15), 0 6px 12px -2px rgba(0, 0, 0, 0.08);
    padding: 40px;
    width: 100%;
    max-width: 1200px;
    overflow: hidden;
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 15px;
}
.header-logo {
    height: 40px;
    width: auto;
    margin-right: 10px;
    flex-shrink: 0;
}
.header-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1e293b;
    flex-grow: 1;
}
.api-link {
    padding: 10px 20px; /* Reduzido */
    background-color: #4c8bf5;
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
}
.api-link:hover {
    background-color: #3a75e0;
    transform: translateY(-2px);
}

.filter-form {
    display: flex;
    flex-wrap: wrap; 
    gap: 16px; /* Ajustado */
    margin-bottom: 24px; /* Reduzido */
    background-color: #fcfdfe;
    padding: 20px; /* Reduzido */
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 180px;
}
.form-group.date-range-group {
    min-width: 160px;
}
.label {
    font-weight: 600;
    margin-bottom: 6px; /* Reduzido */
    color: #475569;
    font-size: 0.95rem;
}
.select-input, .date-input, .text-input {
    padding: 8px 12px; /* Reduzido */
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    color: #334155;
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}
.select-input:focus, .date-input:focus, .text-input:focus {
    outline: none;
    border-color: #4c8bf5;
    box-shadow: 0 0 0 3px rgba(76, 139, 245, 0.2);
}
.custom-select-container { position: relative; width: 100%; }
.select-selected { background-color: #ffffff; border: 1px solid #cbd5e1; padding: 8px 12px; cursor: pointer; user-select: none; position: relative; padding-right: 30px; } /* Reduzido */
.select-selected:after { position: absolute; content: ""; top: 12px; right: 10px; width: 0; height: 0; border: 6px solid transparent; border-color: #334155 transparent transparent transparent; } /* Ajustado */
.select-selected.select-arrow-active:after { border-color: transparent transparent #334155 transparent; top: 5px; } /* Ajustado */
.select-items { position: absolute; background-color: #ffffff; border: 1px solid #cbd5e1; border-top: none; z-index: 99; top: 100%; left: 0; right: 0; max-height: 200px; overflow-y: auto; border-radius: 0 0 8px 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); }
.select-hide { display: none; }
.select-item-label { padding: 8px 12px; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: background-color 0.2s ease; } /* Reduzido */
.select-item-label:hover { background-color: #f0f4f8; }
.custom-checkbox { width: 18px; height: 18px; cursor: pointer; }
.hidden-radio-input { position: absolute; opacity: 0; width: 0; height: 0; }

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    width: 100%;
    padding-top: 10px;
}

.filter-button, .clear-button {
    padding: 10px 20px; /* Reduzido */
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    white-space: nowrap;
}
.filter-button { background-color: #4c8bf5; color: white; }
.filter-button:hover { background-color: #3a75e0; transform: translateY(-2px); }
.clear-button { background-color: #ef4444; color: white; }
.clear-button:hover { background-color: #dc2626; transform: translateY(-2px); }

.filter-summary-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 15px; margin-bottom: 30px; padding: 0 20px; }
.value-filter-button { padding: 10px 20px; border: none; border-radius: 10px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); } /* Reduzido */
.value-filter-button:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }
.value-filter-button.income-filter { background-color: #d1fae5; color: #065f46; }
.value-filter-button.income-filter.active, .value-filter-button.income-filter:hover { background-color: #10b981; color: white; }
.value-filter-button.expense-filter { background-color: #fee2e2; color: #991b1b; }
.value-filter-button.expense-filter.active, .value-filter-button.expense-filter:hover { background-color: #ef4444; color: white; }
.value-filter-button.all-values-filter { background-color: #e0f2fe; color: #1e40af; }
.value-filter-button.all-values-filter.active, .value-filter-button.all-values-filter:hover { background-color: #3b82f6; color: white; }

.summary-button-item { padding: 10px 20px; border-radius: 10px; font-weight: 600; display: flex; align-items: center; gap: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); } /* Reduzido */
.summary-button-item span:first-child { font-size: 0.95rem; color: #475569; }
.summary-button-item .value { font-size: 1.1rem; font-weight: 700; }
.summary-button-item.income { background-color: #d1fae5; color: #065f46; }
.summary-button-item.expense { background-color: #fee2e2; color: #991b1b; }

.table-container { border-radius: 12px; overflow-x: auto; box-shadow: 0 5px 15px -3px rgba(0, 0, 0, 0.08); border: 1px solid #e2e8f0; margin-top: 20px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background-color: #ffffff; }
th, td { text-align: left; padding: 15px 20px; border-bottom: 1px solid #e2e8f0; }
th { background-color: #f8fafc; font-weight: 700; color: #475569; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.05em; }
table thead tr:first-child th:first-child { border-top-left-radius: 12px; }
table thead tr:first-child th:last-child { border-top-right-radius: 12px; }
.table-row-item:nth-child(even) { background-color: #f8fafc; }
.table-row-item:hover { background-color: #f1f5f9; }
td.text-right, th.text-right { text-align: right; }
table tbody tr:last-child td { border-bottom: none; }

.no-data { text-align: center; padding: 40px; font-style: italic; color: #64748b; }
.total-summary-container { margin-top: 30px; display: flex; justify-content: flex-end; }
.total-summary-table { width: auto; max-width: 350px; }
.total-label { font-weight: 700; color: #1e293b; font-size: 1.2rem; }
.total-value { font-weight: 800; color: #22c55e; font-size: 1.3rem; }
.total-value.negative { color: #ef4444; }

.add-movement-section { 
    margin-top: 0; /* Removido */
    background-color: #f8fafc; 
    border-radius: 12px; 
    box-shadow: 0 5px 15px -3px rgba(0, 0, 0, 0.08); 
    border: 1px solid #e2e8f0; 
    padding: 24px; /* Reduzido */
}
.add-movement-section h2 { 
    font-size: 1.8rem; 
    font-weight: 700; 
    color: #1e293b; 
    margin-bottom: 20px; /* Reduzido */
    text-align: center; 
}
.add-movement-form { display: flex; flex-direction: column; gap: 16px; } /* Reduzido */
.add-movement-form .form-row { display: flex; flex-wrap: wrap; gap: 16px; } /* Ajustado */
.add-movement-form .form-group { flex: 1; min-width: 180px; }
.add-movement-form .form-group.checkbox-group { flex-direction: row; align-items: center; gap: 10px; min-width: unset; }
.add-movement-form .label-checkbox { margin-bottom: 0; }
.add-movement-form .checkbox-input { width: 20px; height: 20px; }
.form-actions { display: flex; justify-content: flex-end; gap: 15px; margin-top: 10px; }
.add-button, .cancel-button { padding: 12px 24px; border: none; border-radius: 10px; font-weight: 600; cursor: pointer; transition: background-color 0.3s ease, transform 0.2s ease; } /* Reduzido */
.add-button { background-color: #22c55e; color: white; }
.add-button:hover { background-color: #16a34a; transform: translateY(-2px); }
.cancel-button { background-color: #64748b; color: white; }
.cancel-button:hover { background-color: #475569; transform: translateY(-2px); }
.action-buttons-cell { white-space: nowrap; text-align: center; }
.edit-button, .delete-button { padding: 8px 15px; border: none; border-radius: 8px; font-weight: 500; cursor: pointer; transition: background-color 0.2s ease; margin: 0 5px; }
.edit-button { background-color: #ffc107; color: #333; }
.edit-button:hover { background-color: #e0a800; }
.delete-button { background-color: #dc3545; color: white; }
.delete-button:hover { background-color: #c82333; }

.chart-container { position: relative; width: 80%; max-width: 600px; height: 400px; margin: 30px auto; padding: 20px; background-color: #ffffff; border-radius: 12px; box-shadow: 0 5px 15px -3px rgba(0, 0, 0, 0.08); border: 1px solid #e2e8f0; }
#category-transactions-section { margin-top: 30px; padding: 20px; background-color: #f8fafc; border-radius: 12px; box-shadow: 0 5px 15px -3px rgba(0,0,0,0.08); border: 1px solid #e2e8f0; }
#category-transactions-section h3 { font-size: 1.5rem; font-weight: 700; color: #1e293b; margin-bottom: 20px; text-align: center; }
#category-transactions-section table { width: 100%; border-collapse: collapse; margin-top: 0; }
#category-transactions-section th, #category-transactions-section td { padding: 12px 15px; border-bottom: 1px solid #e2e8f0; text-align: left; }
#category-transactions-section th { background-color: #f0f4f8; }
#category-transactions-section .table-row-item:nth-child(even) { background-color: #ffffff; }
#category-transactions-section .table-row-item:hover { background-color: #e6e9ed; }
#category-transactions-section .text-right { text-align: right; }

/* --- NOVAS CLASSES ADICIONADAS AQUI --- */

/* Cor para valores positivos, para manter a consistência */
.positive {
    color: #22c55e;
}

/* Estilos para a barra de rolagem customizada */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9; /* Cor de fundo da trilha */
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #94a3b8; /* Cor da barra de rolagem */
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #64748b; /* Cor da barra ao passar o mouse */
}


@media (max-width: 900px) {
    .filter-form, .add-movement-form .form-row { flex-direction: column; align-items: stretch; }
    .form-group, .filter-actions button, .add-button, .cancel-button { width: 100%; }
    .filter-summary-controls { flex-direction: column; align-items: stretch; padding: 0; }
    .value-filter-button, .summary-button-item { width: 100%; justify-content: center; }
    .summary-button-item { justify-content: space-between; }
    .chart-container { width: 95%; height: 300px; }
}

/* Adicione no final de static/css/style.css */
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  /* Cores base para light e dark mode */
  body {
    @apply bg-slate-100 text-slate-700;
    @apply dark:bg-slate-900 dark:text-slate-300;
  }
}

@layer components {
  .container {
    @apply bg-white;
    @apply dark:bg-slate-800;
  }
  .header-title {
      @apply text-gray-900;
      @apply dark:text-gray-100;
  }
  /* ... e assim por diante para outros componentes ... */
  th {
      @apply bg-slate-50 text-slate-600;
      @apply dark:bg-slate-700 dark:text-slate-300;
  }
  
  tr:nth-child(even) {
      @apply bg-slate-50;
      @apply dark:bg-slate-800;
  }
  tr:hover {
      @apply bg-slate-100;
      @apply dark:bg-slate-700;
  }
  td {
      @apply border-slate-200;
      @apply dark:border-slate-700;
  }
  .label {
      @apply text-slate-600;
      @apply dark:text-slate-400;
  }
  .text-input, .date-input, .select-input, .select-selected {
      @apply bg-white border-slate-300 text-slate-800;
      @apply dark:bg-slate-700 dark:border-slate-600 dark:text-slate-200 dark:placeholder-slate-400;
  }
}

/* Substitua o conteúdo ou adicione as classes dark: */
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  body {
    @apply bg-slate-100 text-slate-700 transition-colors duration-300;
    @apply dark:bg-slate-900 dark:text-slate-300;
  }
}

@layer components {
  .container {
    @apply bg-white dark:bg-slate-800;
  }
  .header-title {
    @apply text-gray-900 dark:text-gray-100;
  }
  .label {
      @apply text-slate-600 dark:text-slate-400;
  }
  .text-input, .date-input, .select-input {
      @apply bg-white border-slate-300 text-slate-800 focus:ring-blue-500/50;
      @apply dark:bg-slate-700 dark:border-slate-600 dark:text-slate-200 dark:placeholder-slate-400 dark:focus:ring-blue-500/30;
  }
  .select-selected {
      @apply bg-white border-slate-300;
      @apply dark:bg-slate-700 dark:border-slate-600;
  }
  .select-selected:after {
    @apply border-t-slate-600 dark:border-t-slate-300;
  }
  .select-items {
      @apply bg-white border-slate-300;
      @apply dark:bg-slate-700 dark:border-slate-600;
  }
  .select-item-label:hover {
      @apply bg-slate-100 dark:bg-slate-600;
  }
  table {
      @apply text-slate-700 dark:text-slate-300;
  }
  th {
      @apply bg-slate-50 text-slate-600 border-b border-slate-200;
      @apply dark:bg-slate-700/50 dark:text-slate-300 dark:border-b-slate-700;
  }
  td {
      @apply border-b border-slate-200 dark:border-b-slate-700;
  }
  tr:last-child td {
      @apply border-b-0;
  }
  tbody tr:nth-child(even) {
      @apply bg-slate-50 dark:bg-transparent;
  }
  tbody tr:hover {
      @apply bg-slate-100 dark:bg-slate-700;
  }
  /* ... continue para outros elementos conforme necessário ... */
}

.spinner {
    border: 3px solid #f3f3f3; /* Light grey */
    border-top: 3px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto; /* Centraliza o spinner na célula */
}

.spinner-inline {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
