/* ==========================================================================
   LSFD ARSON OS — Reports
   Liste des rapports + rendu "papier" A4 façon LSFD COMMANDING REPORT
   (DA calquée sur le template Canva officiel de la section)
   ========================================================================== */

/* ---------- Chips de statut rapport ---------- */
.chip.draft     { background: rgba(149, 114, 99, 0.15); color: var(--text-muted); border: 1px solid rgba(149, 114, 99, 0.35); }
.chip.submitted { background: rgba(242, 163, 92, 0.12); color: var(--accent-flame); border: 1px solid rgba(242, 163, 92, 0.4); }
.chip.validated { background: rgba(90, 179, 120, 0.12); color: var(--status-low); border: 1px solid rgba(90, 179, 120, 0.4); }
.chip.intervention { background: rgba(226, 72, 61, 0.12); color: var(--accent-red); border: 1px solid rgba(226, 72, 61, 0.4); }
.chip.general      { background: rgba(235, 160, 130, 0.1); color: var(--text-secondary); border: 1px solid var(--border-default); }

/* ---------- Éditeur ---------- */
.report-editor {
  padding: 16px 20px 28px;
  overflow-y: auto;
  height: 100%;
  user-select: text;
}

.report-editor .field textarea { min-height: 74px; }

.report-editor-section {
  border: 1px solid var(--border-default);
  background: var(--bg-panel);
  margin-bottom: 14px;
}

.report-editor-section-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent-red);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(226, 72, 61, 0.05);
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-editor-section-body { padding: 14px; }

.report-editor-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin: -4px 0 12px;
}

/* ---------- Vue papier ---------- */
.report-paper-wrap {
  background: #262019;
  padding: 26px 20px 40px;
  overflow: auto;
  height: calc(100% - 44px);
}

.report-paper {
  width: 794px;
  max-width: 100%;
  min-height: 1050px;
  margin: 0 auto;
  background: #f7f4ee;
  color: #1c1a17;
  position: relative;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6);
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  user-select: text;
}

/* Bandeau rouge supérieur */
.rp-band {
  background: #a8271b;
  color: #f7f4ee;
  padding: 18px 44px 16px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 4px solid #6d1810;
}

.rp-band img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: brightness(0) invert(1); /* logo blanc sur bandeau rouge */
}

.rp-band-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 3.5px;
}

.rp-band-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2.5px;
  opacity: 0.85;
  margin-top: 3px;
}

.rp-band-no {
  margin-left: auto;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  font-weight: 700;
}

.rp-band-no .rp-conf {
  display: block;
  font-size: 8px;
  letter-spacing: 2px;
  margin-top: 4px;
  opacity: 0.8;
}

/* Corps */
.rp-body {
  padding: 30px 44px 20px;
  flex: 1;
  font-size: 13px;
  line-height: 1.65;
}

/* Meta header (Officer in charge, Division, ...) */
.rp-meta {
  border: 1.5px solid #1c1a17;
  margin-bottom: 24px;
}

.rp-meta-row {
  display: grid;
  grid-template-columns: 210px 1fr;
  border-bottom: 1px solid #d8d2c6;
}

.rp-meta-row:last-child { border-bottom: none; }

.rp-meta-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 8px 12px;
  background: #ece7dc;
  color: #6d1810;
  border-right: 1px solid #d8d2c6;
}

.rp-meta-value {
  padding: 8px 14px;
  font-weight: 600;
  font-size: 12.5px;
}

/* Titre du rapport */
.rp-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  margin: 0 0 4px;
  color: #1c1a17;
}

.rp-title-date {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: #7a7468;
  margin-bottom: 26px;
}

/* Sections */
.rp-section { margin-bottom: 22px; }

.rp-section h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #a8271b;
  border-bottom: 2px solid #a8271b;
  padding-bottom: 4px;
  margin-bottom: 10px;
}

.rp-field-line {
  display: flex;
  gap: 8px;
  margin: 3px 0;
}

