.financial-categories-with-tabs-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--background);
}

// Estilos para conteúdo das abas
.financial-categories-list-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  
  app-data-table {
    flex: 1;
    min-height: 0; // Importante para flex funcionar corretamente
  }
}

.main-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 1rem 0;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 1rem;
  
  h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
  }
}

.financial-categories-count {
  color: var(--text-secondary);
  font-size: 0.9rem;
  background: var(--surface);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--divider);
}

// Estilos para edição de categoria financeira
.financial-category-edit-content {
  height: 100%;
  padding: 1rem;
}

.financial-category-form-container {
  max-width: 800px;
  margin: 0 auto;
  
  h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
  }
}

.financial-category-details {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.detail-section {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid var(--divider);
  
  h4 {
    margin: 0 0 1rem 0;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 600;
  }
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  
  label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  span {
    color: var(--text-primary);
    font-size: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--divider);
  }
}

// Loading state
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  gap: 1rem;
  
  p {
    color: var(--text-secondary);
    font-size: 0.9rem;
  }
}

// 🎯 ESTILOS PARA BADGES DE TIPOS DE CATEGORIAS FINANCEIRAS
::ng-deep .category-type-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  margin: 0.125rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  
  &:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  }
  
  // 💰 Receita (Verde)
  &.type-income {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    color: white;
    border: 1px solid #047857;
    
    &:hover {
      box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
    }
  }
  
  // 💸 Despesa (Vermelho)
  &.type-expense {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: 1px solid #dc2626;
    
    &:hover {
      box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    }
  }
  
  // 📈 Investimento (Azul)
  &.type-investment {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: 1px solid #1d4ed8;
    
    &:hover {
      box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
    }
  }
  
  // 🔄 Transferência (Roxo)
  &.type-transfer {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: 1px solid #7c3aed;
    
    &:hover {
      box-shadow: 0 2px 6px rgba(139, 92, 246, 0.4);
    }
  }
  
  // 🎯 Fallback para tipos não mapeados (IDT Yellow)
  &.type-default {
    background: linear-gradient(135deg, var(--idt-primary-color) 0%, #e6b800 100%);
    color: #1a1a1a;
    border: 1px solid #e6b800;
    
    &:hover {
      box-shadow: 0 2px 6px rgba(255, 200, 46, 0.4);
    }
  }
}

// 🎯 ESTILOS PARA BADGES DE STATUS
::ng-deep .status-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  margin: 0.125rem;
  transition: all 0.2s ease;
  text-transform: none;
  
  &.status-active {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    box-shadow: none;
    
    &:hover {
      background: #c3e6cb;
      transform: translateY(-1px);
      box-shadow: 0 2px 4px rgba(21, 87, 36, 0.15);
    }
  }
  
  &.status-inactive {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    box-shadow: none;
    
    &:hover {
      background: #f5c6cb;
      transform: translateY(-1px);
      box-shadow: 0 2px 4px rgba(114, 28, 36, 0.15);
    }
  }
}

// 🌙 Dark theme support para badges
.dark-theme ::ng-deep .category-type-badge {
  &.type-income {
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
    
    &:hover {
      box-shadow: 0 2px 6px rgba(16, 185, 129, 0.5);
    }
  }
  
  &.type-expense {
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3);
    
    &:hover {
      box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
    }
  }
  
  &.type-investment {
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
    
    &:hover {
      box-shadow: 0 2px 6px rgba(59, 130, 246, 0.5);
    }
  }
  
  &.type-transfer {
    box-shadow: 0 1px 3px rgba(139, 92, 246, 0.3);
    
    &:hover {
      box-shadow: 0 2px 6px rgba(139, 92, 246, 0.5);
    }
  }
  
  &.type-default {
    box-shadow: 0 1px 3px rgba(255, 200, 46, 0.3);
    
    &:hover {
      box-shadow: 0 2px 6px rgba(255, 200, 46, 0.5);
    }
  }
}

