/* ═══════════════════════════════════════════════════════════════════════
   ENTRETIEN.CSS — Module « Entretien machines » (Bloc 1)
   ─────────────────────────────────────────────────────────────────────
   Onglet « Machines et tâches » : une carte par machine, ses tâches en
   liste dessous. Les couleurs de criticité ne portent jamais seules
   l'information : le libellé est toujours écrit à côté.
   ═════════════════════════════════════════════════════════════════════ */

.ent-onglets {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.ent-onglet {
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  padding: 9px 14px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.ent-onglet:hover { color: var(--wood-dark); }
.ent-onglet.actif {
  color: var(--wood-dark);
  font-weight: 600;
  border-bottom-color: var(--wood-dark);
}

.ent-barre {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.ent-jour-prefere {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.ent-jour-prefere .form-select { width: auto; }

/* ─── Carte machine ─── */
.ent-machine {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.ent-machine.inactive { opacity: 0.6; }

.ent-machine-tete {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ent-machine-nom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--wood-dark);
  flex-wrap: wrap;
}

.ent-code {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg, #f4f1ec);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.ent-machine-sous {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.ent-machine-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

/* Criticité : pastille discrète, libellé toujours écrit. */
.ent-crit {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}
.ent-crit-1 { background: #eef1f4; color: #5a6572; }
.ent-crit-2 { background: #fdf3e2; color: #8a6116; }
.ent-crit-3 { background: #fdeaea; color: #a33030; }

.ent-badge-off {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eee;
  color: #777;
  font-weight: 500;
}

/* ─── Tâches d'une machine ─── */
.ent-taches { margin-top: 10px; display: grid; gap: 6px; }

.ent-tache {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.ent-tache:hover { background: var(--bg, #faf8f5); border-color: var(--wood-dark); }
.ent-tache.inactive { opacity: 0.55; }

.ent-tache-lib { font-size: 13px; font-weight: 500; color: var(--wood-dark); }
.ent-tache-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.ent-taches-vide {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── États « à venir » / vide / module non installé ─── */
.ent-avenir {
  padding: 46px 24px;
  text-align: center;
  color: var(--text-muted);
}
.ent-avenir .ti { font-size: 34px; opacity: 0.45; }
.ent-avenir-titre {
  font-size: 15px;
  font-weight: 600;
  color: var(--wood-dark);
  margin: 10px 0 6px;
}
.ent-avenir-texte {
  font-size: 13px;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .ent-machine-actions { margin-left: 0; width: 100%; }
  .ent-jour-prefere { margin-left: 0; }
}

/* ─── Journées d'entretien (Blocs 2-4) ─── */
.ent-journee {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.ent-journee.compacte { padding: 10px 14px; opacity: 0.92; }

.ent-journee-tete {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ent-journee-date {
  font-size: 15px;
  font-weight: 600;
  color: var(--wood-dark);
  text-transform: capitalize;
}
.ent-journee-actions { margin-left: auto; display: flex; gap: 6px; }
.ent-journee-meta { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.ent-st {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 500;
}
.ent-st-planifie   { background: #eef1f4; color: #5a6572; }
.ent-st-verrouille { background: #e7f0ea; color: #2e6b45; }
.ent-st-realise    { background: #e8eaf6; color: #3b4a8f; }
.ent-st-annule     { background: #f4e9e9; color: #8f4444; }

.ent-verrou {
  font-size: 11px;
  color: #2e6b45;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ent-note-prochaine {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fdf6e5;
  border: 1px solid #efdcae;
  font-size: 12.5px;
  color: #6d5314;
}
.ent-note-prochaine.grande { margin: 4px 0 12px; font-size: 13px; }
.ent-note-prochaine .ti { vertical-align: -2px; }

.ent-alerte {
  padding: 10px 14px;
  border-radius: 8px;
  background: #fdefe3;
  border: 1px solid #f0cfa8;
  color: #8a5116;
  font-size: 13px;
  margin-bottom: 14px;
}
.ent-alerte .ti { vertical-align: -2px; }

.ent-section-titre {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 22px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── Interrupteur planning ─── */
.ent-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-left: auto;
  user-select: none;
}
.ent-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ent-switch-piste {
  width: 38px; height: 21px;
  border-radius: 999px;
  background: #cfc8bd;
  position: relative;
  transition: background 0.15s ease;
  flex: none;
}
.ent-switch-piste::after {
  content: '';
  position: absolute;
  top: 2.5px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.ent-switch input:checked + .ent-switch-piste { background: #2e6b45; }
.ent-switch input:checked + .ent-switch-piste::after { transform: translateX(16px); }
.ent-switch input:focus-visible + .ent-switch-piste { outline: 2px solid var(--wood-dark); outline-offset: 2px; }
.ent-switch-lib { font-size: 13px; color: var(--wood-dark); }

/* ─── Choix de date ─── */
.ent-dates-intro { font-size: 13px; color: var(--text-muted); margin: 2px 0 14px; line-height: 1.5; }
.ent-dates-titre {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 14px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ent-dates-grille { display: flex; flex-wrap: wrap; gap: 8px; }
.ent-date-chip {
  font: inherit;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  text-transform: capitalize;
  transition: border-color 0.12s ease, background 0.12s ease;
}
button.ent-date-chip:hover { border-color: var(--wood-dark); background: var(--bg, #faf8f5); }
.ent-date-chip.prefere { border-color: #2e6b45; background: #f2f8f4; font-weight: 600; }
.ent-date-chip.occupe {
  opacity: 0.55;
  cursor: not-allowed;
  background: #f6f4f0;
  text-decoration: line-through;
}
.ent-date-choisie {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: capitalize;
}
.ent-date-choisie.ok { color: #2e6b45; }

/* ─── Checklist ─── */
.ent-check-machine {
  font-size: 13px;
  font-weight: 700;
  color: var(--wood-dark);
  margin: 16px 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ent-check-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 6px;
}
.ent-check-haut { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ent-check-lib { font-size: 13px; font-weight: 500; color: var(--wood-dark); }
.ent-check-duree { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.ent-check-btns { margin-left: auto; display: flex; gap: 5px; }

.ent-btn-st, .ent-btn-obs {
  font: inherit;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  color: var(--text-muted);
}
.ent-btn-st:hover, .ent-btn-obs:hover { border-color: var(--wood-dark); color: var(--wood-dark); }
.ent-btn-st.st-fait.actif       { background: #e7f0ea; border-color: #2e6b45; color: #2e6b45; font-weight: 600; }
.ent-btn-st.st-reporte.actif    { background: #fdf3e2; border-color: #b07d1e; color: #8a6116; font-weight: 600; }
.ent-btn-st.st-sans_objet.actif { background: #eef1f4; border-color: #5a6572; color: #5a6572; font-weight: 600; }

.ent-item-st {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: auto;
}
.ent-item-st.st-fait       { background: #e7f0ea; color: #2e6b45; }
.ent-item-st.st-reporte    { background: #fdf3e2; color: #8a6116; }
.ent-item-st.st-sans_objet { background: #eef1f4; color: #5a6572; }
.ent-item-st.st-a_faire    { background: #fdefe3; color: #8a5116; }

.ent-check-report {
  font-size: 12px;
  color: #8a6116;
  margin-top: 5px;
}
.ent-check-note { font-size: 12px; color: var(--text-muted); margin-top: 5px; white-space: pre-wrap; }
.ent-check-progres { margin-right: auto; font-size: 12.5px; color: var(--text-muted); align-self: center; }

.ent-obs-edit { margin-top: 8px; }
.ent-obs-ligne { display: flex; gap: 8px; margin-top: 6px; }
.ent-obs-ligne .form-input { max-width: 180px; }

/* ─── Historique ─── */
.ent-histo-detail { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 4px; }
.ent-histo-item {
  font-size: 13px;
  color: var(--wood-dark);
  padding: 5px 0;
  display: block;
}
.ent-histo-item .ent-item-st { margin-left: 0; margin-right: 6px; }

/* ─── Ligne « entretien » du briefing (24/07) ───
   Placée hors de la zone repliable du briefing : elle reste lisible même
   briefing fermé. Sobre mais chaude, pour se distinguer du corps de texte
   sans crier — le bandeau rouge du kanban se charge de l'urgence. */
.briefing-entretien {
  margin: 0 16px 12px;
  padding: 9px 13px;
  border-radius: 8px;
  background: #fdf3e2;
  border: 1px solid #edd3a4;
  color: #7a5410;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.12s ease;
}
.briefing-entretien:hover { filter: brightness(0.97); }
