/* Babou Coach 3.1 — fiabilité, corrections et outils de maintenance */
.save-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.save-indicator.saved { color: #9ce2bd; border-color: rgba(72, 187, 120, .35); background: rgba(72, 187, 120, .09); }
.save-indicator.saving { color: var(--gold); border-color: rgba(217, 184, 92, .4); background: rgba(217, 184, 92, .1); }
.save-indicator.error { color: #ffb4b4; border-color: rgba(255, 107, 107, .45); background: rgba(255, 107, 107, .1); }

.update-banner {
  position: sticky;
  top: 70px;
  z-index: 45;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  width: min(920px, calc(100% - 24px));
  margin: 10px auto 0;
  padding: 11px 12px;
  border: 1px solid rgba(217, 184, 92, .45);
  border-radius: 14px;
  background: rgba(7, 16, 31, .97);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .24);
}
.update-banner.hidden { display: none; }
.update-banner div { display: grid; gap: 2px; }
.update-banner span { color: var(--muted); font-size: 12px; }
.update-banner button { flex: 0 0 auto; }

.record-details { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.record-details summary,
.weekly-gallery-details summary { cursor: pointer; font-weight: 700; color: var(--text); }
.editable-record-list { display: grid; gap: 8px; margin-top: 12px; }
.editable-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.editable-record:last-child { border-bottom: 0; }
.editable-record > div:first-child { display: grid; gap: 2px; }
.editable-record span { color: var(--muted); font-size: 12px; }
.record-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.record-actions button { min-height: 36px; padding: 7px 10px; font-size: 12px; }
.history-record-actions { margin-top: 12px; justify-content: flex-start; }

.photo-management-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
}
.photo-management-actions button { min-height: 42px; padding: 8px; }

.diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.diagnostic-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .025);
}
.diagnostic-item span { color: var(--muted); font-size: 12px; }
.diagnostic-item strong { font-size: 14px; overflow-wrap: anywhere; }
.persistence-pending { color: var(--gold); }
.persistence-passed { color: #9ce2bd; }

.compact-modal-sheet { max-width: 620px; }
.editor-fields { display: grid; gap: 10px; margin: 12px 0 18px; }
.editor-fields .grid2,
.editor-fields .grid3 { margin: 0; }
.editor-fields textarea { min-height: 100px; resize: vertical; }
.photo-viewer-sheet { max-width: 720px; }
.photo-viewer-image {
  display: block;
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: 14px;
  background: #020711;
}

@media (max-width: 620px) {
  .save-indicator { max-width: 105px; overflow: hidden; text-overflow: ellipsis; }
  .update-banner { align-items: flex-start; }
  .update-banner button { min-width: 88px; }
  .photo-management-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diagnostics-grid { grid-template-columns: 1fr; }
  .editable-record { align-items: flex-start; }
  .record-actions { max-width: 150px; }
}
