* { box-sizing: border-box; }
body {
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0;
  background: #f4f5f7;
  color: #222;
}
.topbar {
  background: #1f2933;
  color: white;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar a { color: white; text-decoration: none; margin-right: 16px; }
.topbar .brand { font-weight: bold; }
.topbar form { display: inline; }
.topbar button {
  background: none; border: 1px solid #666; color: white; padding: 4px 10px; border-radius: 4px; cursor: pointer;
}
.container { max-width: 960px; margin: 24px auto; padding: 0 16px; }
.card {
  background: white; border-radius: 8px; padding: 20px; margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.card--narrow { max-width: 420px; }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
h1 { margin-top: 0; }
label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
input[type=text], input[type=password], input[type=email], textarea, select {
  display: block; width: 100%; margin-top: 6px; padding: 8px; border: 1px solid #ccc; border-radius: 4px;
  font-size: 14px; font-family: inherit; font-weight: normal;
}
button, .button {
  background: #00b53f; color: white; border: none; padding: 8px 16px; border-radius: 6px;
  cursor: pointer; text-decoration: none; display: inline-block; font-size: 14px;
}
button:disabled { opacity: 0.6; cursor: default; }
.link-button {
  background: none; border: none; color: #0366d6; padding: 0; cursor: pointer; font-size: 14px;
}
.link-button--danger { color: #d1242f; margin-left: 10px; }
.table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.table th, .table td { text-align: left; padding: 8px; border-bottom: 1px solid #eee; font-size: 14px; }
.hidden { display: none; }
.alert { padding: 10px 14px; border-radius: 6px; font-size: 14px; }
.alert--error { background: #ffeef0; color: #d1242f; }
.thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; }
.upload-preview { max-width: 100%; display: block; margin: 8px 0; border-radius: 4px; }
.section-hint { color: #667; font-size: 13px; margin: 4px 0 16px; }
.crop-container { max-width: 100%; margin: 10px 0; }
.crop-container canvas { max-width: 100%; border: 1px solid #ddd; touch-action: none; }
.progress-bar { background: #eee; border-radius: 8px; overflow: hidden; height: 20px; margin: 10px 0; }
.progress-bar__fill { background: #00b53f; height: 100%; text-align: center; color: white; font-size: 12px; line-height: 20px; }

/* Mise en page news liee : image a gauche, texte a droite (miroir du rendu final) */
.news-form-layout { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.news-form-media { flex: 0 0 260px; max-width: 260px; }
.news-form-media .upload-preview { max-width: 100%; }
.news-form-fields { flex: 1 1 260px; min-width: 220px; }
@media (max-width: 640px) {
  .news-form-layout { flex-direction: column; }
  .news-form-media { max-width: 100%; flex-basis: auto; }
}

/* Carte "news liee" : apercu fidele au rendu final (image a gauche, texte a droite) */
.news-card {
  border: 1px solid #e3e6ea; border-radius: 10px; padding: 16px;
  margin-bottom: 16px; background: #fff;
}
.news-card__preview {
  display: flex; gap: 16px; align-items: flex-start;
  cursor: pointer; border-radius: 8px; padding: 6px;
}
.news-card__preview:hover { background: #f4f5f7; }
.news-card__preview:focus-visible { outline: 2px solid #0366d6; outline-offset: 2px; }
.news-card__media { flex: 0 0 40%; max-width: 240px; }
.news-card__img {
  display: block; width: 100%; height: auto; border-radius: 8px; object-fit: cover;
}
.news-card__img--empty {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; background: #f1f3f5; color: #99a; font-size: 13px;
  border: 1px dashed #ccd; border-radius: 8px;
}
.news-card__body { flex: 1 1 auto; min-width: 0; }
.news-card__title { margin: 0 0 8px; font-size: 18px; }
.news-card__desc { margin: 0 0 12px; color: #333; line-height: 1.5; }
.news-card__button {
  display: inline-block; background: #00b53f; color: #fff;
  padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 600;
}
.news-card__actions {
  display: flex; gap: 16px; align-items: center;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid #eef0f2;
}
.news-card__img.hidden { display: none; }
.news-card__editor { margin-top: 0; padding-top: 0; }

/* En-tete du formulaire d'edition avec la case de fermeture. */
.news-edit-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.news-edit-head-title { font-weight: 700; }
.news-edit-close { font-size: 16px; line-height: 1; }

.news-form-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-top: 6px;
}
.button--secondary { background: #e5e7eb; color: #1f2933; }
.button--secondary:hover { background: #d7dbe0; }

@media (max-width: 640px) {
  .news-card__preview { flex-direction: column; }
  .news-card__media { flex-basis: auto; max-width: 100%; width: 100%; }
}

.autosave-status { display: inline-block; font-size: 13px; font-weight: 600; color: #666; }
.autosave-status--pending { color: #9a6b00; }
.autosave-status--ok { color: #00b53f; }
.autosave-status--error { color: #d1242f; }

/* Actions par icone : cibles tactiles confortables, cote a cote, jamais superposees */
.actions-cell { white-space: nowrap; width: 1%; }
.icon-actions { display: flex; gap: 10px; align-items: center; flex-wrap: nowrap; }
.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: 10px; border: 1px solid #d8dde3;
  background: white; color: #444; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.icon-button:hover { background: #f4f5f7; border-color: #ccc; }
.icon-button svg { width: 22px; height: 22px; display: block; fill: none; stroke: currentColor; }
.icon-button--send { color: #00863a; border-color: #bfe8cf; }
.icon-button--send:hover { background: #eafbf1; }
