/* ===== VARIÁVEIS CSS ===== */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --dark: #1e293b;
  --light: #f8fafc;
  --gray: #64748b;
  --gray-light: #e2e8f0;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
}

/* ===== RESET E ESTILOS BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--dark);
  line-height: 1.6;
}

/* ===== LAYOUT PRINCIPAL ===== */
.main-content {
  min-height: 100vh;
  transition: var(--transition);
}

@media (min-width: 768px) {
  .main-content {
    margin-left: 280px;
  }
}

/* ===== HEADER ===== */
header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: 15px;
}

.sticky-top {
  position: sticky;
  top: 0;
  z-index: 1020;
}

/* ===== CARDS ===== */
.stat-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  opacity: 0;
  transition: var(--transition);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(15px);
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.employee-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow);
  transition: var(--transition);
  height: 100%;
}

.employee-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.employee-card.border-danger {
  border: 2px solid var(--danger);
}

/* ===== TIPOGRAFIA ===== */
.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-trend {
  font-size: 0.875rem;
  font-weight: 500;
}

.text-primary-emphasis {
  color: var(--primary-dark) !important;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== ÍCONES ===== */
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: var(--transition);
}

.stat-icon-sm {
  width: 36px;
  height: 36px;
  font-size: 1rem;
}

.floating {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

/* ===== AVATARS ===== */
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
}

.avatar-sm {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-lg);
}

/* ===== BOTÕES ===== */
.btn-modern {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem 1.5rem;
  color: var(--dark);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-modern:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  color: var(--primary);
}

/* ===== BADGES ===== */
.badge-modern {
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== TABS ===== */
.nav-tabs-custom {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  gap: 0.5rem;
}

.nav-tabs-custom .nav-link {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem 1.5rem;
  color: var(--gray);
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: -1px;
  white-space: nowrap;
}

.nav-tabs-custom .nav-link.active {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--primary);
  font-weight: 600;
}

.nav-tabs-custom .nav-link:hover {
  background: rgba(255, 255, 255, 0.85);
  color: var(--primary);
}

/* ===== FORMULÁRIOS ===== */
.search-box {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem 1rem;
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.search-box:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  outline: none;
}

/* ===== INDICADORES ===== */
.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-online {
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.status-offline {
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

.pulse-red {
  animation: pulse-animation 2s infinite;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); /* vermelho */
}

@keyframes pulse-animation {
  0% {
    box-shadow: 0 0 0 0 rgba(238, 71, 71, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(245, 18, 18, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(172, 19, 19, 0);
  }
}



.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(42, 250, 122, 0.7);
  }
  
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* ===== BARRAS DE PROGRESSO ===== */
.progress-bar-custom {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  height: 6px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--warning), var(--danger));
  border-radius: 10px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ===== ESTADOS VAZIOS ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h5 {
  margin-bottom: 0.5rem;
  color: var(--gray);
}

/* ===== MODAL ===== */
.modal-glass {
  backdrop-filter: blur(10px);
}

.modal-content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding: 1.5rem;
}

.modal-body {
  padding: 1.5rem;
}

