/* CONVERSE - Sistema Profissional de Processamento de Notas Fiscais */

/* ==== VARIÁVEIS GLOBAIS DE CORES ==== */
:root {
  --primary-color: #2c3e50;       /* Azul escuro corporativo */
  --primary-light: #34495e;       /* Variação mais clara */
  --secondary-color: #3498db;     /* Azul mais vivo para destaque */
  --accent-color: #e67e22;        /* Laranja para ações importantes */
  --success-color: #27ae60;       /* Verde para sucessos/aprovações */
  --danger-color: #e74c3c;        /* Vermelho para alertas/erros */
  --warning-color: #f39c12;       /* Amarelo para avisos */
  --light-gray: #f5f7fa;          /* Cinza bem claro para fundos */
  --medium-gray: #e9ecef;         /* Cinza médio para bordas */
  --dark-gray: #7f8c8d;           /* Cinza escuro para textos secundários */
  --text-color: #2c3e50;          /* Cor principal para textos */
  --white: #ffffff;               /* Branco */
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Sombra padrão */
  --sidebar-width: 250px;         /* Largura da sidebar expandida */
  --sidebar-collapsed-width: 70px;/* Largura da sidebar recolhida */
  --sidebar-transition: 0.3s;     /* Tempo de transição da sidebar */
  --navbar-height: 64px;          /* Altura da navbar */
}

/* ==== ESTILOS BÁSICOS ==== */
body {
  font-family: 'Roboto', 'Segoe UI', sans-serif;
  color: var(--text-color);
  background-color: var(--light-gray);
  padding: 0;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  width: 100%;
}

/* ==== SIDEBAR ==== */
.sidebar-professional {
  width: var(--sidebar-width);
  background-color: var(--primary-color);
  color: var(--white);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--sidebar-transition) ease, left var(--sidebar-transition) ease;
  z-index: 1030;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

/* Configuração da sidebar em modo desktop (collapsed/expanded) */
.sidebar-professional.collapsed {
  width: var(--sidebar-collapsed-width);
}

/* Configuração da sidebar em modo desktop */
@media (min-width: 993px) {
  .sidebar-professional {
    left: 0 !important; /* Força a sidebar a ser visível em desktop */
  }
  
  /* Garante que o conteúdo principal esteja corretamente posicionado */
  .main-content {
    margin-left: var(--sidebar-width);
    transition: margin-left var(--sidebar-transition) ease;
    width: calc(100% - var(--sidebar-width));
  }
  
  .main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
  }
  
  /* Esconde a navbar em dispositivos desktop */
  .navbar-professional {
    display: none;
  }
}

/* Configuração da sidebar em modo mobile */
@media (max-width: 992px) {
  .sidebar-professional.open {
    left: 0 !important;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  }
  
  /* Quando não estiver aberta, mantenha fora da tela */
  .sidebar-professional:not(.open) {
    left: -300px !important;
    width: 280px !important;
    max-width: 280px !important;
  }
  
  /* Garante que o conteúdo principal ocupe toda a largura */
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding-top: var(--navbar-height);
  }
  
  /* Exibição da navbar em dispositivos móveis */
  .navbar-professional {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1030;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }
  
  /* Melhora o botão de menu em telas pequenas */
  #mobile-sidebar-toggle {
    display: block;
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.25rem;
    padding: 0.5rem;
  }
  
  /* Ajusta os itens da sidebar em dispositivos móveis */
  .sidebar-item {
    padding: 0.75rem 1rem;
  }
  
  .sidebar-link {
    padding: 0.5rem 0.75rem;
  }
  
  /* Melhora a visibilidade do texto na sidebar mobile */
  .sidebar-text {
    opacity: 1;
    display: inline-block;
    margin-left: 0.75rem;
  }
}

.sidebar-brand {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative; /* Adicionado para posicionamento absoluto dos filhos */
  height: 64px; /* Altura fixa para manter a consistência */
}

.sidebar-brand a {
  transition: opacity var(--sidebar-transition) ease, visibility var(--sidebar-transition) ease;
}

