* { box-sizing: border-box; }
body { margin: 0; padding: 24px; font-family: Arial, Helvetica, sans-serif; background: #f4f4f4; color: #111; }
.barre-outils-principale, .barre-outils-secondaire { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.bloc-projet { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff; border: 1px solid #d3d3d3; padding: 10px; border-radius: 8px; }
.bloc-projet label { font-size: 13px; font-weight: 700; }
.bloc-projet input, .bloc-projet select { height: 34px; border: 1px solid #bcbcbc; padding: 0 8px; min-width: 180px; }
.bloc-projet button, .btn-retour { height: 36px; border: 1px solid #7d7d7d; background: #fff; color: #222; font-size: 14px; font-weight: 700; cursor: pointer; padding: 0 12px; }
.bloc-projet button:hover, .btn-retour:hover { background: #f0f0f0; }
.btn-retour:disabled { opacity: 0.45; cursor: not-allowed; background: #f7f7f7; }
.info-retour, .info-save { font-size: 13px; color: #555; }
.zone-ligne { width: 100%; overflow-x: auto; overflow-y: hidden; padding: 0 10px 8px 10px; border-radius: 6px; scroll-behavior: smooth; }
.ligne-scene { position: relative; min-width: max-content; }
.ligne { display: flex; align-items: flex-start; gap: 5px; flex-wrap: nowrap; transform-origin: top left; will-change: transform; }
.bloc-case { display: inline-flex; align-items: stretch; gap: 1px; flex: 0 0 auto; position: relative; }
.case { width: calc(50ch + 16px); height: 100px; border: 2px solid #7a7a7a; background: rgba(255, 255, 255, 0.55); display: flex; align-items: stretch; transition: background 0.2s ease, border-width 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; position: relative; overflow: hidden; }
.case.case-principale { background: linear-gradient(90deg, rgba(82, 82, 82, 0.22) 0, rgba(82, 82, 82, 0.22) 18px, rgba(238, 236, 230, 0.98) 18px, rgba(238, 236, 230, 0.98) 100%); border: 3px solid #5a5a5a; box-shadow: 0 0 0 2px rgba(90, 90, 90, 0.14), inset 0 0 0 1px rgba(255,255,255,0.35); }
.case.case-etape { background: rgba(255, 255, 255, 0.55); }
.case.case-en-cours { background: rgba(182, 216, 246, 0.52); border-color: #4a84be; box-shadow: inset 0 0 0 1px rgba(74, 132, 190, 0.18); }
.case.case-active { box-shadow: 0 0 0 3px rgba(74, 132, 190, 0.35), 0 0 18px rgba(74, 132, 190, 0.18); transform: translateY(-1px); }
.case.terminee { background: rgba(255, 196, 120, 0.38); }
.case.epaisse { border-width: 6px; }
.contenu { width: 100%; padding: 6px 8px; display: flex; align-items: stretch; }
.corps-case { width: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 3px; }
.texte { width: 50ch; min-width: 50ch; max-width: 50ch; height: calc(1.05em * 3); min-height: calc(1.05em * 3); max-height: calc(1.05em * 3); border: none; outline: none; resize: none; overflow: hidden; background: transparent; color: #111; font-family: "Courier New", Courier, monospace; font-size: 13px; font-weight: 700; line-height: 1.05; white-space: pre-wrap; word-break: break-word; overflow-wrap: break-word; padding: 0; margin: 0; }
.case.case-principale .texte { color: #2f2f2f; font-weight: 700; }
.meta-zone { display: flex; flex-direction: column; gap: 2px; }
.meta-ligne { display: flex; align-items: center; gap: 4px; min-height: 17px; }
.meta-label { width: 34px; flex: 0 0 34px; font-size: 9px; font-weight: 700; color: #444; text-transform: uppercase; letter-spacing: 0.2px; }
.meta-date-wrap { display: flex; align-items: center; gap: 3px; min-width: 0; flex: 1; }
.meta-input-date, .meta-input-heure { height: 17px; border: 1px solid #b5b5b5; background: rgba(255, 255, 255, 0.95); font-size: 10px; line-height: 1; padding: 1px 4px; color: #111; outline: none; min-width: 0; }
.meta-input-date { flex: 1; }
.meta-input-heure { width: 44px; flex: 0 0 44px; text-align: center; }
.meta-input-date::placeholder, .meta-input-heure::placeholder { color: #777; }
.btn-cal { width: 16px; height: 16px; border: 1px solid #9c9c9c; background: #fff; font-size: 10px; line-height: 1; padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 16px; }
.btn-cal:hover { background: #f0f0f0; }
.actions { width: 20px; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 1px; }
.tooltip-wrap { position: relative; display: block; width: 28px; height: 20px; }
.btn { width: 20px; height: 17px; border: 1px solid #7d7d7d; background: #fff; color: #222; font-size: 20px; font-weight: 700; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; transition: opacity 0.15s ease, background 0.15s ease; }
.btn:hover { background: #f0f0f0; }
.btn.inactif { opacity: 0.4; cursor: not-allowed; background: #f7f7f7; }
.tooltip { position: absolute; top: 50%; left: calc(100% + 8px); transform: translateY(-50%); background: rgba(35, 35, 35, 0.94); color: #fff; font-size: 13px; line-height: 1.2; padding: 7px 9px; border-radius: 4px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.15s ease; z-index: 30; max-width: 260px; }
.tooltip-wrap:hover .tooltip, .tooltip-wrap:focus-within .tooltip, .repere-etape:hover .tooltip, .repere-etape:focus-within .tooltip, .repere-sous-taches:hover .tooltip, .repere-sous-taches:focus-within .tooltip { opacity: 1; }
.repere-etape { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid #4e6275; background: rgba(255,255,255,0.95); color: #2d455c; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; z-index: 5; cursor: default; }
.repere-sous-taches {
  position: absolute;
  top: 31px;
  right: 6px;
  width: 18px;
  height: 18px;
  border: 1px solid #56616d;
  background: rgba(255,255,255,0.96);
  color: #2c3948;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  cursor: pointer;
  user-select: none;
}
.repere-num { display: block; line-height: 1; }
.repere-etape .tooltip { top: -4px; left: auto; right: calc(100% + 8px); transform: none; }
.repere-sous-taches .tooltip {
  top: -2px;
  left: auto;
  right: calc(100% + 8px);
  transform: none;
  white-space: nowrap;
}

.case.case-depliee {
  box-shadow: inset 0 0 0 1px rgba(85, 112, 144, 0.22);
}
.message-zone { min-height: 24px; margin-top: 10px; font-size: 14px; font-weight: 700; color: #a94442; }
.message-zone.vide { visibility: hidden; }
.aide { margin-top: 8px; font-size: 14px; color: #444; }
.overlay-calendrier, .overlay-confirmation { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 9999; }
.overlay-calendrier.visible, .overlay-confirmation.visible { display: flex; }
.overlay-fond, .confirm-fond { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.28); }
.calendrier-modal { position: relative; width: 360px; min-height: 360px; background: rgba(255, 255, 255, 0.99); border: 2px solid #666; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28); padding: 14px; z-index: 1; }
.cal-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 10px; }
.cal-title { font-size: 18px; font-weight: 700; color: #222; text-transform: capitalize; }
.cal-nav, .cal-close, .cal-aujourdhui, .confirm-btn { border: 1px solid #8d8d8d; background: #fff; cursor: pointer; font-size: 13px; padding: 5px 9px; }
.cal-nav:hover, .cal-close:hover, .cal-aujourdhui:hover, .confirm-btn:hover { background: #f0f0f0; }
.cal-semaine, .cal-jours { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-semaine { margin-bottom: 6px; }
.cal-jour-nom { text-align: center; font-size: 12px; font-weight: 700; color: #555; padding: 4px 0; }
.cal-jour { height: 38px; border: 1px solid #b0b0b0; background: #fff; cursor: pointer; font-size: 14px; padding: 0; }
.cal-jour:hover { background: #f2f2f2; }
.cal-jour.vide { visibility: hidden; pointer-events: none; }
.cal-jour.selectionne { border: 2px solid #4f6b8a; font-weight: 700; }
.cal-actions { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cal-note { margin-top: 10px; font-size: 12px; color: #555; }
.confirm-modal { position: relative; width: min(420px, calc(100vw - 32px)); background: rgba(255, 255, 255, 0.99); border: 2px solid #666; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28); padding: 18px; z-index: 1; }
.confirm-titre { font-size: 18px; font-weight: 700; margin-bottom: 10px; color: #222; }
.confirm-texte { font-size: 15px; line-height: 1.4; color: #333; margin-bottom: 16px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.confirm-btn.primaire { font-weight: 700; }
