* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8fafc;
}

/* Login Page */
.login-page {
  /* * CÓDIGO ACTUALIZADO: REEMPLAZA EL GRADIENTE POR LA IMAGEN 
     */

  /* Fondo de respaldo: Verde césped por si la imagen falla */
  background-color: #dfeef6ff;

  /* 1. Establecer la imagen de fondo. AJUSTA LA RUTA SI ES NECESARIO */
  background-image: url("/assets/img/fondo2.png");

  /* 2. Propiedades para que la imagen se vea bien */
  background-size: cover; /* Cubre toda la pantalla */
  background-position: center center; /* Centra la imagen */
  background-repeat: no-repeat; /* No repite la imagen */
  background-attachment: fixed; /* Mantiene la imagen fija */

  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
}

/* Ensure footer is below login card (not floating beside it) */
.login-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.login-page .login-container {
  margin-top: auto; /* push container to center vertically but keep footer below */
  margin-bottom: 0; /* allow footer to appear after */
}

/* Prevent large container padding from inflating footer area: when footer follows a .container reduce gap */
.container + .site-footer,
.container ~ .site-footer {
  margin-top: 0; /* remove extra gap */
}

/* If footer is placed inside a .container (some pages might include), force minimal padding inside */
.site-footer .footer-content {
  padding: 0 6px; /* minimal inner padding */
}

.login-card {
  /* Mantenemos el estilo de la tarjeta, pero ajustamos un poco el fondo para asegurar que se lea bien */
  background: rgba(
    255,
    255,
    255,
    0.71
  ); /* Fondo blanco ligeramente transparente */
  border-radius: 12px;
  padding: 3rem 2rem;
  box-shadow: 0 30px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  text-align: center;

  /* Ancho base */
  width: 400px;
  max-width: 90%;
  margin: 0 auto;
}

/* 📱 Celulares */
@media (max-width: 480px) {
  .login-card {
    width: 90%; /* ocupa casi toda la pantalla */
    padding: 2rem 1.5rem; /* menos padding para que no se vea apretado */
  }
}

/* 📲 Tablets */
@media (min-width: 481px) and (max-width: 768px) {
  .login-card {
    width: 70%; /* un poco más ancha en tablets */
  }
}

/* 💻 Pantallas grandes */
@media (min-width: 1200px) {
  .login-card {
    width: 500px; /* más cómoda en escritorio */
  }
}

.login-card h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.login-card p {
  color: #6b7280;
  margin-bottom: 2rem;
}

/* Navigation */
.navbar {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-content h1 {
  color: #1f2937;
  font-size: 1.5rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-actions span {
  color: #6b7280;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Search Section */
.search-section {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-section h2 {
  margin-bottom: 1rem;
  color: #1f2937;
}

.search-form {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-form input[type="text"] {
  flex: 1;
  min-width: 300px;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
}

.search-form input[type="text"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Search Results */
.search-results {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.search-results h3 {
  margin-bottom: 1rem;
  color: #1f2937;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.result-card {
  background: #f9fafb;
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.result-card h4 {
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.result-card p {
  color: #6b7280;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.no-results {
  color: #6b7280;
  font-style: italic;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.dashboard-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

.card-header h3 {
  color: #1f2937;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.team-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.counter-number {
  font-size: 3rem;
  font-weight: 700;
  color: #2563eb;
  line-height: 1;
}

.counter-label {
  color: #6b7280;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
}

.card-actions {
  text-align: center;
}

/* Module Controls */
.module-controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

/* Table */
.table-container {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.teams-table {
  width: 100%;
  border-collapse: collapse;
}

.teams-table th,
.teams-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.teams-table th {
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.teams-table tbody tr:hover {
  background: #f9fafb;
}

.team-name {
  font-weight: 600;
  color: #1f2937;
}

.actions {
  display: flex;
  gap: 0.5rem;
}

/* Conditional Formatting */
.status-zero {
  background-color: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.status-positive {
  background-color: #dcfce7;
  color: #166534;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.status-negative {
  background-color: #fee2e2;
  color: #dc2626;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.status-high {
  background-color: #fef3c7;
  color: #d97706;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background-color: #2563eb;
  color: white;
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

.btn-secondary {
  background-color: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background-color: #4b5563;
}

.btn-success {
  background-color: #10b981;
  color: white;
}

.btn-success:hover {
  background-color: #059669;
}

/* Animaciones y badge igual que en modulo: para que se vea igual en index/dashboard */
.form-saved-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #28a745;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: scale(0.8) translateY(-6px);
  transition: opacity 250ms ease, transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 50;
}

.form-column.animate-saved {
  animation: pulseSaved 700ms ease forwards;
}

@keyframes pulseSaved {
  0% {
    box-shadow: 0 0 0 rgba(40, 167, 69, 0);
  }
  40% {
    box-shadow: 0 8px 24px rgba(40, 167, 69, 0.18);
  }
  100% {
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.12);
  }
}

/* Resalte blanco para la fila guardada */
.row-saved {
  background-color: rgba(255, 255, 255, 0.95) !important;
  transition: background-color 800ms ease;
}

.btn-warning {
  background-color: #f59e0b;
  color: white;
}

.btn-warning:hover {
  background-color: #d97706;
}

.btn-danger {
  background-color: #ef4444;
  color: white;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-info {
  background-color: #06b6d4;
  color: white;
}

.btn-info:hover {
  background-color: #0891b2;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Compact global footer styles to ensure a thin bar across index/dashboard/modulo */
.site-footer {
  position: static; /* let it flow at end of body */
  width: 100%;
  background: transparent;
  color: #111827;
  font-size: 0.8rem;
}

.site-footer-bar {
  display: block;
  width: 100%;
  padding: 4px 0; /* compact height */
  background: rgba(255, 255, 255, 0.85); /* semi-transparent white */
  box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.06);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.site-footer .footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-footer .footer-left,
.site-footer .footer-right {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.75);
  padding: 0 8px;
}

.footer-author {
  color: #072146; /* dark blue */
  font-weight: 700;
  text-decoration: none;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.85); /* subtle white glow */
}

.footer-author-link {
  color: inherit;
}

/* Make sure footer doesn't appear bulky on pages with big body padding */
/* Make sure footer doesn't appear bulky on pages with big body padding */
body > .site-footer {
  margin-top: 8px;
}

/* Higher specificity fallbacks to override page inline styles if necessary */
.site-footer.site-footer {
  font-size: 0.75rem !important;
}
.site-footer .site-footer-bar {
  padding: 4px 0 !important;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 2rem;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

.close {
  color: #6b7280;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #374151;
}

.modal h2 {
  margin-bottom: 1.5rem;
  color: #1f2937;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-weight: 500;
}

.alert-error {
  background-color: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .module-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .action-buttons {
    flex-wrap: wrap;
  }

  .teams-table {
    font-size: 0.875rem;
  }

  .teams-table th,
  .teams-table td {
    padding: 0.5rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .nav-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .search-form {
    flex-direction: column;
  }

  .search-form input[type="text"] {
    min-width: auto;
  }
}

@media (max-width: 640px) {
  .actions {
    flex-direction: column;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }
}