.sidebar-professional.collapsed .sidebar-brand a {
  opacity: 0;
  visibility: hidden;
  width: 0;
  overflow: hidden;
}

.sidebar-brand img {
  height: 40px;
  transition: all 0.3s ease;
}

.sidebar-toggle {
  background-color: var(--primary-light);
  border: none;
  color: var(--white);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
  position: absolute; /* Posicionamento absoluto para manter no mesmo lugar quando a sidebar for recolhida */
  right: 1rem;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-professional.collapsed .sidebar-toggle {
  right: 50%;
  transform: translateX(50%);
  background-color: var(--secondary-color);
}

.sidebar-toggle:hover {
  background-color: var(--secondary-color);
}

.sidebar-menu {
  list-style: none;
  padding: 1rem 0;
  margin: 0;
}

.sidebar-item {
  width: 100%;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-professional.collapsed .sidebar-link {
  padding: 0.75rem;
  justify-content: center;
}

.sidebar-link:hover, 
.sidebar-link.active {
  color: var(--white);
  background-color: var(--primary-light);
}

.sidebar-link.active {
  border-left: 4px solid var(--secondary-color);
}

.sidebar-professional.collapsed .sidebar-link.active {
  border-left: none;
  border-left-width: 0;
  border-bottom: 4px solid var(--secondary-color);
}

.sidebar-icon {
  width: 20px;
  margin-right: 1rem;
  font-size: 1.25rem;
  text-align: center;
}

.sidebar-professional.collapsed .sidebar-icon {
  margin-right: 0;
  font-size: 1.5rem;
}

.sidebar-text {
  transition: opacity var(--sidebar-transition) ease;
}

.sidebar-professional.collapsed .sidebar-text {
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
}

.sidebar-user {
  display: flex;
  align-items: center;
  color: var(--white);
  padding: 0.5rem 1rem;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-professional.collapsed .sidebar-user {
  justify-content: center;
}

.sidebar-user-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
  font-size: 1.25rem;
}

.sidebar-professional.collapsed .sidebar-user-icon {
  margin-right: 0;
}

.sidebar-username {
  font-weight: 500;
  transition: opacity var(--sidebar-transition) ease;
}

.sidebar-professional.collapsed .sidebar-username {
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
}

.btn-logout-sidebar {
  width: 100%;
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-logout-sidebar:hover {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
}

.btn-logout-sidebar i {
  margin-right: 0.5rem;
}

.sidebar-professional.collapsed .btn-logout-sidebar i {
  margin-right: 0;
}

.btn-logout-text {
  transition: opacity var(--sidebar-transition) ease;
}

.sidebar-professional.collapsed .btn-logout-text {
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ==== CONTEÚDO PRINCIPAL ==== */
.main-content {
  flex: 1;
  background-color: var(--light-gray);
  min-height: 100vh;
  transition: margin-left var(--sidebar-transition) ease, width var(--sidebar-transition) ease;
  display: flex;
  flex-direction: column;
  padding-bottom: 1rem;
  position: relative;
}

/* Conteúdo da página dentro do main-content */
.page-content {
  flex: 1 0 auto;
  padding: 1.5rem;
}

/* Configuração da main-content para diferentes tamanhos de tela */
@media (min-width: 993px) {
  .main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
  }
  
  .main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
  }
}

@media (max-width: 992px) {
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding-top: var(--navbar-height);
  }
  
  .page-content {
    padding: 1rem 0.75rem;
  }
}

/* ==== NAVBAR PROFISSIONAL ==== */
.navbar-professional {
  display: none; /* Por padrão, escondida no desktop */
  align-items: center;
  padding: 0.75rem 1.25rem;
  background-color: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  height: var(--navbar-height);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  width: 100%;
  transition: all 0.3s ease;
}

.navbar-professional .container-fluid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.navbar-professional .navbar-brand {
  display: flex;
  align-items: center;
}

.navbar-professional .navbar-brand img {
  height: 36px;
  transition: transform 0.2s ease;
}

/* Exibição da navbar apenas em dispositivos móveis */
@media (max-width: 992px) {
  .navbar-professional {
    display: flex;
  }
}

/* Hamburger Menu Button */
.navbar-toggler {
  display: none;
  background: transparent;
  border: none;
  width: 40px;
  height: 40px;
  padding: 8px;
  cursor: pointer;
  position: relative;
  z-index: 1030;
  border-radius: 50%;
  transition: background-color 0.3s;
}

.navbar-toggler:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Hamburger Icon com animação */
.hamburger-icon {
  position: relative;
  width: 24px;
  height: 18px;
  transform: rotate(0deg);
  transition: .5s ease-in-out;
  cursor: pointer;
}

.hamburger-icon span {
  display: block;
  position: absolute;
  height: 2px;
  width: 100%;
  background: var(--primary-color);
  border-radius: 2px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: .25s ease-in-out;
}

.hamburger-icon span:nth-child(1) {
  top: 0px;
}

.hamburger-icon span:nth-child(2), .hamburger-icon span:nth-child(3) {
  top: 8px;
}

.hamburger-icon span:nth-child(4) {
  top: 16px;
}

/* Animação para hamburger ativo */
.hamburger-icon.open span:nth-child(1) {
  top: 8px;
  width: 0%;
  left: 50%;
}

.hamburger-icon.open span:nth-child(2) {
  transform: rotate(45deg);
}

.hamburger-icon.open span:nth-child(3) {
  transform: rotate(-45deg);
}

.hamburger-icon.open span:nth-child(4) {
  top: 8px;
  width: 0%;
  left: 50%;
}

/* Resto dos estilos navbar */
.navbar-toggler i {
  color: var(--primary-color);
  font-size: 1.25rem;
  display: none; /* Esconde o ícone original do Font Awesome */
}

@media (max-width: 992px) {
  .navbar-toggler {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .main-content {
    margin-top: 0;
    padding-top: 64px; /* Altura da navbar */
  }
  
  /* Ajusta a navbar para ficar fixa no topo em telas pequenas */
  .navbar-professional {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1030;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-left: 0 !important;
  }
  
  /* Ajusta o conteúdo principal para não ficar escondido sob a navbar */
  .main-content {
    padding-top: 64px;
  }
}

.navbar-professional .navbar-brand:hover img {
  transform: scale(1.05);
}

.navbar-professional .nav-link {
  color: var(--white) !important;
  font-weight: 500;
  padding: 0.7rem 1rem;
  transition: all 0.3s ease;
  border-radius: 4px;
  margin: 0 2px;
}

.navbar-professional .nav-link:hover {
  background-color: var(--primary-light);
}

.navbar-professional .nav-link.active {
  background-color: var(--secondary-color);
  color: var(--white) !important;
}

.navbar-professional .navbar-text {
  font-size: 0.9rem;
  color: var(--text-color);
  font-weight: 500;
  display: flex;
  align-items: center;
}

.navbar-professional .navbar-text i {
  font-size: 1.1rem;
  margin-right: 0.5rem;
  color: var(--secondary-color);
}

.navbar-professional .dropdown-menu {
  border: none;
  box-shadow: var(--box-shadow);
  border-radius: 0.5rem;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
}

.navbar-professional .dropdown-item {
  padding: 0.6rem 1.5rem;
  transition: all 0.2s ease;
}

.navbar-professional .dropdown-item:hover {
  background-color: var(--light-gray);
  color: var(--primary-color);
}

.navbar-professional .btn-logout {
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: var(--white);
  transition: all 0.3s ease;
}

.navbar-professional .btn-logout:hover {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
}

/* ==== DASHBOARD CARDS ==== */
.dashboard-card {
  border: none;
  border-radius: 0.75rem;
  box-shadow: var(--box-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  height: 100%;
}

.dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.dashboard-card .card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--medium-gray);
  padding: 1.25rem 1.5rem;
}

.dashboard-card .card-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--dark-gray);
  margin-bottom: 0;
}

