/*
 * Dowin — compte rendu exportable (1.169.0).
 *
 * Une fenêtre d'aperçu : en-tête, avertissement « fichier en clair », deux
 * boutons d'export, puis les sections du rapport. Les couleurs viennent des
 * variables de l'application ; les états (présence, tâche) passent par
 * `data-*`, jamais par un style en ligne. Sur 369 px, les boutons s'empilent et
 * gardent une cible d'au moins 44 px.
 */

/* -------------------------------- Fenêtre -------------------------------- */

.cr {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.cr__entete {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cr__titre {
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.cr__sous-titre {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.4;
}

/* L'avertissement est volontairement visible : le fichier exporté est en
 * clair, et c'est la seule chose que l'utilisateur doit retenir avant de le
 * partager. */
.cr__avertissement {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border-left: 3px solid var(--warn);
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.cr__avertissement svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--warn);
}

/* -------------------------------- Export --------------------------------- */

.cr__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
}

.cr__exporter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.25;
  white-space: normal;
}

.cr__exporter svg {
  flex: none;
  width: 16px;
  height: 16px;
}

.cr__exporter:disabled {
  opacity: 0.55;
  cursor: default;
}

/* -------------------------------- Aperçu --------------------------------- */

.cr__apercu {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.cr__apercu-titre {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.cr__reunion {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.4;
}

.cr__reunion svg {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--green);
}

/* -------------------------------- Sections ------------------------------- */

.cr__section {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding-top: 2px;
}

.cr__section-titre {
  margin: 0;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
}

.cr__participants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.cr__participant {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 100%;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cr__bilan {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.4;
}

.cr__presence {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}

.cr__presence:last-child {
  border-bottom: 0;
}

.cr__presence-nom {
  min-width: 0;
  overflow-wrap: anywhere;
}

.cr__presence-etat {
  flex: none;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.cr__presence[data-presence='present'] .cr__presence-etat {
  color: var(--green);
}

.cr__presence[data-presence='retard'] .cr__presence-etat {
  color: #c47f00;
}

.cr__presence[data-presence='absent'] .cr__presence-etat {
  color: var(--danger);
}

[data-theme='dark'] .cr__presence[data-presence='retard'] .cr__presence-etat {
  color: #f0b429;
}

.cr__ordre {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.cr__ordre li {
  margin: 2px 0;
  overflow-wrap: anywhere;
}

/* ------------------------------- Décisions ------------------------------- */

.cr__decision {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
}

.cr__decision-entete {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
  min-width: 0;
}

.cr__decision-auteur {
  min-width: 0;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.cr__decision-date {
  flex: none;
  margin-left: auto;
  color: var(--text-soft);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.cr__decision-texte {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* -------------------------------- Actions -------------------------------- */

.cr__action {
  --cr-accent: var(--warn);

  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px 8px 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--cr-accent);
  border-radius: 9px;
  background: var(--panel-2);
}

.cr__action[data-etat='a-faire'] {
  --cr-accent: var(--warn);
}

.cr__action[data-etat='en-cours'] {
  --cr-accent: #2b7de9;
}

.cr__action[data-etat='termine'] {
  --cr-accent: var(--green);
}

.cr__action-entete {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
  min-width: 0;
}

.cr__action-titre {
  min-width: 0;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.cr__action-etat {
  flex: none;
  color: var(--cr-accent);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.cr__action-meta {
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.cr__action-details {
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* -------------------------------- Fichiers ------------------------------- */

.cr__fichier {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.cr__fichier:last-child {
  border-bottom: 0;
}

.cr__fichier svg {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--text-soft);
}

.cr__fichier-nom {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cr__fichier-meta {
  flex: none;
  max-width: 45%;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------- Pied et état vide --------------------------- */

.cr__genere {
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.cr__vide {
  padding: 24px 12px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

/* Sur 369 px, les deux exports s'empilent et les boutons restent tactiles. */
@media (max-width: 620px) {
  .cr {
    gap: 10px;
  }

  .cr__actions {
    grid-template-columns: 1fr;
  }

  .cr__exporter {
    min-height: 44px;
  }

  .cr__titre {
    font-size: 16px;
  }
}
