/* Configurações globais */
html {
  font-size: 14px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
}

/* Estilos para área do usuário na navbar */
.user-info {
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.user-info:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar i {
  color: #fff;
  transition: color 0.3s ease;
}

.user-details .user-name {
  font-size: 0.9rem;
  line-height: 1.2;
  color: #fff;
}

.user-details .user-role {
  font-size: 0.75rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.8);
}

.dropdown-header {
  padding: 12px 16px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

.dropdown-header .fw-semibold {
  color: #495057;
  font-size: 0.95rem;
}

.dropdown-header .text-muted {
  font-size: 0.8rem;
}

/* Responsividade para dispositivos móveis */
@media (max-width: 767.98px) {
  .user-details {
    display: none !important;
  }
  
  .user-info {
    padding: 4px;
  }
}

/* Estilos de foco melhorados */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #0d6efd;
}

html {
  position: relative;
  min-height: 100%;
}

/* Estilos de formulário melhorados */
.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Cards modernos */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Estilos para submenu dropdown */
.dropdown-submenu {
  position: relative;
}

.dropdown-submenu > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -6px;
  margin-left: -1px;
  border-radius: 0 6px 6px 6px;
  display: none;
}

.dropdown-submenu:hover > .dropdown-menu,
.dropdown-submenu .dropdown-menu.show {
  display: block;
}

.dropdown-submenu > a:after {
  display: block;
  content: " ";
  float: right;
  width: 0;
  height: 0;
  border-color: transparent;
  border-style: solid;
  border-width: 5px 0 5px 5px;
  border-left-color: #6c757d;
  margin-top: 5px;
  margin-right: -10px;
}

.dropdown-submenu:hover > a:after {
  border-left-color: #495057;
}

.dropdown-submenu.pull-left {
  float: none;
}

.dropdown-submenu.pull-left > .dropdown-menu {
  left: -100%;
  margin-left: 10px;
  border-radius: 6px 0 6px 6px;
}

/* Melhorar visibilidade do submenu */
.dropdown-submenu > a {
  position: relative;
}

.dropdown-submenu > a::after {
  content: "▶";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #6c757d;
}

/* Removed conflicting card-header style */
/* 
.card-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px 12px 0 0 !important;
  border: none;
  padding: 1.25rem;
} 
*/

.card-body {
  padding: 1.5rem;
}

/* Botões modernos */
.btn {
  border-radius: 8px;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
  box-shadow: 0 2px 8px rgba(86, 171, 47, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, #4e9a2a 0%, #96d4b8 100%);
  transform: translateY(-1px);
}

.btn-warning {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 2px 8px rgba(240, 147, 251, 0.3);
}

.btn-warning:hover {
  background: linear-gradient(135deg, #ee82f9 0%, #f3455a 100%);
  transform: translateY(-1px);
}

.btn-info {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

.btn-info:hover {
  background: linear-gradient(135deg, #3d9bfd 0%, #00e0fd 100%);
  transform: translateY(-1px);
}

/* Tabelas modernas */
.table {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.table thead th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  font-weight: 600;
  padding: 1rem;
}

.table tbody tr {
  transition: all 0.3s ease;
}

.table tbody tr:hover {
  background-color: #f8f9ff;
  transform: scale(1.01);
}

.table tbody td {
  padding: 1rem;
  border-color: #e9ecef;
  vertical-align: middle;
}

/* Formulários modernos */
.form-control, .form-select {
  border-radius: 8px;
  border: 2px solid #e9ecef;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
}

/* Dashboard cards especiais */
.dashboard-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #333 !important; /* Força texto preto */
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.dashboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(30px, -30px);
}

.dashboard-card-icon {
  font-size: 3rem;
  opacity: 0.8;
  margin-bottom: 1rem;
}

.dashboard-card-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.dashboard-card-label {
  font-size: 1rem;
  opacity: 0.9;
}

/* Alertas modernos */
.alert {
  border: none;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  border-left: 4px solid;
}

.alert-success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border-left-color: #28a745;
  color: #155724;
}

.alert-danger {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border-left-color: #dc3545;
  color: #721c24;
}

.alert-warning {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border-left-color: #ffc107;
  color: #856404;
}

.alert-info {
  background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
  border-left-color: #17a2b8;
  color: #0c5460;
}

/* Navegação melhorada */
.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
}

.nav-link {
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-link:hover {
  transform: translateY(-1px);
}

.dropdown-menu {
  border-radius: 12px;
  border: none;
  padding: 0.5rem 0;
}

.dropdown-item {
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
}

.dropdown-item:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transform: translateX(5px);
}

/* Animações */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Força cor preta para títulos de cards em todo o sistema */
.card-header, 
.card-header h1, 
.card-header h2, 
.card-header h3, 
.card-header h4, 
.card-header h5, 
.card-header h6, 
.card-title {
    color: #333 !important;
}

/* Dashboard Cards Específicos */
.dashboard-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 2rem;
    color: #333 !important; /* Texto preto forçado */
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.dashboard-card * {
    color: #333 !important; /* Força cor preta para todos os elementos filhos */
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.dashboard-card:hover::before {
    animation: shimmer 1.5s ease-in-out;
    opacity: 1;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.dashboard-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.dashboard-card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.dashboard-card-value {
    font-size: 2.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dashboard-card-label {
    font-size: 1rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Animações de entrada */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards secundários melhorados */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
    padding: 1.25rem;
    font-weight: 600;
    color: #333; /* Texto preto */
    border-radius: 15px 15px 0 0;
}

.card-body {
    padding: 1.5rem;
}

/* Botões de ação rápida melhorados */
.btn {
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Progress bars melhoradas */
.progress {
    border-radius: 10px;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.1);
}

.progress-bar {
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

/* Tabelas melhoradas */
.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, #495057 0%, #6c757d 100%);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
    transform: scale(1.01);
}

/* Badges melhorados */
.badge {
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    font-weight: 500;
    font-size: 0.8rem;
}

/* Alerts melhorados */
.alert {
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

/* Responsividade */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .dashboard-card {
        margin-bottom: 1rem;
        min-height: 150px;
        padding: 1.5rem;
    }
    
    .dashboard-card-value {
        font-size: 1.8rem;
    }
    
    .dashboard-card-icon {
        font-size: 2.5rem;
    }
    
    .btn {
        font-size: 0.9rem;
    }
    
    .display-6 {
        font-size: 1.5rem;
    }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.product-img {
  width: 200px;
  height: 150px;
  object-fit: contain;
}
.table th, .table td { vertical-align: middle; }
.product-thumb-cell { width: 80px; text-align: center; }
.product-img { display: block; margin: 0 auto; }