.dashboard-card .card-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0.5rem 0;
}

.dashboard-card .card-body {
  padding: 1rem;
}

.dashboard-card .card-footer {
  background-color: transparent;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--medium-gray);
}

.icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* ==== TABELAS PROFISSIONAIS ==== */
.table-professional {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background-color: var(--white);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: var(--box-shadow);
  margin-bottom: 0;
}

.table-professional thead th {
  background-color: var(--primary-color);
  color: var(--white);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  padding: 1rem 1.5rem;
  border-bottom: 2px solid var(--primary-light);
  text-align: left;
  white-space: nowrap;
}

.table-professional tbody tr {
  transition: background-color 0.2s ease;
}

.table-professional tbody tr:hover {
  background-color: rgba(52, 152, 219, 0.05);
}

.table-professional tbody tr:nth-child(even) {
  background-color: rgba(245, 247, 250, 0.5);
}

.table-professional tbody td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--medium-gray);
  vertical-align: middle;
}

.table-professional .btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  transition: all 0.2s ease;
  margin: 0 0.2rem;
}

.table-professional .btn-primary-action {
  background-color: var(--secondary-color);
  color: var(--white);
}

.table-professional .btn-danger-action {
  background-color: var(--danger-color);
  color: var(--white);
}

.table-professional .btn-primary-action:hover {
  background-color: #2980b9;
}

