/* PLANNING.CSS */
.plan-kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:12px; margin-bottom:16px; }
.plan-table { overflow:hidden; }

.plan-thead {
  display:flex; align-items:center; padding:10px 16px;
  background:var(--wood-pale); border-bottom:2px solid var(--border);
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.07em; color:var(--text-muted);
}
.plan-row {
  display:flex; align-items:center; padding:13px 16px;
  border-bottom:1px solid var(--border); transition:background 0.12s;
}
.plan-row:hover { background:var(--wood-pale); }
.plan-row-current { background:#FAEEDA !important; border-left:3px solid var(--accent); }
/* Surlignage au survol d'une commande en alerte : met en évidence les semaines concernées */
.plan-row-surligne {
  background: #FAEEDA !important;
  border-left: 4px solid var(--orange, #D4860A) !important;
  box-shadow: inset 0 0 0 2px rgba(217, 119, 6, 0.35);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.plan-col-sem   { width:130px; display:flex; align-items:center; gap:8px; flex-shrink:0; }
.plan-col-dates { width:120px; font-size:12px; color:var(--text-muted); flex-shrink:0; }
.plan-col-nb    { width:55px; text-align:center; flex-shrink:0; }
.plan-col-charge{ width:130px; font-size:13px; flex-shrink:0; }
.plan-col-bar   { flex:1; display:flex; align-items:center; gap:8px; padding:0 8px; }
.plan-col-status{ width:100px; text-align:right; flex-shrink:0; }

.plan-sem-num { font-size:15px; font-weight:700; color:var(--wood-dark); font-family:'DM Mono',monospace; }
.plan-now-badge { font-size:11px; font-weight:700; background:var(--accent); color:#fff; padding:2px 6px; border-radius:6px; }
.plan-nb-badge { display:inline-block; background:var(--wood-pale); color:var(--text-muted); font-size:11px; font-weight:700; padding:2px 8px; border-radius:8px; border:1px solid var(--border); }

/* DÉTAIL JOURS */
.plan-detail { border-bottom:2px solid var(--border); }
.plan-day-row {
  display:flex; align-items:center; gap:12px;
  padding:8px 16px 8px 32px;
  border-bottom:1px solid var(--border);
  background:var(--white);
}
.plan-day-today { background:#FAEEDA !important; }
.plan-day-row:last-child { border-bottom:none; }
.plan-day-label { width:100px; display:flex; align-items:center; gap:8px; flex-shrink:0; }
.plan-day-nom   { font-size:12px; font-weight:700; color:var(--text); width:28px; }
.plan-day-date  { font-size:11px; color:var(--text-muted); }
.plan-day-bar   { width:180px; flex-shrink:0; }
.plan-day-cards { flex:1; display:flex; flex-wrap:wrap; gap:6px; }
.plan-card-chip {
  display:inline-flex; align-items:center; gap:5px;
  background:var(--wood-pale); border:1px solid var(--border);
  border-radius:6px; padding:3px 8px; font-size:11px; color:var(--text); font-weight:500;
}

.plan-row-past { opacity: 0.7; }
.plan-row-past .plan-sem-num { color: var(--text-muted); }
.plan-retard-badge { font-size:11px; font-weight:700; background:#FBEAE8; color:var(--red); padding:2px 6px; border-radius:6px; }

.plan-day-over {
  background: #FAEEDA !important;
  border-left: 3px solid var(--orange);
}
.plan-day-over .plan-day-nom,
.plan-day-over .plan-day-date { color: var(--orange); font-weight: 700; }

.plan-jour-surcharge-badge {
  font-size:11px; font-weight: 700;
  background: #FAEEDA; color: var(--orange);
  border: 1px solid var(--orange);
  padding: 2px 6px; border-radius:6px;
  white-space: nowrap;
}

/* ═══════════════════════════════════════ */
/* Bannière alerte commandes hors délais     */
/* ═══════════════════════════════════════ */
.plan-alerte-box {
  background: #FBEAE8;
  border: 1px solid #FBEAE8;
  border-left: 4px solid var(--red, #C0392B);
  border-radius:12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.plan-alerte-titre {
  font-weight: 700;
  color: var(--red, #C0392B);
  font-size:13px;
  margin-bottom: 8px;
}
.plan-alerte-ligne {
  font-size: 13px;
  color: var(--text, #26323B);
  padding: 4px 0;
  border-top: 1px solid #FBEAE8;
}
.plan-alerte-conseil {
  font-size: 12px;
  color: var(--text-muted, #857B70);
  margin-top: 8px;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════
   PRÉSENCE DE L'ÉQUIPE (23/07) — qui manque, qui renforce, pourquoi la
   capacité de la semaine n'est pas celle d'habitude.
   ═════════════════════════════════════════════════════════════════════ */

.plan-presence-badge {
  display: inline-block;
  font-size: 11px;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--wood-pale);
  white-space: nowrap;
  cursor: help;
}

.plan-presence {
  background: var(--wood-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 8px 0 10px;
}
.plan-pres-titre {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 7px;
}
.plan-pres-ligne {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
  flex-wrap: wrap;
}
.plan-pres-nom {
  font-size: 12px;
  font-weight: 600;
  min-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-pres-cases { display: flex; gap: 3px; }
.plan-pres-case {
  display: inline-block;
  width: 22px;
  height: 16px;
  line-height: 16px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}
.plan-pres-case-off {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 400;
  line-height: 15px;
}
.plan-pres-suffixe { font-size: 11px; color: var(--text-muted); }

@media (max-width: 768px) {
  .plan-pres-nom { min-width: 110px; }
  .plan-presence-badge { margin-left: 0; display: block; margin-top: 3px; width: fit-content; }
}

/* Menu « Gérer l'équipe » (23/07) */
.plan-pres-entete {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}
.plan-menu-equipe {
  position: absolute;
  z-index: 100000;
  width: 336px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(23,62,84,.14), 0 2px 6px rgba(23,62,84,.08);
  padding: 6px;
}
.plan-menu-chargement { padding: 16px; text-align: center; font-size: 12px; color: var(--text-muted); }
.plan-menu-titre { font-size: 11px; color: var(--text-muted); padding: 6px 10px 4px; }
.plan-menu-section {
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 10px 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.plan-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
}
.plan-menu-item-clic { cursor: pointer; }
.plan-menu-item-clic:hover { background: var(--wood-pale); }
.plan-menu-item-off { opacity: .55; }
.plan-menu-sub { font-size: 11px; color: var(--text-muted); }
.plan-menu-tag { font-size: 10px; padding: 2px 7px; border-radius: 8px; white-space: nowrap; }
.plan-menu-tag-vert  { background: var(--green-soft); color: var(--green); }
.plan-menu-tag-rouge { background: #FBF0DC; color: var(--orange); }
.plan-menu-vide { padding: 8px 10px; font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.plan-menu-pied { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
