:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary-color: #64748b;
  --accent-color: #f1f5f9;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
  --text-color: #1e293b;
  --light-bg: #f8fafc;
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, var(--light-bg) 0%, #e2e8f0 100%);
  color: var(--text-color);
  min-height: 100vh;
  padding: 20px;
  line-height: 1.6;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeIn 0.8s ease-out;
}

.header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-top: 1rem;
  position: relative;
}

.logo {
  width: 80px;
  height: 80px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: var(--card-shadow);
  position: relative;
}

.logo i {
  font-size: 2.5rem;
  color: white;
}

.header h1 {
  font-weight: 700;
  color: var(--text-color);
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.header p {
  color: var(--secondary-color);
  font-size: 1.1rem;
}

.user-info {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  box-shadow: var(--card-shadow);
}

.user-info-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.user-details h3 {
  margin: 0;
  font-weight: 600;
}

.user-details p {
  margin: 0.25rem 0 0 0;
  opacity: 0.9;
}

.logout-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.card-custom {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
  border: none;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

.card-custom:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.15);
}

.form-label {
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.form-label i {
  margin-right: 0.5rem;
  color: var(--primary-color);
}

.form-control {
  padding: 0.875rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  border: none;
  padding: 1rem 2rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px var(--primary-color);
}

.btn-download {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px -5px var(--success-color);
  color: white;
}

.alert-custom {
  border-radius: 12px;
  padding: 1.25rem;
  border: none;
  font-weight: 500;
}

.footer {
  text-align: center;
  margin-top: 3rem;
  color: var(--secondary-color);
  font-size: 0.9rem;
}

.security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  color: var(--secondary-color);
  font-size: 0.85rem;
}

/* Status Indicator Styles */
.status-indicator {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 1000;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transition: var(--transition);
  animation: slideInRight 0.5s ease-out;
  cursor: pointer;
}

.status-online {
  background-color: var(--success-color);
  animation: pulseSuccess 2s infinite, glowSuccess 3s infinite alternate;
}

.status-offline {
  background-color: var(--error-color);
  animation: pulseError 2s infinite, glowError 3s infinite alternate;
}

.status-checking {
  background-color: var(--warning-color);
  animation: pulseChecking 1.5s infinite, glowChecking 2s infinite alternate;
}

.status-degraded {
  background-color: var(--info-color);
  animation: pulseDegraded 2s infinite, glowDegraded 3s infinite alternate;
}