.table-professional .btn-danger-action:hover {
  background-color: #c0392b;
}

.table-professional .status-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 50px;
  letter-spacing: 0.5px;
}

.table-professional .status-active {
  background-color: rgba(39, 174, 96, 0.15);
  color: var(--success-color);
}

.table-professional .status-inactive {
  background-color: rgba(231, 76, 60, 0.15);
  color: var(--danger-color);
}

.table-professional .table-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* ==== FORMULÁRIOS PROFISSIONAIS ==== */
.form-professional {
  background-color: var(--white);
  border-radius: 0.75rem;
  box-shadow: var(--box-shadow);
  padding: 2rem;
}

.form-professional .form-label {
  font-weight: 500;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.form-professional .form-control {
  border: 1px solid var(--medium-gray);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
}

.form-professional .form-control:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.15);
}

.form-professional .form-control.is-invalid {
  border-color: var(--danger-color);
}

.form-professional .invalid-feedback {
  font-size: 0.85rem;
  color: var(--danger-color);
  margin-top: 0.5rem;
}

.form-professional .btn-submit {
  background-color: var(--secondary-color);
  border: none;
  color: var(--white);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.form-professional .btn-submit:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
}

/* ==== CARDS DE LOGIN E REGISTRO ==== */
.auth-card {
  max-width: 450px;
  margin: 0 auto;
  padding: 2.5rem;
  background-color: var(--white);
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.auth-card .auth-header {
  text-align: center;
  margin-bottom: 2rem;
  
}

.auth-card .auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.auth-card .auth-subtitle {
  font-size: 1rem;
  color: var(--dark-gray);
}

.auth-card .form-control {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--medium-gray);
}

.auth-card .form-control:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.15);
}

.auth-card .btn-auth {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.5rem;
  margin-top: 1rem;
  background-color: var(--secondary-color);
  border: none;
  color: var(--white);
  transition: all 0.3s ease;
}

.auth-card .btn-auth:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
}

.auth-card .auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--dark-gray);
}

.auth-card .auth-link {
  color: var(--secondary-color);
  font-weight: 500;
  transition: color 0.2s ease;
}

.auth-card .auth-link:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* ==== COMPONENTES DE NOTAS FISCAIS ==== */
.invoice-viewer {
  background-color: var(--white);
  border-radius: 0.75rem;
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--medium-gray);
}

.invoice-company-info {
  flex: 1;
}

.invoice-details {
  background-color: var(--light-gray);
  padding: 1rem;
  border-radius: 0.5rem;
  min-width: 280px;
}

.invoice-field {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.invoice-field-label {
  font-weight: 500;
  color: var(--dark-gray);
}

.invoice-field-value {
  font-weight: 600;
  color: var(--primary-color);
}

.invoice-items {
  margin-top: 2rem;
}

/* ==== FILTROS AVANÇADOS ==== */
.filter-panel {
  background-color: var(--white);
  border-radius: 0.75rem;
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.filter-panel .filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.filter-panel .filter-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0;
}

.filter-panel .filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.filter-panel .filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-panel .btn-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--secondary-color);
  color: var(--white);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.filter-panel .btn-filter:hover {
  background-color: #2980b9;
}

