/* ===== Switch Activo/Inactivo estilo moderno ===== */
.switch-container {
  display: flex;
  align-items: center;
  gap: 18px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e57373;
  transition: background 0.3s;
  border-radius: 28px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.slider:before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
}

.switch input:checked+.slider {
  background-color: #43a047;
}

.switch input:checked+.slider:before {
  transform: translateX(22px);
}

.status-text {
  min-width: 100px;
  font-weight: 600;
  font-size: 1.08em;
  padding: 0px 16px;
  border-radius: 14px;
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
  text-align: center;
  transition: background 0.3s, color 0.3s, border 0.3s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  letter-spacing: 0.5px;
  display: inline-block;
}

.switch input:checked~.status-text {
  background: #e8f5e9;
  color: #388e3c;
  border: 1px solid #a5d6a7;
}

/* ===== Switch para estado Activo/Inactivo ===== */

/* ===== Switch para estado Activo/Inactivo (verde/rojo y texto al costado) ===== */
.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  user-select: none;
}

.switch-label input[type="checkbox"] {
  display: none;
}

.switch-slider {
  width: 48px;
  height: 26px;
  background: #e57373;
  /* rojo por defecto */
  border-radius: 26px;
  position: relative;
  transition: background 0.2s;
  box-sizing: border-box;
}

.switch-slider:before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
}

.switch-label input[type="checkbox"]:checked+.switch-slider {
  background: #43a047;
  /* verde si activo */
}

.switch-label input[type="checkbox"]:checked+.switch-slider:before {
  transform: translateX(22px);
}

.switch-text {
  min-width: 80px;
  font-weight: 600;
  font-size: 1.05em;
  padding: 2px 12px;
  border-radius: 12px;
  background: #e3f2fd;
  color: #1976d2;
  border: 1px solid #bbdefb;
  margin-left: 8px;
  transition: background 0.2s, color 0.2s, border 0.2s;
  display: inline-block;
  text-align: center;
}

.switch-label input[type="checkbox"]:checked~.switch-text {
  background: #e8f5e9;
  color: #388e3c;
  border: 1px solid #a5d6a7;
}

.switch-label input[type="checkbox"]:not(:checked)~.switch-text {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

/* Estilos para la página de gestión de proyectos */

.projects-container {
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.actions-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

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

.projects-table th,
.projects-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.projects-table th {
  background-color: #f9f9f9;
  font-weight: 600;
  color: var(--text-color);
}

.projects-table tr:last-child td {
  border-bottom: none;
}

.projects-table tr:hover td {
  background-color: rgba(0, 0, 0, 0.02);
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

.status-active {
  background-color: #e3f2fd;
  color: #1976d2;
}

.status-inactive {
  background-color: #f5f5f5;
  color: #757575;
}

.project-actions {
  display: flex;
  gap: 10px;
}

.action-btn {
  background: none;
  border: none;
  padding: 5px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 1rem;
  transition: all 0.2s;
}

.edit-btn {
  color: #4caf50;
}

.edit-btn:hover {
  background-color: rgba(76, 175, 80, 0.1);
}

.delete-btn {
  color: #f44336;
}

.delete-btn:hover {
  background-color: rgba(244, 67, 54, 0.1);
}

.radio-group {
  display: flex;
  gap: 20px;
  margin-top: 10px;
}

.radio-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.radio-label input {
  margin-right: 8px;
}

.empty-message,
.loading-message {
  text-align: center;
  padding: 20px;
  color: var(--text-light);
}

/* Modal específico de proyectos */


/* Estilos del modal - AÑADIDO */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  overflow: auto;
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 0;
  border-radius: 8px;
  width: 500px;
  max-width: 90%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  animation: modalFadeIn 0.3s;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  border-radius: 8px 8px 0 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-body {
  padding: 20px;
}

.close-modal {
  font-size: 1.5rem;
  font-weight: bold;
  color: #757575;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal:hover {
  color: #000;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .project-actions {
    flex-direction: column;
    gap: 5px;
  }

  .radio-group {
    flex-direction: column;
    gap: 10px;
  }

  .modal-content {
    margin: 20% auto;
    width: 95%;
  }
}