/* Efeito de pulso suave */
@keyframes pulseSuccess {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

@keyframes pulseError {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@keyframes pulseChecking {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

@keyframes pulseDegraded {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

/* Efeito de brilho/glow */
@keyframes glowSuccess {
  0% { box-shadow: 0 0 5px var(--success-color), 0 0 10px rgba(16, 185, 129, 0.3); }
  100% { box-shadow: 0 0 8px var(--success-color), 0 0 15px rgba(16, 185, 129, 0.5); }
}

@keyframes glowError {
  0% { box-shadow: 0 0 5px var(--error-color), 0 0 10px rgba(239, 68, 68, 0.3); }
  100% { box-shadow: 0 0 8px var(--error-color), 0 0 15px rgba(239, 68, 68, 0.5); }
}

@keyframes glowChecking {
  0% { box-shadow: 0 0 5px var(--warning-color), 0 0 10px rgba(245, 158, 11, 0.3); }
  100% { box-shadow: 0 0 8px var(--warning-color), 0 0 15px rgba(245, 158, 11, 0.5); }
}

@keyframes glowDegraded {
  0% { box-shadow: 0 0 5px var(--info-color), 0 0 10px rgba(59, 130, 246, 0.3); }
  100% { box-shadow: 0 0 8px var(--info-color), 0 0 15px rgba(59, 130, 246, 0.5); }
}

/* Toast notification */
.status-toast {
  position: fixed;
  top: 40px;
  right: 15px;
  z-index: 1000;
  padding: 8px 12px;
  border-radius: 6px;
  color: white;
  font-weight: 500;
  font-size: 0.8rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-width: 220px;
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.8);
  display: none;
}

.status-toast.show {
  transform: translateX(0);
  opacity: 1;
  display: block;
}

/* Efeito de surpresa */
@keyframes magicAppear {
  0% {
    opacity: 0;
    transform: scale(0) rotate(180deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.2) rotate(-10deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.magic-appear {
  animation: magicAppear 0.6s ease-out;
}

/* Tabela de contracheques */
.table-container {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
}

.contracheques-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.contracheques-table th {
  background: var(--accent-color);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-color);
  border-bottom: 2px solid #e2e8f0;
}

.contracheques-table td {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.contracheques-table tr:hover {
  background: var(--accent-color);
}

.no-records {
  text-align: center;
  padding: 3rem;
  color: var(--secondary-color);
}

.no-records i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--secondary-color);
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  margin-right: 10px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Password Strength */
.password-strength {
  height: 4px;
  margin-top: 5px;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.password-weak { background-color: #dc3545; width: 25%; }
.password-medium { background-color: #ffc107; width: 50%; }
.password-strong { background-color: #198754; width: 75%; }
.password-very-strong { background-color: #198754; width: 100%; }

.form-requirements {
  font-size: 0.85rem;
  color: #6c757d;
}

.requirement-met {
  color: #198754;
}

.requirement-unmet {
  color: #6c757d;
}

/* Admin Styles */
.actions-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.action-btn {
  flex: 1;
  min-width: 110px;
  font-size: 0.7rem;
  padding: 0.4rem 0.6rem;
  white-space: nowrap;
}

/* Lista específica */
.user-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 14px 24px;
  border-radius: 12px;
  margin: 1.5rem 0;
  text-align: center;
  font-weight: 600;
  font-size: 1.1rem;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.table-custom {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.table-custom thead th {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  padding: 1.2rem;
  font-weight: 600;
  text-align: center;
}

.table-custom tbody td {
  padding: 1.2rem;
  vertical-align: middle;
  border-color: #f1f5f9;
}

.table-custom tbody tr {
  transition: all 0.2s ease;
}

.table-custom tbody tr:hover {
  background-color: var(--primary-light);
  transform: translateX(5px);
}

.back-btn {
  background: var(--secondary-color);
  color: white;
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  font-weight: 500;
}

.back-btn:hover {
  color: white;
  background: #475569;
  transform: translateY(-1px);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state i {
  font-size: 4rem;
  color: #cbd5e1;
  margin-bottom: 1rem;
}

.month-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
}

.year-badge {
  background: #f1f5f9;
  color: var(--secondary-color);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
}

/* Admin buttons */
.admin-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
}

.admin-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  color: white;
}

/* Hover effects */
.contracheques-table tr.hover-effect {
  background: var(--accent-color) !important;
  transform: translateX(5px);
  transition: var(--transition);
}

/* Responsividade */
@media (max-width: 768px) {
  .app-container {
    max-width: 100%;
  }
  
  .header h1 {
    font-size: 1.8rem;
  }
  
  .user-info-content {
    flex-direction: column;
    text-align: center;
  }
  
  .table-container {
    padding: 1rem;
    overflow-x: auto;
  }
  
  .contracheques-table {
    font-size: 0.9rem;
  }
  
  .contracheques-table th,
  .contracheques-table td {
    padding: 0.75rem 0.5rem;
  }
  
  .mobile-stack {
    flex-direction: column;
  }
  
  .mobile-text-center {
    text-align: center;
  }
  
  .mobile-padding {
    padding: 0.75rem;
  }
  
  .mobile-table-text {
    font-size: 0.8rem;
  }
  
  .nav-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }
  
  .nav-buttons a {
    flex: 1;
    min-width: 140px;
    text-align: center;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
  }
  
  .user-actions {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .action-btn {
    min-width: 90px;
    font-size: 0.65rem;
    padding: 0.35rem 0.5rem;
  }
  
  .mobile-hidden {
    display: none;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .table-container {
    overflow-x: auto;
  }
  
  .user-info-mobile {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 576px) {
  body {
    padding: 15px;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .card-custom {
    padding: 1.5rem;
  }

  .logo {
    width: 70px;
    height: 70px;
  }

  .logo i {
    font-size: 2rem;
  }

  .status-indicator {
    top: 10px;
    right: 10px;
    width: 14px;
    height: 14px;
  }

  .status-toast {
    top: 30px;
    right: 10px;
    font-size: 0.75rem;
    max-width: 180px;
  }
  
  .btn-download {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
  
  .action-btn {
    min-width: 80px;
    font-size: 0.6rem;
    padding: 0.3rem 0.4rem;
  }
  
  .nav-buttons a {
    min-width: 120px;
    font-size: 0.75rem;
  }
  
  .table-responsive {
    font-size: 0.9rem;
  }
  
  .btn-download {
    width: 100%;
    justify-content: center;
  }
}

/* Garantir que a tabela seja responsiva */
.table-responsive {
  border-radius: 12px;
  overflow: hidden;
}

/* Melhorar aparência dos botões */
.btn-download {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px -5px var(--success-color);
  color: white;
}

/* Ajustes para a tabela */
.contracheques-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: white;
}

.contracheques-table th {
  background: var(--accent-color);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-color);
  border-bottom: 2px solid #e2e8f0;
}

.contracheques-table td {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
  transition: var(--transition);
}

.contracheques-table tr:last-child td {
  border-bottom: none;
}

/* Container da tabela */
.table-container {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
}

/* Mensagem quando não há registros */
.no-records {
  text-align: center;
  padding: 3rem;
  color: var(--secondary-color);
}

.no-records i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--secondary-color);
  opacity: 0.7;
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}