// Responsividade
@media (max-width: 768px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
  
  .main-content {
    padding: 0;
  }
  
  .financial-categories-list-content {
    padding: 0;
  }

  .financial-category-edit-content {
    padding: 0;
  }

  .financial-categories-with-tabs-container {
    margin: 0;
    padding: 0;
  }

  .section-header {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
  }

  .detail-section {
    border-radius: 0;
    margin: 0;
    box-shadow: none;
    border-left: none;
    border-right: none;
  }

  .financial-category-form-container {
    max-width: 100%;
    margin: 0;
    
    h3 {
      margin: 0 0 1rem 0;
      padding: 0.5rem;
    }
  }

  ::ng-deep app-data-table {
    margin: 0;
    padding: 0;
    
    .table-menu {
      padding: 0.25rem 0.5rem;
      margin: 0;
      border-radius: 0;
      border-left: none;
      border-right: none;
    }

    .data-table-container {
      border-left: none;
      border-right: none;
      border-radius: 0;
      margin: 0;
    }

    .pagination {
      padding: 0.75rem 0.5rem;
      margin: 0;
      border-left: none;
      border-right: none;
    }

    .table-header,
    .table-footer {
      padding: 0.5rem;
      margin: 0;
    }

    table {
      margin: 0;
      
      th, td {
        &:first-child {
          padding-left: 0.5rem;
        }
        &:last-child {
          padding-right: 0.5rem;
        }
      }
    }
  }

  ::ng-deep app-custom-tabs {
    margin-top: 0;
    padding-top: 0;
    
    .nav-tabs {
      margin-top: 0;
      padding-top: 0;
      border-radius: 0;
    }
    
    .tab-content {
      margin: 0;
      padding: 0;
    }
  }

  .domain-container {
    padding: 0.25rem;
  }
}

// Dark theme support
@media (prefers-color-scheme: dark) {
  .financial-categories-with-tabs-container {
    background-color: #121212;

    .financial-categories-list-section,
    .financial-categories-tabs-section {
      background: #1e1e1e;
      color: #e0e0e0;

      .section-header {
        background: #2a2a2a;
        border-bottom-color: #333;

        h2 {
          color: #e0e0e0;
        }

        .financial-categories-count,
        .tabs-info {
          background: #0d47a1;
          border-color: #1565c0;
          color: #e3f2fd;
        }
      }
    }

    .financial-category-tab-content {
      .tab-financial-category-header {
        background: #2a2a2a;
        border-bottom-color: #333;

        .financial-category-details {
          h3 {
            color: #e0e0e0;
          }

          p {
            color: #bbb;
          }
        }
      }

      .financial-category-form-container {
        .form-section {
          ::ng-deep {
            .mat-mdc-card {
              background: #2a2a2a;
              color: #e0e0e0;
            }

            .mat-mdc-text-field-wrapper {
              background-color: #333 !important;
            }

            input[readonly] {
              color: #e0e0e0 !important;
            }

            .mat-mdc-form-field-label {
              color: #bbb !important;
            }
          }
        }
      }

      .loading-state {
        color: #bbb;
      }
    }
  }
  
  // 🌙 Dark theme support para badges de status
  ::ng-deep .status-badge {
    &.status-active {
      background: #1b5e20;
      color: #a5d6a7;
      border: 1px solid #2e7d32;
      
      &:hover {
        background: #2e7d32;
        box-shadow: 0 2px 4px rgba(165, 214, 167, 0.3);
      }
    }
    
    &.status-inactive {
      background: #b71c1c;
      color: #ffcdd2;
      border: 1px solid #d32f2f;
      
      &:hover {
        background: #d32f2f;
        box-shadow: 0 2px 4px rgba(255, 205, 210, 0.3);
      }
    }
  }
}

.domain-container {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

app-tab-system {
  flex: 1;
  min-height: 0;
} 