* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f2f2f2;
  color: #111;
}

header, main {
  max-width: 1280px;
  margin: auto;
}

header {
  padding: 18px 20px 6px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

h1 { margin-bottom: 4px; }

.panel {
  background: white;
  margin: 16px 20px;
  padding: 16px;
  border-radius: 10px;
  box-shadow: 0 2px 8px #0002;
}

.settings-grid {
  display: grid;
  grid-template-columns: 180px 180px 1fr;
  gap: 12px;
  align-items: end;
}

label {
  font-weight: bold;
  display: block;
}

input, button {
  font: inherit;
}

input[type="date"], input[type="number"], input[type="text"] {
  width: 100%;
  padding: 7px;
  margin-top: 5px;
}

button {
  border: 0;
  padding: 9px 12px;
  border-radius: 7px;
  background: #222;
  color: white;
  cursor: pointer;
}

button:hover { opacity: .85; }

.calendar-link-btn {
  background: #f7f7f7;
  color: #222;
  border: 1px solid #ccc;
  padding: 8px 11px;
  font-size: 13px;
  margin-top: 4px;
}

.calendar-link-btn:hover {
  background: #ececec;
  opacity: 1;
}

.actions-zone {
  display: grid;
  gap: 10px;
}

.auto-fill-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid #d5dbe6;
  border-radius: 12px;
  background: linear-gradient(180deg, #f9fbff, #eef3fb);
}

.auto-fill-card strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.auto-fill-card span {
  display: block;
  font-size: 12px;
  color: #555;
}

.primary-action-btn {
  background: #1f4f8f;
  padding: 11px 18px;
  border-radius: 9px;
  font-weight: 700;
  box-shadow: 0 2px 6px #0002;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.primary-action-btn:hover {
  opacity: 1;
  background: #183f73;
  transform: translateY(-1px);
  box-shadow: 0 5px 12px #0003;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.groups-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 14px;
}

.group-box {
  border: 2px solid #222;
  border-radius: 10px;
  overflow: hidden;
  background: #fafafa;
}

.group-title {
  background: #222;
  color: white;
  padding: 9px 10px;
  font-weight: bold;
}

.group-body {
  padding: 8px;
}

.cdr-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto 82px 66px 52px 52px 62px 38px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.cdr-row input[type="text"] {
  margin-top: 0;
}

.check-label {
  font-size: 11px;
  font-weight: bold;
  text-align: center;
  border-radius: 6px;
  padding: 4px;
}

.check-floor { background: #ffe1e1; color: #990000; }
.check-absent { background: #111; color: white; }

.check-label input {
  display: block;
  width: 18px;
  height: 18px;
  margin: 2px auto 0;
}

.absent-name {
  opacity: .45;
  text-decoration: line-through;
}

.delete-btn {
  background: #8b0000;
  padding: 7px;
}

.add-btn {
  background: #555;
  width: 100%;
  margin-top: 4px;
}

.hint {
  font-size: 12px;
  color: #555;
}

.summary-accordion,
.planning-accordion {
  padding: 0;
  overflow: hidden;
}

.summary-toggle {
  width: 100%;
  background: white;
  color: #111;
  padding: 16px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  font-weight: 700;
  text-align: left;
}

.summary-toggle:hover {
  opacity: 1;
  background: #f7f7f7;
}

.summary-arrow {
  font-size: 18px;
  transition: transform .15s ease;
}

.summary-content {
  padding: 0 16px 16px;
}

.summary-accordion.collapsed .summary-content,
.planning-accordion.collapsed .summary-content {
  display: none;
}

.summary-accordion:not(.collapsed) .summary-arrow,
.planning-accordion:not(.collapsed) .summary-arrow {
  transform: rotate(90deg);
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.summary-table th,
.summary-table td {
  border: 1px solid #777;
  padding: 4px;
  vertical-align: top;
}

.summary-table th {
  background: #eee;
}

.red {
  color: #c00000;
  font-weight: bold;
}

.day-page {
  background: white;
  width: 210mm;
  min-height: 297mm;
  margin: 20px auto;
  padding: 10mm;
  box-shadow: 0 2px 10px #0003;
  page-break-after: always;
}

.day-title {
  text-align: center;
  font-size: 18px;
  margin: 0 0 8px;
}

.service-title {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  margin: 10px 0 6px;
  text-transform: uppercase;
}

.planning-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.planning-table th,
.planning-table td {
  border: 2px solid #222;
  padding: 4px;
  height: 29px;
  vertical-align: middle;
}

.planning-table th {
  background: #eee;
  text-transform: uppercase;
}

.service-col { width: 24%; }
.rang-col { width: 18%; }
.name-col { width: 26%; }
.recipe-col { width: 16%; }

.cdr-input {
  width: 100%;
  border: 0;
  padding: 5px;
  font-size: 12px;
  background: white;
}

.cdr-input:focus {
  outline: 2px solid #555;
}

.total-row td {
  font-weight: bold;
  height: 26px;
}

@media print {
  @page { size: A4 portrait; margin: 0; }
  body { background: white; }
  .no-print { display: none !important; }
  .day-page {
    margin: 0;
    width: 210mm;
    min-height: 297mm;
    box-shadow: none;
    padding: 10mm;
  }
}


.rank-cell {
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
}
.shift-jour {
  background: #c9f2c9 !important;
}
.shift-coupure {
  background: #fff3a6 !important;
}
.shift-nuit {
  background: #cfe2ff !important;
}
.rank-hint {
  font-size: 9px;
  font-weight: normal;
  text-transform: none;
  color: #333;
}


.separator-after td {
  border-bottom-width: 5px !important;
}
.week-summary {
  margin-bottom: 18px;
}
.week-summary h3 {
  margin: 14px 0 6px;
  background: #222;
  color: white;
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 14px;
}


.shift-jour-dark {
  background: #8fd18f !important;
}


.auto-filled {
  background: #e8f0ff !important;
  font-weight: bold;
}
.conflict-note {
  color: #b00000;
  font-weight: bold;
}


.cycle-calendar-panel {
  overflow-x: auto;
}
.cycle-calendar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.cycle-calendar-table th,
.cycle-calendar-table td {
  border: 1px solid #777;
  padding: 5px;
  text-align: center;
}
.cycle-calendar-table th {
  background: #222;
  color: white;
}
.cycle-calendar-table tr:nth-child(even) td {
  background: #f6f6f6;
}
.cycle-s1 { background: #e8f5e9 !important; }
.cycle-s2 { background: #fff8e1 !important; }
.cycle-s3 { background: #e3f2fd !important; }
.cycle-s4 { background: #fce4ec !important; }


/* V21 - Planning général hebdomadaire */
.general-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 10px 0 12px;
  font-size: 12px;
  font-weight: 700;
}
.general-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.general-legend i {
  width: 18px;
  height: 12px;
  display: inline-block;
  border: 1px solid #999;
  border-radius: 3px;
}
.legend-open { background: #c9f2c9; }
.legend-close { background: #cfe2ff; }
.legend-break { background: #fff3a6; }
.legend-rest { background: #eadcff; }
.legend-absence { background: #ff8b8b; }

.general-week-summary {
  overflow-x: auto;
}
.general-planning-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}
.general-planning-table th,
.general-planning-table td {
  border: 1px solid #aaa;
  padding: 6px 5px;
  text-align: center;
  vertical-align: middle;
  height: 44px;
}
.general-planning-table thead th {
  background: #f0f0f0;
  font-weight: 800;
  text-transform: uppercase;
}
.general-planning-table thead th span {
  font-size: 10px;
  font-weight: 600;
}
.general-cdr-name {
  width: 155px;
  text-align: left !important;
  background: #fafafa !important;
  font-weight: 800;
  position: sticky;
  left: 0;
  z-index: 1;
}
.general-ouverture {
  background: #c9f2c9;
  font-weight: 800;
}
.general-fermeture {
  background: #cfe2ff;
  font-weight: 800;
}
.general-coupure {
  background: #fff3a6;
  font-weight: 800;
  text-transform: uppercase;
}
.general-rest {
  background: #eadcff;
  font-weight: 900;
  color: #4a277d;
}
.general-absence {
  background: #ff8b8b;
  font-weight: 900;
  color: #760000;
}
.general-empty {
  background: #fff;
}
.general-outside {
  background: #f5f5f5;
}
.general-planning-table td span {
  font-weight: 600;
  font-size: 10px;
}
.general-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 18px;
  font-size: 12px;
}
.general-stats span,
.general-stats strong {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 999px;
  padding: 5px 9px;
}


/* V24 - modification manuelle depuis le planning général : menu stable en deux étapes */
.general-editable-cell {
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.general-editable-cell:hover {
  filter: brightness(0.96);
  box-shadow: inset 0 0 0 2px #2228;
}
.manual-rank-menu {
  position: absolute;
  z-index: 99999;
  width: 280px;
  background: #ffffff;
  color: #111827;
  border: 1px solid #c7cdd8;
  border-radius: 12px;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.28);
  padding: 10px;
  font-size: 13px;
}
.manual-rank-menu * {
  color: #111827;
  box-sizing: border-box;
}
.manual-rank-title {
  font-weight: 900;
  margin: 2px 4px 2px;
}
.manual-rank-subtitle {
  color: #4b5563;
  font-size: 11px;
  margin: 0 4px 8px;
}
.manual-rank-panel {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.manual-rank-category-btn,
.manual-rank-item-btn,
.manual-rank-back {
  width: 100%;
  border: 1px solid transparent;
  background: #ffffff;
  color: #111827;
  text-align: left;
  padding: 9px 10px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}
.manual-rank-category-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.manual-rank-back {
  background: #f3f4f6;
  color: #374151;
  margin-bottom: 4px;
}
.manual-rank-category-btn:hover,
.manual-rank-item-btn:hover,
.manual-rank-back:hover {
  background: #eaf2ff;
  border-color: #b7cffc;
  color: #0f3f8c;
}
.cdr-input.manual-filled {
  background: #fff7d6;
}


/* V25 - bouton flottant de recalcul ponctuel après absence manuelle */
.floating-auto-zone {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  width: 330px;
}
.floating-auto-update {
  width: 100%;
  max-width: 330px;
  background: #184f8f;
  color: #fff;
  border: 1px solid #0f3f74;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .28);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.floating-auto-update:hover {
  opacity: 1;
  background: #113b6e;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, .34);
}
.auto-update-console {
  margin-top: 10px;
  max-height: 220px;
  overflow: auto;
  background: rgba(255,255,255,.98);
  color: #172033;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .18);
  padding: 10px 12px;
  font-size: 12px;
}
.auto-console-title {
  font-weight: 900;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.auto-console-title span { color: #64748b; font-weight: 700; }
.auto-console-summary { color: #334155; margin-bottom: 6px; font-weight: 700; }
.auto-update-console ul { margin: 0; padding-left: 18px; }
.auto-update-console li { margin: 3px 0; line-height: 1.25; }
@media print {
  .floating-auto-zone, .floating-auto-update { display: none !important; }
}

/* V29 - planning général : coupures midi/soir et absences spécifiques */
.legend-break-midi { background: #d9f7df; }
.legend-break-soir { background: #dbeafe; }
.legend-absence-specific { background: #f4b6c7; }
.legend-rest { background: #fff3a6; }
.general-rest {
  background: #fff3a6 !important;
  color: #6b4b00 !important;
}
.general-coupure-split {
  padding: 0 !important;
  font-weight: 800;
  text-transform: none;
}
.split-coupure {
  display: grid;
  grid-template-rows: 1fr 1fr;
  height: 100%;
  min-height: 44px;
}
.split-coupure > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4px 3px;
  line-height: 1.05;
}
.split-coupure-midi {
  background: #d9f7df;
  border-bottom: 1px solid rgba(0,0,0,.18);
}
.split-coupure-soir {
  background: #dbeafe;
}
.split-coupure span,
.general-planning-table td span {
  font-size: 9px;
  font-weight: 700;
  opacity: .85;
}
.general-absence-purple {
  background: #eadcff;
  color: #4a277d;
  font-weight: 900;
}
.general-absence-pink {
  background: #f4b6c7;
  color: #7f1d1d;
  font-weight: 900;
}
.manual-rank-category-btn.manual-coupure-midi,
.manual-rank-item-btn.manual-coupure-midi {
  background: #e8fbe9;
  border-color: #bdecc5;
}
.manual-rank-category-btn.manual-coupure-soir,
.manual-rank-item-btn.manual-coupure-soir {
  background: #e9f2ff;
  border-color: #bdd7ff;
}
.manual-rank-item-btn.general-absence-purple {
  background: #f1e8ff;
  border-color: #d4c2fb;
  color: #4a277d;
}
.manual-rank-item-btn.general-absence-pink {
  background: #ffe4eb;
  border-color: #f5b8c8;
  color: #7f1d1d;
}

/* V30 - lisibilité planning général et feuilles */
.legend-open { background: #9fe3a2 !important; }
.legend-close { background: #aac8ee !important; }
.general-ouverture {
  background: #9fe3a2 !important;
  font-weight: 900;
}
.general-fermeture {
  background: #aac8ee !important;
  font-weight: 900;
}
.general-planning-table th,
.general-planning-table td {
  height: 62px;
  padding: 7px 5px;
}
.general-cdr-name {
  height: 62px;
}
.general-coupure-split {
  height: 62px;
}
.split-coupure {
  min-height: 62px;
  height: 62px;
}
.split-coupure > div {
  min-height: 31px;
  padding: 5px 3px;
  overflow: hidden;
}
.split-coupure span,
.general-planning-table td span {
  font-size: 9px;
  line-height: 1.1;
}
.general-absence-orange {
  background: #ffb347 !important;
  color: #5c2c00 !important;
  font-weight: 900;
}
.manual-rank-item-btn.general-absence-orange {
  background: #ffe0ad !important;
  border-color: #ffb347 !important;
  color: #5c2c00 !important;
}
.legend-absence-specific { background: #ffb347 !important; }

/* Feuilles de planning : noms CDR plus lisibles */
.planning-table th {
  background: #e8e8e8;
  border-bottom-width: 3px;
}
.planning-table th:nth-child(3),
.planning-table th:nth-child(4),
.planning-table th:nth-child(5) {
  background: #f1f3f5;
}
.planning-table td:nth-child(3),
.planning-table td:nth-child(4),
.planning-table td:nth-child(5) {
  border-left-width: 3px;
}
.cdr-input {
  text-align: center;
  font-weight: 900;
  font-size: 13px;
  padding: 7px 6px;
  min-height: 28px;
}
.cdr-input.manual-filled {
  font-weight: 900;
}

/* V32 - Barre d'actions intégrée au Planning général */
.summary-titlebar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  background: #fff;
  border-radius: 10px 10px 0 0;
}

.summary-toggle-inline {
  flex: 1 1 auto;
  border-radius: 10px 0 0 10px;
}

.summary-title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 10px 0;
  flex-wrap: wrap;
}

.compact-primary {
  padding: 9px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.secondary-danger-btn {
  background: #fff3f3;
  color: #8a1f1f;
  border: 1px solid #e1aaaa;
  padding: 9px 13px;
  border-radius: 9px;
  font-weight: 700;
  white-space: nowrap;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}

.secondary-danger-btn:hover {
  opacity: 1;
  background: #ffe0e0;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px #0002;
}

@media (max-width: 900px) {
  .summary-titlebar {
    flex-direction: column;
  }
  .summary-toggle-inline {
    border-radius: 10px 10px 0 0;
  }
  .summary-title-actions {
    padding: 0 12px 12px;
  }
}
#generateCoupuresBtn:disabled{opacity:.45;cursor:not-allowed;filter:grayscale(.4)}
.secondary-action-btn{border:1px solid #2563eb;background:#eff6ff;color:#1e3a8a;border-radius:10px;padding:10px 14px;font-weight:700;transition:.15s ease;}
.secondary-action-btn:not(:disabled):hover{background:#dbeafe;transform:translateY(-1px);box-shadow:0 6px 14px rgba(37,99,235,.18);}


/* V36 - glisser-déposer manuel sur les feuilles de planning */
.cdr-input {
  cursor: grab;
  user-select: none;
}
.cdr-input:active {
  cursor: grabbing;
}
.cdr-input.drag-source {
  opacity: 0.55;
  outline: 2px dashed #1f4f8f;
}
.cdr-input.drag-over {
  outline: 3px solid #f59e0b;
  background: #fff7ed !important;
}


/* V42 - statistiques journalières dans le planning général et les feuilles */
.daily-kpi-line {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px auto 3px;
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
}
.daily-kpi-line span {
  display: inline-block;
  background: rgba(255,255,255,.68);
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 999px;
  padding: 2px 6px;
  white-space: nowrap;
}
.daily-kpi-compact {
  gap: 3px;
  margin-top: 5px;
  font-size: 9px;
  line-height: 1.15;
}
.daily-kpi-compact span {
  padding: 1px 4px;
}
.daily-unassigned {
  margin-top: 4px;
  padding: 4px 6px;
  border: 1px solid #f1b7b7;
  border-radius: 6px;
  background: #fff1f1;
  color: #8b0000;
  font-size: 10px;
  line-height: 1.25;
  text-transform: none;
  font-weight: 700;
}
.daily-unassigned em {
  font-style: normal;
  font-weight: 600;
}
.general-planning-table thead th .daily-unassigned {
  text-align: left;
  max-width: 150px;
  margin-left: auto;
  margin-right: auto;
}
.daily-page-stats {
  margin: 0 auto 8px;
  padding: 6px 8px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #f8fafc;
  text-align: center;
}
.daily-page-stats .daily-kpi-line {
  font-size: 12px;
}
.daily-page-stats .daily-unassigned {
  text-align: left;
  max-width: 100%;
}

/* V43 - Navigation rapide depuis les en-têtes du planning général */
.general-day-header {
  cursor: pointer;
  position: relative;
}
.general-day-header:hover {
  filter: brightness(0.96);
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.28);
}
.day-header-menu .day-jump-btn {
  text-align: center;
  background: #eef6ff;
  border-color: #bfdbfe;
}
.day-page-highlight {
  animation: lip-day-highlight 1.8s ease;
}
@keyframes lip-day-highlight {
  0% { box-shadow: 0 0 0 0 rgba(37,99,235,0.0); }
  20% { box-shadow: 0 0 0 6px rgba(37,99,235,0.35); }
  100% { box-shadow: 0 0 0 0 rgba(37,99,235,0.0); }
}



.back-to-general-btn {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  border: 1px solid #1d4ed8;
  background: #2563eb;
  color: white;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.back-to-general-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.28);
}
.back-to-general-btn[hidden] {
  display: none !important;
}
.general-week-highlight {
  outline: 4px solid rgba(37, 99, 235, 0.35);
  outline-offset: 6px;
  border-radius: 14px;
  transition: outline-color .25s ease;
}



/* V46 - Menu Planning général en deux entrées */
.manual-main-rank-btn {
  background: #eef5ff !important;
  border-color: #bdd7ff !important;
  color: #0f3f8c !important;
  min-height: 44px;
}
.manual-main-absence-btn,
.manual-absent-red,
.manual-rank-item-btn.general-absence {
  background: #ff8b8b !important;
  border-color: #e25b5b !important;
  color: #7f1d1d !important;
  min-height: 44px;
}
.rank-choice-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  width: 100%;
}
.rank-status {
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.rank-status-free {
  color: #15803d !important;
}
.rank-status-occupied {
  color: #b91c1c !important;
}
.rank-assigned-name {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: #6b7280 !important;
  font-weight: 700;
}
.manual-rank-item-btn {
  display: block;
}

/* V53 - Menu visuel CDR sur les feuilles journalières */
.cdr-picker-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 32px;
}
.cdr-picker-wrap .cdr-input {
  padding-right: 24px !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  cursor: pointer;
}
.cdr-picker-wrap .cdr-input::placeholder {
  color: #8a94a6;
  font-weight: 700;
}
.cdr-picker-wrap.has-cdr .cdr-input {
  background: #fff7d6;
}
.cdr-clear-btn {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 14px;
  line-height: 16px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.cdr-clear-btn:hover {
  background: #991b1b;
}
.cdr-clear-btn[hidden] {
  display: none !important;
}
.daily-cdr-menu {
  position: absolute;
  z-index: 999999;
  width: 460px;
  max-width: calc(100vw - 20px);
  background: #ffffff;
  color: #111827;
  border: 1px solid #c7cdd8;
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.30);
  padding: 10px;
  font-size: 13px;
}
.daily-cdr-menu * {
  box-sizing: border-box;
}
.daily-cdr-menu-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 4px 9px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 8px;
}
.daily-cdr-menu-title {
  font-weight: 950;
  font-size: 14px;
  letter-spacing: .04em;
}
.daily-cdr-menu-subtitle {
  margin-top: 2px;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}
.daily-cdr-menu-close {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}
.daily-cdr-menu-close:hover {
  background: #e5e7eb;
}
.daily-cdr-menu-list {
  max-height: 430px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}
.daily-cdr-choice {
  width: 100%;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #111827;
  border-radius: 12px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  cursor: pointer;
  text-align: left;
}
.daily-cdr-choice-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.daily-cdr-choice:hover {
  background: #f8fbff;
  border-color: #b7cffc;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .12);
}
.daily-cdr-choice-name {
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.daily-cdr-choice.is-rest-cdr .daily-cdr-choice-name {
  color: #b91c1c;
}
.daily-cdr-choice-meta {
  color: #667085;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.daily-cdr-choice-meta.is-rest {
  color: #b91c1c;
}
.daily-cdr-choice-prev {
  color: #6b7280;
  font-size: 11px;
  font-style: italic;
  font-weight: 700;
  line-height: 1.25;
}
.daily-cdr-choice-badges {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.daily-cdr-choice-badge {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .03em;
  white-space: nowrap;
}
.daily-cdr-choice-badge.is-free {
  background: #dbeafe;
  color: #1d4ed8;
}
.daily-cdr-choice-badge.is-placed {
  background: #fee2e2;
  color: #b91c1c;
}

.daily-cdr-choice.is-absence-cdr {
  border-color: #ef4444;
  background: repeating-linear-gradient(135deg, #fee2e2 0, #fee2e2 7px, #fecaca 7px, #fecaca 14px);
  color: #7f1d1d;
  cursor: not-allowed;
  opacity: 1;
}
.daily-cdr-choice.is-absence-cdr:hover {
  background: repeating-linear-gradient(135deg, #fee2e2 0, #fee2e2 7px, #fecaca 7px, #fecaca 14px);
  border-color: #dc2626;
  box-shadow: none;
}
.daily-cdr-choice.is-absence-cdr .daily-cdr-choice-name {
  color: #7f1d1d;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
.daily-cdr-choice-absence {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  border-radius: 999px;
  padding: 4px 9px;
  background: #b91c1c;
  color: #ffffff;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .04em;
}
.daily-cdr-choice-badge.is-absence {
  background: #991b1b;
  color: #ffffff;
}


@media (max-width: 760px) {
  .daily-cdr-menu {
    width: calc(100vw - 20px) !important;
  }
  .daily-cdr-choice-badges {
    flex-wrap: wrap;
  }
}

/* ROBOcoach v1 - nouveau titre visuel inspiré LIPP */
.robocoach-header {
  align-items: center;
  padding-top: 16px;
  padding-bottom: 12px;
}

.robo-title-block {
  min-width: 0;
}

.robo-wordmark {
  display: flex;
  align-items: baseline;
  gap: 0;
  line-height: 0.9;
  color: #e60000;
  letter-spacing: -0.055em;
  text-shadow: 0 1px 0 #fff, 0 2px 8px rgba(230, 0, 0, 0.12);
  white-space: nowrap;
}

.robo-wordmark-main {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(44px, 7vw, 92px);
  font-weight: 900;
  text-transform: uppercase;
}

.robo-wordmark-sub {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(28px, 4.1vw, 58px);
  font-weight: 400;
  letter-spacing: -0.06em;
  margin-left: 3px;
}

.robo-version {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(18px, 2.4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-left: 22px;
}

.robo-title-block p {
  margin: 6px 0 0 4px;
  color: #555;
  font-size: 13px;
}

@media (max-width: 760px) {
  .robocoach-header {
    flex-direction: column;
    align-items: stretch;
  }

  .robo-wordmark {
    white-space: normal;
  }

  .calendar-link-btn {
    width: max-content;
  }
}

/* ROBOcoach v2 - options mémorisées du menu CDR */
.daily-cdr-menu-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 4px 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid #edf0f5;
}
.daily-cdr-menu-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}
.daily-cdr-menu-options input {
  width: 14px;
  height: 14px;
  accent-color: #e30613;
  cursor: pointer;
}
.daily-cdr-menu-empty {
  padding: 14px 10px;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  color: #6b7280;
  background: #f9fafb;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

/* ROBOcoach v5 - nouvelles statistiques semaine repliables */
.weekly-stats-panel {
  margin: 10px 0 20px;
  border: 1px solid #d8d8d8;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.weekly-stats-panel > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 900;
  color: #7c0b0b;
  background: linear-gradient(180deg, #fff, #f7f7f7);
  border-bottom: 1px solid transparent;
  user-select: none;
}
.weekly-stats-panel > summary::-webkit-details-marker { display: none; }
.weekly-stats-panel > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  transition: transform .15s ease;
}
.weekly-stats-panel[open] > summary {
  border-bottom-color: #e2e2e2;
}
.weekly-stats-panel[open] > summary::before {
  transform: rotate(90deg);
}
.weekly-stats-content {
  overflow-x: auto;
  padding: 10px;
}
.weekly-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: #fff;
}
.weekly-stats-table th,
.weekly-stats-table td {
  border: 1px solid #e2e2e2;
  padding: 7px 8px;
  text-align: center;
  vertical-align: top;
}
.weekly-stats-table thead th {
  background: #f3f3f3;
  font-weight: 900;
  color: #333;
  position: sticky;
  top: 0;
  z-index: 1;
}
.weekly-stats-table tbody th {
  text-align: left;
  white-space: nowrap;
  background: #fafafa;
  font-weight: 800;
}
.weekly-stats-ranks {
  text-align: left !important;
  min-width: 260px;
  line-height: 1.35;
}

/* ROBOcoach v8 - couleurs des compteurs statistiques */
.weekly-stat-count,
.weekly-stat-rank-count {
  display: inline-block;
  min-width: 1.6em;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}
.weekly-stat-rank-count {
  margin-left: 3px;
}
.stat-count-green {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
}
.stat-count-orange {
  color: #9a3412;
  background: #ffedd5;
  border: 1px solid #fdba74;
}
.stat-count-red {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}
.stat-count-violet {
  color: #6b21a8;
  background: #f3e8ff;
  border: 1px solid #d8b4fe;
}
.stat-count-zero {
  color: #6b7280;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}


/* ROBOcoach v11 - feuilles journalières en paysage dans l'application */
.daily-titlebar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  position: relative;
  margin-bottom: 6px;
}
.daily-titlebar .day-title {
  flex: 1;
  margin: 0;
}
.daily-print-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: #c91517;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 8px #0002;
}
.daily-print-btn:hover {
  filter: brightness(0.95);
}
.day-page {
  width: min(96vw, 420mm);
  min-height: auto;
}
.daily-services-landscape {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10mm;
  align-items: start;
}
.daily-service-column {
  min-width: 0;
}
.daily-services-landscape .planning-table {
  font-size: 11px;
}
.daily-services-landscape .planning-table th,
.daily-services-landscape .planning-table td {
  padding: 3px;
  height: 27px;
}
.daily-services-landscape .cdr-input {
  font-size: 12px;
  padding: 6px 4px;
}
@media (max-width: 1100px) {
  .daily-services-landscape {
    grid-template-columns: 1fr;
  }
  .day-page {
    width: min(96vw, 210mm);
  }
}
@media print {
  .daily-services-landscape {
    display: block;
  }
  .day-page {
    width: 210mm;
    min-height: 297mm;
  }
}


/* ROBOcoach v12 - feuilles journalières plus larges et bouton PDF visible */
body {
  overflow-x: auto;
}
main {
  max-width: none;
  width: 100%;
}
#planningPanel {
  margin-left: 8px;
  margin-right: 8px;
  padding-left: 8px;
  padding-right: 8px;
  overflow: visible;
}
#planningContent,
#planningContainer {
  width: 100%;
  overflow: visible;
}
.day-page {
  width: min(98vw, 1760px);
  max-width: none;
  padding: 8mm;
}
.daily-titlebar {
  min-height: 44px;
  padding-right: 165px;
}
.daily-print-btn {
  right: 10px;
  z-index: 5;
  white-space: nowrap;
}
.daily-services-landscape {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  width: 100%;
}
.daily-service-column {
  min-width: 0;
  width: 100%;
}
.daily-services-landscape .planning-table {
  width: 100%;
  table-layout: fixed;
  font-size: 12px;
}
.daily-services-landscape .planning-table th,
.daily-services-landscape .planning-table td {
  padding: 4px;
  height: 31px;
}
.daily-services-landscape .service-col { width: 21%; }
.daily-services-landscape .rang-col { width: 17%; }
.daily-services-landscape .name-col { width: 24%; }
.daily-services-landscape .recipe-col { width: 14%; }
.daily-services-landscape .cdr-input {
  font-size: 12px;
  padding: 6px 5px;
}
.daily-services-landscape .cdr-picker-wrap {
  max-width: 100%;
}
.daily-services-landscape .cdr-clear-btn,
.daily-services-landscape .daily-cdr-clear-btn {
  flex: 0 0 auto;
}
/* Le bouton flottant ne doit plus cacher toute la partie droite des feuilles. */
.floating-auto-zone {
  width: 245px;
  right: 10px;
  bottom: 10px;
  z-index: 7000;
}
.floating-auto-update {
  max-width: 245px;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.15;
}
.floating-auto-zone .auto-update-console {
  display: none;
}
.floating-auto-zone:hover .auto-update-console,
.floating-auto-zone:focus-within .auto-update-console {
  display: block;
}
@media (max-width: 1200px) {
  .day-page {
    width: 98vw;
    padding: 6mm;
  }
  .daily-services-landscape {
    gap: 12px;
  }
  .daily-services-landscape .planning-table {
    font-size: 11px;
  }
}
@media (max-width: 900px) {
  .daily-services-landscape {
    grid-template-columns: 1fr;
  }
  .daily-titlebar {
    padding-right: 0;
    flex-direction: column;
  }
  .daily-print-btn {
    position: static;
    transform: none;
  }
}
@media print {
  main { max-width: none; }
  #planningPanel { margin: 0; padding: 0; }
  .day-page {
    width: 210mm;
    padding: 10mm;
  }
}


/* ROBOcoach v13 - planning général compact, sans impacter les feuilles journalières larges */
#summaryPanel {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}
#summaryContent,
#summaryContainer {
  overflow: hidden;
}
#summaryContainer .general-week-summary {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
#summaryContainer .general-planning-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 10px;
}
#summaryContainer .general-planning-table th,
#summaryContainer .general-planning-table td {
  padding: 4px 3px;
  height: 38px;
}
#summaryContainer .general-planning-table thead th {
  font-size: 10px;
}
#summaryContainer .general-planning-table thead th span {
  font-size: 9px;
}
#summaryContainer .general-cdr-name {
  width: 128px;
  min-width: 128px;
  max-width: 128px;
  font-size: 10px;
  white-space: normal;
  overflow-wrap: anywhere;
}
#summaryContainer .general-planning-table td span,
#summaryContainer .general-coupure-split,
#summaryContainer .general-coupure-split span {
  font-size: 9px;
  line-height: 1.12;
}
#summaryContainer .daily-kpi-compact {
  gap: 2px;
  margin-top: 3px;
}
#summaryContainer .daily-kpi-compact span {
  font-size: 8px;
  padding: 1px 3px;
}
#summaryContainer .daily-unassigned {
  font-size: 8px;
  line-height: 1.15;
  padding: 2px 3px;
}
@media (max-width: 1100px) {
  #summaryPanel {
    margin-left: 8px;
    margin-right: 8px;
  }
  #summaryContainer .general-cdr-name {
    width: 112px;
    min-width: 112px;
    max-width: 112px;
  }
  #summaryContainer .general-planning-table {
    font-size: 9px;
  }
}

/* ROBOcoach v14 - bouton discret journal de connexions */
.log-access-btn {
  position: fixed;
  top: 7px;
  left: 7px;
  z-index: 99999;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.62);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  opacity: 0.42;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.log-access-btn:hover {
  opacity: 1;
}


/* ROBOcoach v16 - Gestion des absences */
.absence-manager {
  width: 100%;
}
.absence-manager-layout {
  display: grid;
  grid-template-columns: minmax(190px, 260px) 1fr;
  gap: 16px;
  align-items: start;
}
.absence-cdr-list {
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  max-height: 520px;
  overflow: auto;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}
.absence-cdr-list-title {
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .06em;
  color: #555;
  margin: 2px 0 8px;
}
.absence-cdr-btn {
  width: 100%;
  display: block;
  text-align: left;
  margin: 4px 0;
  padding: 8px 10px;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 10px;
  background: #f8fafc;
  font-weight: 700;
  cursor: pointer;
}
.absence-cdr-btn.active {
  background: #fee2e2;
  color: #991b1b;
  border-color: #ef4444;
}
.absence-calendar-area {
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}
.absence-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.absence-toolbar strong {
  font-size: 18px;
  color: #b91c1c;
}
.absence-toolbar label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
}
.absence-toolbar select {
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid #bbb;
  font-weight: 800;
}
.absence-nav-btn {
  border-radius: 999px;
  padding: 7px 11px;
  border: 1px solid rgba(0,0,0,.16);
  background: #f8fafc;
  cursor: pointer;
  font-weight: 800;
}
.absence-calendar-help {
  font-size: 12px;
  color: #666;
  margin: 4px 0 10px;
}
.absence-months-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
}
.absence-month {
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 14px;
  padding: 10px;
  background: #fbfbfb;
}
.absence-month h4 {
  margin: 0 0 8px;
  text-align: center;
  text-transform: capitalize;
  font-size: 15px;
}
.absence-weekdays,
.absence-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.absence-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  color: #555;
}
.absence-day {
  position: relative;
  min-height: 42px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  padding: 4px;
  overflow: hidden;
}
.absence-day:hover { outline: 2px solid rgba(239,68,68,.35); }
.absence-day.is-empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
}
.absence-day-number {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 11px;
  font-weight: 900;
  color: #333;
}
.absence-day-code {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 13px;
  font-weight: 950;
}
.absence-day-clear {
  position: absolute;
  top: 2px;
  right: 4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: #991b1b;
  border: 1px solid rgba(153,27,27,.35);
  line-height: 15px;
  font-size: 13px;
  font-weight: 900;
}
.absence-day.has-absence.general-absence {
  background: repeating-linear-gradient(135deg, #fecaca 0, #fecaca 7px, #fee2e2 7px, #fee2e2 14px) !important;
  color: #7f1d1d !important;
  border-color: #ef4444;
}
.absence-day.has-absence.general-absence-orange {
  background: #ffb347 !important;
  color: #5c2c00 !important;
  border-color: #f97316;
}
.absence-day.has-absence.general-absence-pink {
  background: #f4b6c7 !important;
  color: #7f1d1d !important;
  border-color: #db2777;
}
@media (max-width: 980px) {
  .absence-manager-layout { grid-template-columns: 1fr; }
  .absence-months-wrap { grid-template-columns: 1fr; }
  .absence-cdr-list { max-height: 220px; }
}

/* ROBOcoach v17 - Corrections Gestion des absences */
.absence-cdr-btn,
.absence-cdr-btn:visited,
.absence-cdr-btn:disabled {
  color: #111827 !important;
  background: #f8fafc !important;
  opacity: 1 !important;
}
.absence-cdr-btn.active {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border-color: #ef4444 !important;
}
.absence-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin: 6px 0 10px;
}
.absence-clear-btn {
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 999px;
  background: #f8fafc;
  color: #111827;
  font-weight: 850;
  font-size: 12px;
  padding: 7px 11px;
  cursor: pointer;
}
.absence-clear-btn:hover { background: #e5e7eb; }
.absence-clear-btn.danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}
.absence-clear-btn.danger:hover { background: #fecaca; }


/* ROBOcoach v18 - Liste CDR plus compacte dans Gestion des absences */
.absence-cdr-list {
  padding: 7px !important;
}
.absence-cdr-list-title {
  font-size: 11px !important;
  margin: 0 0 5px !important;
}
.absence-cdr-btn {
  margin: 2px 0 !important;
  padding: 5px 8px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  line-height: 1.12 !important;
  min-height: 26px !important;
}
.absence-cdr-list {
  max-height: 520px !important;
}
@media (max-width: 980px) {
  .absence-cdr-list { max-height: 260px !important; }
}

.cdr-row.has-fixed-plan {
  background: #3b2f00;
  border-radius: 8px;
  padding: 4px;
}
.cdr-name.fixed-plan-name {
  font-weight: 900 !important;
  color: #ffd400 !important;
  background: #2a2400 !important;
  border-color: #ffd400 !important;
}
.fixed-plan-badge {
  color: #ffd400;
  font-weight: 900;
  font-size: 11px;
  white-space: nowrap;
}
.fixed-plan-btn,
.fixed-plan-clear-btn {
  border: 0;
  border-radius: 7px;
  font-weight: 800;
  cursor: pointer;
  padding: 5px 6px;
  font-size: 11px;
}
.fixed-plan-btn { background: #ffd400; color: #251900; }
.fixed-plan-clear-btn { background: #7f1d1d; color: white; }
.fixed-plan-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fixed-plan-dialog {
  width: min(760px, calc(100vw - 28px));
  background: white;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
  padding: 18px;
  border: 3px solid #222;
}
.fixed-plan-dialog-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-size:20px;
  margin-bottom:8px;
}
.fixed-plan-close {
  width:34px;height:34px;border-radius:50%;border:0;background:#111;color:#fff;font-size:22px;cursor:pointer;
}
.fixed-plan-hint { margin: 0 0 14px; color:#555; font-weight:600; }
.fixed-plan-grid {
  display:grid;
  grid-template-columns: repeat(5, minmax(110px,1fr));
  gap: 10px;
}
.fixed-plan-grid label { font-weight:900; font-size:13px; }
.fixed-plan-select {
  margin-top:5px;
  width:100%;
  border-radius:9px;
  padding:9px 6px;
  font-weight:900;
  border:2px solid #222;
}
.fixed-plan-select.fixed-plan-opening { background:#14532d; color:white; }
.fixed-plan-select.fixed-plan-closing { background:#1e3a8a; color:white; }
.fixed-plan-select.fixed-plan-break { background:#fef3c7; color:#78350f; }
.fixed-plan-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:16px; flex-wrap:wrap; }
@media (max-width: 760px) {
  .cdr-row { grid-template-columns: 1fr 62px 62px 54px; }
  .fixed-plan-badge { grid-column: 1 / -1; }
  .fixed-plan-grid { grid-template-columns: 1fr; }
}

/* ROBOcoach v21 - console d'événements toujours visible */
.event-console-zone.floating-auto-zone {
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: auto !important;
  z-index: 9000 !important;
  width: min(1280px, calc(100vw - 24px)) !important;
  max-width: none !important;
  margin: 8px auto 10px auto !important;
  padding: 8px 10px !important;
  background: rgba(248, 250, 252, .96);
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .14);
  backdrop-filter: blur(8px);
}
.event-console-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.event-console-zone .floating-auto-update {
  width: auto !important;
  max-width: none !important;
  flex: 0 0 auto;
  padding: 8px 14px;
  font-size: 12px;
}
.event-console-help {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
.event-console-zone .auto-update-console,
.floating-auto-zone.event-console-zone .auto-update-console {
  display: block !important;
  margin-top: 0 !important;
  min-height: 126px;
  height: 126px;
  max-height: 45vh;
  resize: vertical;
  overflow: auto;
  border-radius: 12px;
}
.event-console-zone .auto-update-console ul {
  list-style: none;
  padding-left: 0;
}
.event-console-line {
  padding: 4px 8px;
  border-radius: 8px;
  margin: 2px 0 !important;
  border-left: 4px solid transparent;
}
.event-console-clickable { cursor: pointer; }
.event-console-clickable:hover { background: #eef6ff; }
.event-log-success { color: #166534; border-left-color: #22c55e; background: #f0fdf4; font-weight: 800; }
.event-log-error { color: #991b1b; border-left-color: #ef4444; background: #fef2f2; font-weight: 900; }
.event-log-neutral { color: #334155; border-left-color: #94a3b8; background: #f8fafc; }
.robo-event-target-highlight {
  animation: robo-event-highlight 5.2s ease forwards !important;
}
@keyframes robo-event-highlight {
  0% { outline: 0 solid rgba(250, 204, 21, 0); box-shadow: 0 0 0 0 rgba(250, 204, 21, 0); }
  10% { outline: 5px solid rgba(250, 204, 21, 1); box-shadow: 0 0 0 8px rgba(250, 204, 21, .45); }
  70% { outline: 5px solid rgba(250, 204, 21, .9); box-shadow: 0 0 0 8px rgba(250, 204, 21, .25); }
  100% { outline: 0 solid rgba(250, 204, 21, 0); box-shadow: 0 0 0 0 rgba(250, 204, 21, 0); }
}
@media print {
  .event-console-zone { display: none !important; }
}

/* ROBOcoach v23 - 3b. Détection des erreurs */
.error-detection-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.error-detection-summary,
.error-empty {
  border: 1px solid #dbe3ef;
  background: #f8fafc;
  color: #334155;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 800;
}
.error-detection-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.error-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid #dbe3ef;
  border-left-width: 7px;
}
.error-level-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  border-left-color: #3b82f6;
}
.error-level-warning {
  background: #fffbeb;
  border-color: #fde68a;
  border-left-color: #f59e0b;
}
.error-level-danger,
.error-level-error {
  background: #fef2f2;
  border-color: #fecaca;
  border-left-color: #ef4444;
}
.error-date {
  font-weight: 950;
  text-transform: capitalize;
  color: #111827;
  font-size: 13px;
}
.error-title {
  font-weight: 950;
  color: #0f172a;
  margin-top: 2px;
}
.error-title span {
  color: #475569;
  font-weight: 800;
}
.error-message {
  color: #334155;
  font-size: 13px;
  margin-top: 3px;
}
.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}
.error-actions button {
  border: 1px solid #93c5fd;
  background: #fff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 7px 10px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}
.error-actions button:hover {
  background: #dbeafe;
}
@media (max-width: 900px) {
  .error-row { grid-template-columns: 1fr; }
  .error-actions { justify-content: flex-start; }
}

/* ROBOcoach v24 - menu principal planning général + console persistante */
.manual-main-rest-btn {
  background: #fff3a6 !important;
  border-color: #facc15 !important;
  color: #6b4b00 !important;
  font-weight: 900;
}
.manual-main-clear-btn {
  background: #fff1f2 !important;
  border-color: #fecdd3 !important;
  color: #991b1b !important;
  font-weight: 900;
}
.event-console-clear-btn {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  padding: 3px 8px !important;
  font-size: 11px !important;
  border-radius: 999px !important;
  font-weight: 800 !important;
  white-space: nowrap;
}
.event-console-clear-btn:hover {
  background: #e2e8f0 !important;
  opacity: 1 !important;
}
.event-console-zone .auto-console-title {
  align-items: center;
}
.event-console-list {
  max-height: none;
}
.robo-event-target-highlight {
  position: relative !important;
  z-index: 6 !important;
  animation: robo-event-highlight-strong 5.2s ease forwards !important;
}
@keyframes robo-event-highlight-strong {
  0% { outline: 0 solid rgba(250, 204, 21, 0); box-shadow: inset 0 0 0 0 rgba(250, 204, 21, 0), 0 0 0 0 rgba(250, 204, 21, 0); }
  10% { outline: 5px solid rgba(250, 204, 21, 1); box-shadow: inset 0 0 0 4px rgba(250, 204, 21, .95), 0 0 0 10px rgba(250, 204, 21, .45); }
  70% { outline: 5px solid rgba(250, 204, 21, .9); box-shadow: inset 0 0 0 4px rgba(250, 204, 21, .7), 0 0 0 10px rgba(250, 204, 21, .25); }
  100% { outline: 0 solid rgba(250, 204, 21, 0); box-shadow: inset 0 0 0 0 rgba(250, 204, 21, 0), 0 0 0 0 rgba(250, 204, 21, 0); }
}

/* ROBOcoach v25 - bouton erreurs dans console + erreurs résolues */
.auto-console-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.auto-console-title > span {
  margin-right: auto;
}
.event-console-errors-btn {
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #0f172a !important;
  border-radius: 999px !important;
  padding: 5px 10px !important;
  font-weight: 950 !important;
  cursor: pointer !important;
  box-shadow: 0 1px 4px rgba(15,23,42,.12) !important;
}
.event-console-errors-btn:hover {
  background: #f8fafc !important;
  transform: translateY(-1px);
}
.err-count-red { color: #dc2626; font-weight: 1000; }
.err-count-yellow { color: #d97706; font-weight: 1000; }
.err-count-blue { color: #2563eb; font-weight: 1000; }
.error-resolved {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  border-left-color: #94a3b8 !important;
  opacity: .82;
}
.error-resolved .error-date,
.error-resolved .error-title,
.error-resolved .error-title span,
.error-resolved .error-message {
  color: #64748b !important;
  text-decoration: line-through;
}
.error-resolved-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  border-radius: 999px;
  padding: 7px 10px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}
.error-resolved-label input { accent-color: #64748b; }

/* ROBOcoach v26 : jours de contexte invisibles pour le moteur */
.robo-context-hidden-day{display:none!important;}

/* ROBOcoach v27 - boutons erreurs/effacer fixés dans l'en-tête de la console */
.event-console-header {
  position: relative;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}
.event-console-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.event-console-header .event-console-errors-btn,
.event-console-header .event-console-clear-btn {
  white-space: nowrap;
  flex: 0 0 auto;
}
.event-console-zone .auto-console-title #eventConsoleErrorsBtn,
.event-console-zone .auto-console-title .event-console-clear-btn {
  display: none !important;
}

/* ROBOcoach v28 - résolution automatique des erreurs Bis 10h */
.error-auto-fix {
  border: 1px solid #0f766e;
  background: #ccfbf1;
  color: #0f3f3a;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 800;
  cursor: pointer;
}
.error-auto-fix:hover {
  background: #99f6e4;
  transform: translateY(-1px);
}
.error-level-danger .error-title,
.error-level-danger .error-message {
  color: #7f1d1d;
}


/* ROBOcoach v35 - bouton impression toutes les feuilles dans l'entête partie 5 */
.planning-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0;
}
#planningPanel .planning-titlebar .summary-toggle-inline {
  flex: 1 1 auto;
}
#printAllDailySheetsBtn {
  flex: 0 0 auto;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .planning-titlebar { align-items: stretch; flex-direction: column; }
  #printAllDailySheetsBtn { width: 100%; white-space: normal; }
}


/* ROBOcoach v43 : sauvegarde de brouillons de planning */
.draft-toolbar {
  position: fixed;
  top: 30px;
  left: 6px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}
.draft-toolbar button {
  background: #ffffff;
  color: #222;
  border: 1px solid #cfcfcf;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  box-shadow: 0 2px 8px #0002;
}
.draft-toolbar button:hover { background: #f7f7f7; opacity: 1; }
.saved-plannings-window {
  position: fixed;
  min-width: 520px;
  min-height: 230px;
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - 20px);
  background: #fff;
  border: 1px solid #bfc7d4;
  border-radius: 12px;
  box-shadow: 0 12px 36px #0004;
  resize: both;
  overflow: hidden;
  z-index: 99999;
}
.saved-window-titlebar {
  cursor: move;
  user-select: none;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: linear-gradient(#182334, #111827);
  color: white;
}
.saved-window-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.saved-import-btn,
.saved-export-btn {
  background: #ffffff;
  color: #111827;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}
.saved-import-btn:hover,
.saved-export-btn:hover { background: #f8fafc; }
.saved-window-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  padding: 0;
  background: #ffffff22;
  color: white;
  font-weight: 900;
  font-size: 18px;
}
.saved-window-content {
  height: calc(100% - 42px);
  overflow: auto;
  padding: 10px;
}
.saved-plannings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.saved-plannings-table th,
.saved-plannings-table td {
  border: 1px solid #d6dbe4;
  padding: 7px 8px;
  text-align: left;
}
.saved-plannings-table th {
  background: #f2f5f9;
  position: sticky;
  top: 0;
  z-index: 1;
}
.saved-load-cell { cursor: pointer; }
.saved-load-cell:hover { background: #fff8cf; }
.saved-status-select {
  width: 100%;
  padding: 5px;
  font-weight: 700;
}
.saved-actions-cell {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.saved-delete-btn {
  background: #b00000;
  color: #fff;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 15px;
  line-height: 1;
}
.saved-empty {
  text-align: center!important;
  color: #667085;
  padding: 18px!important;
}
body.is-dragging-window { cursor: move; user-select: none; }
@media print {
  .draft-toolbar, .saved-plannings-window { display: none !important; }
}

/* ROBOcoach v47 - console d'événements repliable sur une seule ligne */
.event-console-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}
.event-console-collapse-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1f2937;
  border-radius: 999px;
  padding: 7px 11px;
  font-weight: 900;
  cursor: pointer;
}
.event-console-collapse-btn:hover { background: #f8fafc; }
.event-console-zone.event-console-collapsed {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  margin-bottom: 8px !important;
}
.event-console-zone.event-console-collapsed .event-console-header {
  margin-bottom: 0 !important;
}
.event-console-zone.event-console-collapsed #autoUpdateConsole {
  display: none !important;
}
.event-console-zone.event-console-collapsed .event-console-help {
  white-space: nowrap;
}

/* ROBOcoach v47 - fenêtre des plannings sauvegardés toujours au-dessus */
.saved-plannings-window {
  z-index: 2147483000 !important;
}


/* V56 - poignée de glisser-déposer sur le planning général */
.general-planning-table .general-drag-enabled {
  position: relative;
  padding-left: 22px;
  user-select: none;
}
.general-planning-table .general-drag-handle {
  position: absolute;
  left: 3px;
  top: 3px;
  bottom: 3px;
  width: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: rgba(17, 24, 39, .14);
  color: rgba(17, 24, 39, .78);
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
  cursor: grab;
  touch-action: none;
}
.general-planning-table .general-drag-handle:hover {
  background: rgba(17, 24, 39, .26);
}
.general-planning-table .general-drag-handle:active {
  cursor: grabbing;
}
.general-planning-table .general-drag-source {
  opacity: .55;
  outline: 3px dashed #1f4f8f !important;
}
.general-planning-table .general-drag-over {
  outline: 4px solid #f59e0b !important;
  box-shadow: inset 0 0 0 999px rgba(245, 158, 11, .16);
}
.general-planning-table .general-empty.general-drop-enabled {
  cursor: copy;
}


/* ROBOcoach v57 - Gestion des absences : 6 mois, scroll stable, boutons visibles */
.absence-nav-btn,
.absence-nav-btn:visited,
.absence-nav-btn:disabled {
  background: #e5e7eb !important;
  color: #111827 !important;
  border: 1px solid #9ca3af !important;
  opacity: 1 !important;
  text-shadow: none !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.12) !important;
}
.absence-nav-btn:hover {
  background: #d1d5db !important;
}
.absence-months-wrap {
  grid-template-columns: repeat(3, minmax(220px, 1fr)) !important;
}
.absence-month {
  padding: 8px !important;
}
.absence-day {
  min-height: 36px !important;
}
@media (max-width: 1400px) {
  .absence-months-wrap { grid-template-columns: repeat(2, minmax(240px, 1fr)) !important; }
}
@media (max-width: 980px) {
  .absence-months-wrap { grid-template-columns: 1fr !important; }
}