.filter-panel .btn-clear {
  background-color: transparent;
  color: var(--dark-gray);
  border: 1px solid var(--medium-gray);
}

.filter-panel .btn-clear:hover {
  background-color: var(--light-gray);
  color: var(--primary-color);
}

/* ==== BADGES E INDICADORES ==== */
.badge-professional {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 50px;
  letter-spacing: 0.5px;
}

.badge-primary {
  background-color: rgba(52, 152, 219, 0.15);
  color: var(--secondary-color);
}

.badge-success {
  background-color: rgba(39, 174, 96, 0.15);
  color: var(--success-color);
}

.badge-warning {
  background-color: rgba(243, 156, 18, 0.15);
  color: var(--warning-color);
}

.badge-danger {
  background-color: rgba(231, 76, 60, 0.15);
  color: var(--danger-color);
}

/* ==== UTILITÁRIOS ==== */
.shadow-sm-hover {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.shadow-sm-hover:hover {
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.bg-primary-gradient {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  color: var(--white);
}

.bg-secondary-gradient {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
  color: var(--white);
}

.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==== CONTEÚDO DA PÁGINA ==== */
.page-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Ajustes para garantir que o conteúdo preencha todo o espaço disponível */
.container-fluid.py-4 {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.row.h-100 {
  flex: 1;
  margin-bottom: 0;
}

/* ==== FOOTER ==== */
.footer-professional {
  background-color: var(--light-gray);
  padding: 0.5rem 0;
  text-align: center;
  border-top: 1px solid var(--medium-gray);
  width: 100%;
  position: relative; /* Isso permite que o footer siga o fluxo natural */
  margin-top: auto;
}

.footer-professional p {
  margin-bottom: 0;
  font-size: 0.875rem;
  color: var(--dark-gray);
}

/* ==== SPINNER ==== */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
  transition: opacity 0.3s, visibility 0.3s;
}

.spinner-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--white);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: var(--box-shadow);
}

.spinner-border {
  width: 3rem;
  height: 3rem;
  color: var(--secondary-color);
}

.spinner-text {
  margin-top: 1rem;
  font-weight: 500;
  color: var(--primary-color);
}

