/* === Reset & base === */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, Segoe UI, Arial, sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}

/* === Header === */
header {
  background: #0f2c82;
  color: #fff;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.3px;
}
nav a {
  color: #fff;
  text-decoration: none;
  margin-left: 16px;
  font-weight: 500;
  opacity: 0.95;
  transition: opacity .2s ease;
}
nav a:hover { opacity: 1; }
nav a.active {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* === Hero === */
.hero {
  background: linear-gradient(135deg, #0f2c82, #2563eb);
  color: #fff;
  padding: 48px 20px;
  text-align: center;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: 0 10px 30px rgba(16, 43, 130, 0.25);
}
.hero h1 {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 800;
}
.hero p {
  margin-top: 10px;
  opacity: 0.95;
}

/* === Container === */
.container {
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 16px;
}

/* === Grid layout === */
.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* === Server cards with icon status === */
.card {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  transition: transform .2s ease, box-shadow .2s ease;
  gap: 16px;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}
.status-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}
.status-green .status-icon { color: #22c55e; }     /* ✅ Actif */
.status-red .status-icon { color: #ef4444; }       /* ❌ Arrêté */
.status-blue .status-icon { color: #3b82f6; }      /* 🔧 Maintenance */
.status-orange .status-icon { color: #f97316; }    /* ⚠️ En panne */

.card-content {
  flex: 1;
}
.card-content h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  color: #0f2c82;
}
.card-content p {
  margin: 0;
  font-weight: 600;
  color: #374151;
}
.card-content small {
  display: block;
  margin-top: 6px;
  color: #6b7280;
  font-size: 0.85rem;
}

/* === Section cards === */
.section-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  margin-bottom: 18px;
}
.section-card h2 {
  margin: 0 0 8px;
  color: #0f2c82;
}

/* === Updates === */
.updates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.update-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}
.update-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
}
.update-content h3 {
  margin: 0 0 8px;
  color: #2563eb;
}
.update-content p {
  margin: 0 0 8px;
  color: #374151;
}
.update-content small {
  color: #6b7280;
}
.update-card .btn {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 12px;
  background: #2563eb;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  text-align: center;
}
.update-card .btn:hover {
  background: #1e40af;
}

/* === Tâches === */
.tasks {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}
.tasks h2 {
  margin-bottom: 12px;
  color: #2563eb;
}
.tasks ul {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.tasks ul li {
  background: #f3f4f6;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: #374151;
}
.tasks .btn {
  display: inline-block;
  padding: 8px 12px;
  background: #2563eb;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}
.tasks .btn:hover {
  background: #1e40af;
}

/* === Boutons === */
.update-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.update-btn:hover {
  background: #1e40af;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.delete-btn {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.delete-btn:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(239,68,68,0.4);
}

/* === Footer === */
footer {
  background: #e8ecf6;
  color: #374151;
  padding: 16px;
  text-align: center;
  margin-top: 28px;
  border-top: 1px solid #dbe2f3;
}


/* === Liste des tâches === */
.task-list {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  padding: 0;
  margin: 0;
  list-style: none;
}

.task-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}

.task-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f2c82;
}

.task-meta {
  font-size: 0.9rem;
  color: #6b7280;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.task-status {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.task-status.en_attente { color: #2563eb; }     /* ⏳ En attente */
.task-status.en_cours { color: #f59e0b; }       /* 🔄 En cours */
.task-status.terminée { color: #22c55e; }       /* ✅ Terminée */
.task-status.en_retard { color: #ef4444; }      /* ⚠️ En retard */

.task-priority {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.task-priority.basse { background: #e5e7eb; color: #374151; }
.task-priority.normale { background: #2563eb; color: #fff; }
.task-priority.haute { background: #ef4444; color: #fff; }

/* === Gestion des tâches === */
.manage-tasks {
  display: grid;
  gap: 24px;
}

.task-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.task-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f2c82;
}

.task-meta {
  font-size: 0.9rem;
  color: #6b7280;
  display: flex;
  gap: 12px;
}

.task-status {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.task-status.en_attente { color: #2563eb; }     /* ⏳ En attente */
.task-status.en_cours { color: #f59e0b; }       /* 🔄 En cours */
.task-status.terminée { color: #22c55e; }       /* ✅ Terminée */
.task-status.en_retard { color: #ef4444; }      /* ⚠️ En retard */

.task-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.task-actions .update-btn {
  flex: 1;
}

.task-actions .delete-btn {
  flex: 1;
}

.task-card {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.task-title {
  font-weight: 600;
  color: #0f2c82;
  font-size: 1rem;
}

.task-meta {
  font-size: 0.85rem;
  color: #6b7280;
}

.task-edit {
  display: none; /* caché par défaut */
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}

.task-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.task-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}

.task-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: #0f2c82;
}

.task-meta {
  font-size: 0.9rem;
  color: #6b7280;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.task-status {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.task-status.en_attente { color: #2563eb; }
.task-status.en_cours { color: #f59e0b; }
.task-status.terminée { color: #22c55e; }
.task-status.en_retard { color: #ef4444; }

/* === Page édition tâche === */
.edit-container {
  max-width: 600px;
  margin: 40px auto;
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.edit-container h2 {
  margin-top: 0;
  color: #0f2c82;
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
}

.edit-form .row {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.edit-form label {
  font-weight: 600;
  margin-bottom: 6px;
  color: #374151;
}

.edit-form input[type="text"],
.edit-form input[type="date"],
.edit-form textarea,
.edit-form select {
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #f9fafb;
  font-size: 1rem;
}

.edit-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn-save {
  flex: 1;
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn-save:hover {
  background: #1e40af;
  transform: translateY(-2px);
}

.btn-cancel {
  flex: 1;
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn-cancel:hover {
  background: #dc2626;
  transform: translateY(-2px);
}