/* admin.css - Estilos para el panel de administración */
[hidden] {
  display: none !important;
}

.admin-hub {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  min-height: 75vh;
}

/* Spinner de carga */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.05);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}
.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 3px;
  margin: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Estado de carga */
.auth-loading {
  text-align: center;
  margin-top: 6rem;
  font-size: 1.1rem;
  color: #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Sección de Autenticación */
.auth-section {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}
.auth-card {
  background: white;
  padding: 3rem 2.5rem;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03);
  width: 100%;
  max-width: 450px;
  border: 1px solid #f1f5f9;
}
.auth-card h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #0f172a;
}
.auth-subtitle {
  color: #64748b;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* Formularios */
.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.form-group label {
  font-weight: 600;
  font-size: 0.875rem;
  color: #334155;
}
.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #f8fafc;
  transition: all 0.2s ease;
  outline: none;
  color: #0f172a;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #6366f1;
  background: white;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: inherit;
  gap: 0.5rem;
}
.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
  width: 100%;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-secondary {
  background: #e2e8f0;
  color: #334155;
}
.btn-secondary:hover {
  background: #cbd5e1;
}
.btn-danger {
  background: #fee2e2;
  color: #ef4444;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1px solid #fecaca;
}
.btn-danger:hover {
  background: #fecaca;
  color: #dc2626;
  border-color: #fca5a5;
}
.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

/* Dropzone de Archivo */
.file-dropzone {
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: 8px;
  padding: 1.75rem;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}
.file-dropzone:hover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.02);
}
.file-dropzone input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  pointer-events: none;
}
.dropzone-icon {
  font-size: 1.75rem;
}
.dropzone-text {
  font-weight: 500;
  color: #64748b;
  font-size: 0.85rem;
}
.dropzone-filename {
  font-weight: 600;
  color: #2563eb;
  font-size: 0.8rem;
  margin-top: 0.4rem;
  word-break: break-all;
}

/* Mensajes de Alerta */
.alert-message {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}
.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fee2e2;
}
.alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #dcfce7;
}

/* Sección de Dashboard */
.dashboard-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 1.5rem 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01);
  border: 1px solid #f1f5f9;
}
@media (max-width: 600px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}
.dashboard-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f172a;
}
.dashboard-header p {
  color: #64748b;
  font-size: 0.95rem;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}
#user-email-display {
  font-weight: 600;
  color: #475569;
  font-size: 0.875rem;
  background: #f1f5f9;
  padding: 0.4rem 0.8rem;
  border-radius: 99px;
}

/* Grid del Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.015);
  border: 1px solid #f1f5f9;
}
.dashboard-card h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: #0f172a;
}

/* Listado de Actividades */
.list-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}
.list-card-header h2 {
  margin-bottom: 0;
}
.badge {
  background: #6366f1;
  color: white;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 99px;
}

.admin-actividades-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.admin-actividad-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  transition: all 0.2s ease;
  gap: 1rem;
}
.admin-actividad-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.item-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.item-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
}
.item-tags {
  display: flex;
  gap: 0.4rem;
}
.item-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.item-tag-level {
  background: #e2e8f0;
  color: #475569;
}
.item-tag-category {
  background: #e0e7ff;
  color: #4f46e5;
}

/* Estados Vacíos / Carga */
.list-empty,
.list-loading {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.empty-icon {
  font-size: 2.5rem;
}

/* Spinners en Botones */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
