/* styles.css — RJReport Web · Créateur Mickael Marie-Sainte */

:root {
  --fond: #f8fafc;
  --carte: #ffffff;
  --bordure: #e2e8f0;
  --accent: #1f4b57;
  --accent-clair: #2bb8c4;
  --discret: #64748b;
  --texte: #0f172a;
  --sup: #b91c1c;
  --rayon: 10px;
  --police: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police);
  font-size: 14px;
  line-height: 1.45;
}

/* ------------------------------------------------------------------ entête */

.entete {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 18px;
  background: var(--carte);
  border-bottom: 1px solid var(--bordure);
}
.logo { width: 34px; height: 34px; border-radius: 8px; }
.titres { display: flex; flex-direction: column; line-height: 1.2; margin-right: 8px; }
.titres strong { font-size: 15px; color: var(--accent); }
.discret { color: var(--discret); font-size: 12px; }
.actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- onglets */

.onglets {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 10px 18px 0;
  background: var(--fond);
  position: sticky; top: 56px; z-index: 15;
}
.onglet {
  border: 1px solid transparent; background: none;
  padding: 7px 16px; border-radius: 8px 8px 0 0;
  font: inherit; color: var(--discret); cursor: pointer;
}
.onglet:hover { background: rgba(31, 75, 87, .06); }
.onglet.actif {
  background: var(--carte); border-color: var(--bordure); border-bottom-color: var(--carte);
  color: var(--accent); font-weight: 600;
}

/* ------------------------------------------------------------------- corps */

main { padding: 16px 18px 40px; }

.carte {
  background: var(--carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.carte h2 { margin: 0 0 2px; font-size: 15px; color: var(--accent); }
.sous { margin: 0 0 10px; color: var(--discret); font-size: 12.5px; max-width: 90ch; }

.deux { display: grid; grid-template-columns: repeat(auto-fit, minmax(430px, 1fr)); gap: 16px; }
.deux .carte { margin-bottom: 0; }

/* ------------------------------------------------------------- formulaires */

.barre {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 8px 0;
}
.etat { color: var(--discret); font-size: 12.5px; }

button {
  font: inherit; padding: 6px 13px;
  border: 1px solid var(--bordure); border-radius: 7px;
  background: var(--carte); color: var(--texte); cursor: pointer;
}
button:hover { background: #eef2f6; }
button.primaire { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primaire:hover { background: #17383f; }
button.sup { color: var(--sup); border-color: transparent; padding: 2px 8px; }

.champ { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.champ > span { width: 210px; text-align: right; color: var(--discret); flex: none; }
.champ.compact > span { width: auto; }
.champ em { color: var(--discret); font-size: 12px; font-style: normal; }

input[type=text], input[type=number], input[type=date], select, textarea {
  font: inherit; padding: 5px 8px;
  border: 1px solid var(--bordure); border-radius: 6px;
  background: #fff; color: var(--texte);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-clair); outline-offset: -1px;
}
textarea { width: 100%; resize: vertical; font-family: var(--police); }

.case { display: flex; align-items: center; gap: 8px; margin: 6px 0; }

/* ------------------------------------------------------------------ tables */

.defile { overflow-x: auto; margin-top: 8px; }
table.grille { border-collapse: collapse; font-size: 13px; }
table.grille th {
  background: #f1f5f9; color: var(--discret); font-weight: 600;
  text-align: left; padding: 6px 8px; border: 1px solid var(--bordure); white-space: nowrap;
}
table.grille td { padding: 3px 6px; border: 1px solid var(--bordure); vertical-align: middle; }
table.grille input[type=text] { padding: 3px 6px; }
table.grille select { padding: 3px 4px; }

details { margin-top: 10px; }
summary { cursor: pointer; color: var(--accent); font-size: 13px; }
pre {
  font-family: var(--mono); font-size: 12px;
  background: #f8fafc; border: 1px solid var(--bordure); border-radius: 6px;
  padding: 10px; overflow: auto; max-height: 300px; white-space: pre;
}

/* ----------------------------------------------------------------- aperçus */

.apercu-capture {
  border: 1px solid var(--bordure); border-radius: 8px; background: #fff;
  min-height: 90px; display: flex; align-items: center; justify-content: center;
  color: var(--discret); padding: 8px; margin-top: 8px;
}
.apercu-capture img { max-width: 100%; max-height: 320px; }

.apercu-mail {
  width: 100%; height: 70vh; min-height: 480px;
  border: 1px solid var(--bordure); border-radius: 8px; background: #fff;
}

/* -------------------------------------------------------------------- pied */

.pied {
  position: sticky; bottom: 0;
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6px 18px;
  background: var(--carte); border-top: 1px solid var(--bordure);
  font-size: 12.5px; color: var(--discret);
}

@media (max-width: 720px) {
  .champ > span { width: 150px; }
  .actions { width: 100%; }
}