/* ===== ANIMAÇÕES ===== */
.fa-spin {
  animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== UTILITÁRIOS RESPONSIVOS ===== */
.min-w-0 {
  min-width: 0;
}

.flex-grow-1 {
  flex-grow: 1;
}

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

/* ===== RESPONSIVIDADE ===== */

/* Telas pequenas (mobile) */
@media (max-width: 576px) {
  .container-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  .stat-label {
    font-size: 0.7rem;
  }
  
  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  .avatar {
    width: 40px;
    height: 40px;
  }
  
  .avatar-lg {
    width: 60px;
    height: 60px;
  }
  
  .btn-modern {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  .nav-tabs-custom .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  .glass-card,
  .stat-card,
  .employee-card {
    padding: 1rem !important;
  }
  
  .empty-state {
    padding: 2rem 1rem;
  }
  
  .empty-state i {
    font-size: 2rem;
  }
  
  .time-display {
    font-size: 0.8rem;
  }
}

/* Telas muito pequenas (mobile pequeno) */
@media (max-width: 360px) {
  .col-6 {
    width: 100%;
  }
  
  .stat-value {
    font-size: 1.25rem;
  }
  
  .stat-label {
    font-size: 0.65rem;
  }
  
  .time-display {
    font-size: 0.75rem;
  }
  
  .btn-modern span {
    display: none;
  }
  
  .user-info-card .d-none.d-md-block {
    display: none !important;
  }
}

/* Telas médias (tablet) */
@media (min-width: 577px) and (max-width: 768px) {
  .stat-value {
    font-size: 1.75rem;
  }
  
  .avatar {
    width: 44px;
    height: 44px;
  }
  
  .glass-card,
  .stat-card,
  .employee-card {
    padding: 1.25rem !important;
  }
}

/* Telas grandes (desktop) */
@media (min-width: 769px) {
  .main-content {
    margin-left: 280px;
  }
  
  .stat-value {
    font-size: 2rem;
  }
}

/* Ajustes específicos para o gráfico */
.chart-container {
  position: relative;
  height: 200px;
  width: 100%;
}

/* Scroll personalizado */
.nav-tabs-custom {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.nav-tabs-custom::-webkit-scrollbar {
  height: 4px;
}

.nav-tabs-custom::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.nav-tabs-custom::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.nav-tabs-custom::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Estados de hover para mobile */
@media (hover: none) {
  .stat-card:hover,
  .glass-card:hover,
  .employee-card:hover,
  .btn-modern:hover {
    transform: none;
  }
  
  .stat-card::before {
    opacity: 1;
  }
}

/* Acessibilidade - foco visível */
.btn-modern:focus-visible,
.search-box:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --light: #1e293b;
    --dark: #f8fafc;
    --gray: #94a3b8;
    --gray-light: #334155;
  }
  
  .stat-card,
  .glass-card,
  .employee-card,
  .modal-content {
    background: rgba(30, 41, 59, 0.9);
    color: var(--dark);
  }
  
  .search-box {
    background: rgba(30, 41, 59, 0.9);
    color: var(--dark);
  }
  
  .search-box::placeholder {
    color: var(--gray);
  }
  
  .text-dark {
    color: var(--dark) !important;
  }
  
  .text-muted {
    color: var(--gray) !important;
  }
}

/* Impressão */
@media print {
  .btn-modern,
  .nav-tabs-custom,
  .pulse {
    display: none !important;
  }
  
  .stat-card,
  .glass-card,
  .employee-card {
    background: white !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
  }
}

/* Estilos responsivos adicionais */
        @media (max-width: 576px) {
            .avatar-sm {
                width: 48px;
                height: 48px;
            }
            
            .stat-icon-sm {
                width: 36px;
                height: 36px;
                font-size: 14px;
            }
            
            .stat-card {
                padding: 1rem !important;
            }
            
            .employee-card {
                padding: 1rem !important;
            }
            
            .glass-card {
                padding: 1rem !important;
            }
            
            .btn-modern {
                padding: 0.5rem !important;
            }
        }
        
        @media (max-width: 768px) {
            .main-content {
                margin-left: 0;
            }
            
            .nav-tabs-custom {
                overflow-x: auto;
                flex-wrap: nowrap;
            }
            
            .nav-tabs-custom .nav-item {
                white-space: nowrap;
            }
        }
        
        /* Melhorias para telas muito pequenas */
        @media (max-width: 360px) {
            .col-6 {
                width: 100%;
            }
            
            .time-display {
                font-size: 0.8rem;
            }
            
            .stat-label {
                font-size: 0.7rem;
            }
            
            .stat-value {
                font-size: 1.25rem !important;
            }
        }