.rp-field-line b {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.rp-text {
  white-space: pre-wrap;
  font-size: 12.5px;
}

.rp-text-block {
  background: #f1ece2;
  border-left: 3px solid #a8271b;
  padding: 10px 14px;
  white-space: pre-wrap;
  font-size: 12.5px;
}

/* Tampon statut */
.rp-stamp {
  position: absolute;
  top: 150px;
  right: 44px;
  width: 120px;
  height: 120px;
  border: 3.5px solid;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 2px;
  line-height: 1.3;
  transform: rotate(-12deg);
  opacity: 0.55;
  pointer-events: none;
  text-transform: uppercase;
}

.rp-stamp.validated { color: #1a7a3a; border-color: #1a7a3a; }
.rp-stamp.submitted { color: #b8860b; border-color: #b8860b; }
.rp-stamp.draft     { color: #8a8478; border-color: #8a8478; }

/* Pied de page : bloc officiers + mentions */
.rp-footer {
  padding: 18px 44px 26px;
  border-top: 1.5px solid #1c1a17;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
}

.rp-officers {
  font-size: 11px;
}

.rp-officers-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #6d1810;
  margin-bottom: 8px;
}

.rp-officer {
  margin: 4px 0;
}

.rp-officer .rank {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #7a7468;
  display: block;
}

.rp-officer .name {
  font-weight: 700;
  font-size: 12px;
}

.rp-footer-right {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: #7a7468;
}

.rp-footer-right .no {
  font-weight: 700;
  color: #1c1a17;
  font-size: 12px;
  display: block;
  margin-bottom: 4px;
}

.rp-footer-right .conf {
  color: #a8271b;
  font-weight: 700;
  display: block;
  margin-top: 4px;
}

/* Signature */
.rp-sig-line {
  margin-top: 14px;
  border-top: 1px solid #1c1a17;
  padding-top: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  min-width: 180px;
  text-align: center;
}

/* ==========================================================================
   PARTAGE PUBLIC
   ========================================================================== */
.share-state {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--border-default);
}
.share-state.on  { background: rgba(90, 179, 120, 0.08); border-color: rgba(90, 179, 120, 0.35); }
.share-state.off { background: var(--bg-surface); }

.share-state-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
  background: var(--text-muted);
}
.share-state.on .share-state-dot {
  background: var(--status-low);
  box-shadow: 0 0 8px var(--status-low);
}

.share-state-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 3px;
}
.share-state.on .share-state-title { color: var(--status-low); }

.share-state-sub { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

.share-url-row { display: flex; gap: 8px; }
.share-url-row input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.share-url-row input:disabled { opacity: 0.45; }
.share-url-row .btn { white-space: nowrap; }

.callout-warn {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(212, 166, 69, 0.08);
  border: 1px solid rgba(212, 166, 69, 0.3);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.callout-warn svg { stroke: var(--accent-gold); flex-shrink: 0; margin-top: 1px; }

/* Pastille "public" dans la liste des rapports */
.report-public-dot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--status-low);
  background: rgba(90, 179, 120, 0.1);
  border: 1px solid rgba(90, 179, 120, 0.3);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 6px;
}
.report-public-dot svg { width: 9px; height: 9px; }

/* ==========================================================================
   ANNEXE — 2ᵉ feuille (rapport de police externe)
   ========================================================================== */

/* Bascule entre les deux feuilles, dans la barre d'outils */
.sheet-switch {
  display: inline-flex;
  gap: 3px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 3px;
  margin-left: 12px;
}

.sheet-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.sheet-tab svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; }
.sheet-tab:hover { color: var(--text-primary); }

.sheet-tab.active {
  background: var(--accent-red);
  color: #fff;
}

/* Animation de bascule entre les feuilles : léger fondu + glissement,
   comme si on passait à la page suivante du dossier papier */
@keyframes sheetSlideIn {
  from { opacity: 0; transform: translateX(26px) scale(0.995); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes sheetSlideInLeft {
  from { opacity: 0; transform: translateX(-26px) scale(0.995); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
.report-paper-wrap.sheet-anim-right { animation: sheetSlideIn 0.28s var(--ease-snap, ease); }
.report-paper-wrap.sheet-anim-left  { animation: sheetSlideInLeft 0.28s var(--ease-snap, ease); }

/* Conteneur de la feuille annexe */
.annex-wrap { display: flex; justify-content: center; }

/* L'annexe est isolée dans une iframe sandbox : contenu tiers, écrit par des
   joueurs — aucun script ne doit pouvoir s'exécuter dans notre terminal. */
.annex-frame {
  width: 100%;
  max-width: 900px;
  height: 100%;
  min-height: 1000px;
  border: none;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6);
}

.annex-loading,
.annex-error {
  margin: auto;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 40px;
}

.annex-error-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--status-critical);
  margin-bottom: 10px;
}
.annex-error-title svg { stroke: var(--status-critical); }

.annex-error-msg {
  color: var(--text-secondary);
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.annex-error .btn { display: inline-flex; text-decoration: none; }

/* Pastille "annexe" dans la liste des rapports */
.report-annex-dot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--accent-flame);
  background: rgba(242, 163, 92, 0.1);
  border: 1px solid rgba(242, 163, 92, 0.3);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 6px;
}

/* ---------- Liste : lignes cliquables ---------- */
.reports-table tbody tr { cursor: pointer; }

.report-row-number {
  font-family: var(--font-mono);
  color: var(--accent-flame);
  font-size: 11px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