/* ==== RESPONSIVIDADE ==== */
@media (max-width: 768px) {
  .table-professional {
    font-size: 0.9rem;
  }
  
  .table-professional .btn-icon {
    width: 28px;
    height: 28px;
  }
  
  .form-professional {
    padding: 1.25rem;
  }
  
  .auth-card {
    padding: 1.25rem;
  }
  
  .table-responsive {
    overflow-x: auto;
  }
  
  /* Ajustes adicionais para a sidebar em telas médias */
  .sidebar-professional {
    width: 260px !important;
    max-width: 260px !important;
    left: -260px;
  }
  
  /* Ajuste no tamanho de fonte dos textos da sidebar */
  .sidebar-text {
    font-size: 0.95rem;
  }
  
  .sidebar-footer {
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 576px) {
  .navbar-professional .navbar-brand img {
    max-height: 30px;
  }
  
  .dashboard-card .card-body {
    padding: 0.75rem;
  }
  
  .table-professional thead th,
  .table-professional tbody td {
    padding: 0.5rem 0.75rem;
  }
  
  .icon-circle {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .table-professional tbody td {
    font-size: 0.85rem;
  }
  
  /* Ajustes para melhorar a densidade de informação */
  .row.mb-4 {
    margin-bottom: 0.5rem !important;
  }
  
  .col-xl-3.col-md-6.mb-4 {
    margin-bottom: 0.5rem !important;
  }
  
  .dashboard-card .card-body {
    padding: 0.75rem;
  }
  
  /* Ajuste nos ícones para melhor visualização */
  .icon-circle {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  /* Ajustes específicos para a sidebar em telas muito pequenas */
  .sidebar-professional {
    width: 240px !important;
    max-width: 240px !important;
    left: -240px;
  }
  
  .sidebar-link {
    padding: 0.6rem 1rem;
  }
  
  .sidebar-icon {
    font-size: 1.1rem;
  }
  
  .sidebar-text {
    font-size: 0.9rem;
  }
}

.table-responsive.h-100 {
  flex: 1;
  max-height: none;
}

/* Ajustes para quando não houver dados suficientes */
.dashboard-card.flex-grow-1 {
  display: flex;
  flex-direction: column;
  height: auto;
  margin-bottom: 0 !important;
}

.dashboard-card.flex-grow-1 .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
}

/* Ajuste para quando não há empresas */
.alert.flex-grow-1 {
  margin-bottom: 0 !important;
}

/* Adiciona um overlay para a sidebar em dispositivos móveis */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1025;
  opacity: 0;
  transition: opacity 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
  cursor: pointer;
}

/* Previne scroll quando a sidebar está aberta */
body.sidebar-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Ajustes para dispositivos muito pequenos */
@media (max-width: 400px) {
  .sidebar-professional {
    width: 230px !important;
    max-width: 230px !important;
    left: -230px;
  }
  
  .sidebar-link {
    padding: 0.5rem 0.85rem;
  }
  
  .sidebar-icon {
    font-size: 1rem;
    margin-right: 0.75rem;
  }
  
  .sidebar-text {
    font-size: 0.85rem;
  }
  
  .sidebar-user-icon {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
  
  .sidebar-footer {
    padding: 0.6rem 0.85rem;
  }
  
  .sidebar-username {
    font-size: 0.85rem;
  }
  
  .btn-logout-sidebar {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
  }
}

/* ==== ESTILOS PARA SIDEBAR RESPONSIVA ==== */
.sidebar-professional {
  width: var(--sidebar-width);
  background-color: var(--primary-color);
  color: var(--white);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--sidebar-transition) ease, left var(--sidebar-transition) ease;
  z-index: 1030;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

/* Garante que a sidebar fique visível em desktop */
@media (min-width: 993px) {
  .sidebar-professional {
    left: 0 !important; /* Força a sidebar a ser visível em desktop */
  }
}

/* Garante comportamento correto em mobile */
@media (max-width: 992px) {
  .sidebar-professional.open {
    left: 0 !important;
  }
  
  /* Quando não estiver aberta, mantenha fora da tela */
  .sidebar-professional:not(.open) {
    left: -300px !important;
  }
}

/* Estado ativo do botão de hamburger */
.navbar-toggler.active {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Ajuste de posição para o botão hamburger */
@media (max-width: 992px) {
  /* Efeito da navbar quando hamburger está ativo */
  body.sidebar-open .navbar-professional {
    box-shadow: none;
  }
  
  /* Efeito visual quando hamburger está ativo */
  body.sidebar-open .navbar-toggler {
    background-color: rgba(0, 0, 0, 0.05);
  }
  
  /* Deixa a sidebar mais elevada que outros elementos */
  .sidebar-professional.open {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  }
  
  /* Ajustes para navbar em dispositivos móveis muito pequenos */
  @media (max-width: 360px) {
    .navbar-professional .navbar-brand img {
      height: 30px;
    }
    
    .navbar-professional {
      padding: 0.5rem 1rem;
    }
    
    .hamburger-icon {
      width: 20px;
      height: 16px;
    }
    
    .hamburger-icon span:nth-child(2), 
    .hamburger-icon span:nth-child(3) {
      top: 7px;
    }
    
    .hamburger-icon span:nth-child(4) {
      top: 14px;
    }
  }
}

/* Ajuste adicional para evitar que a sidebar fique sob a navbar */
.sidebar-professional.open {
  box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
}

/* Ajustes finais para a aparência da navbar */
.navbar-professional {
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.navbar-professional .navbar-brand img:hover {
  transform: scale(1.05);
}

/* Melhoria no aspecto visual da navbar em modo mobile */
@media (max-width: 992px) {
  .navbar-professional {
    background-color: #fff;
  }
  
  body.sidebar-open .navbar-professional {
    background-color: #fcfcfc;
  }
} 