/* ===== FICHE DE SYNTHÈSE — STYLES IMPRESSION ===== */
:root {
  --primary: #1a3a5c;
  --accent: #f59e0b;
  --success: #16a34a;
  --danger: #dc2626;
  --purple: #7c3aed;
  --bg: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-light: #64748b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f0f4f8;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

/* ===== BARRE D'ACTION (masquée à l'impression) ===== */
.action-bar {
  background: var(--primary);
  color: white;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  print-color-adjust: exact;
}

.action-bar .logo { font-weight: 800; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.action-bar .logo span { background: var(--accent); color: var(--primary); padding: 3px 8px; border-radius: 5px; font-size: 0.85rem; }
.action-bar .actions { display: flex; gap: 8px; }

.btn-dl {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 6px; font-weight: 700;
  font-size: 0.85rem; text-decoration: none; border: none; cursor: pointer;
  transition: all 0.2s;
}
.btn-dl.primary { background: var(--accent); color: var(--primary); }
.btn-dl.primary:hover { background: #d97706; }
.btn-dl.secondary { background: rgba(255,255,255,0.15); color: white; border: 1px solid rgba(255,255,255,0.3); }
.btn-dl.secondary:hover { background: rgba(255,255,255,0.25); }

/* ===== PAGE A4 ===== */
.page {
  width: 210mm;
  min-height: 297mm;
  margin: 20px auto;
  background: white;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  padding: 14mm 14mm 12mm;
  position: relative;
}

/* ===== EN-TÊTE ===== */
.page-header {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 2px solid var(--primary);
}

.header-band {
  background: var(--primary);
  color: white;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 140px;
}

.header-band .module-num { font-size: 0.72rem; opacity: 0.75; text-transform: uppercase; letter-spacing: 1px; }
.header-band .module-title { font-size: 1.05rem; font-weight: 800; line-height: 1.2; margin-top: 2px; }

.header-content {
  flex: 1;
  padding: 10px 14px;
  background: #f8fafc;
}

.header-content .doc-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.header-content h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  margin: 2px 0 4px;
}

.header-content .meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-sm {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}
.tag-sm.green { background: #dcfce7; color: #15803d; }
.tag-sm.orange { background: #fef3c7; color: #d97706; }
.tag-sm.purple { background: #f3e8ff; color: #7c3aed; }
.tag-sm.red { background: #fee2e2; color: #dc2626; }

.header-logo-area {
  background: var(--primary);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  min-width: 60px;
}

/* ===== COLONNES ===== */
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.cols-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 10px 0; }
.col-6040 { display: grid; grid-template-columns: 6fr 4fr; gap: 10px; }
.col-4060 { display: grid; grid-template-columns: 4fr 6fr; gap: 10px; }

/* ===== BLOCS ===== */
.bloc {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
  break-inside: avoid;
}

.bloc-header {
  background: var(--primary);
  color: white;
  padding: 5px 12px;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bloc-body { padding: 8px 12px; }

.bloc-header.accent { background: var(--accent); color: var(--primary); }
.bloc-header.green { background: #15803d; }
.bloc-header.red { background: var(--danger); }
.bloc-header.purple { background: var(--purple); }
.bloc-header.orange { background: #d97706; }

/* ===== LISTES ===== */
ul.compact, ol.compact {
  padding-left: 16px;
  margin: 4px 0;
}

ul.compact li, ol.compact li {
  font-size: 0.82rem;
  margin-bottom: 3px;
  color: var(--text);
}

ul.compact li::marker { color: var(--primary); }

ul.check li { list-style: none; padding-left: 4px; font-size: 0.82rem; margin-bottom: 3px; }
ul.check li::before { content: "✅ "; }
ul.cross li { list-style: none; padding-left: 4px; font-size: 0.82rem; margin-bottom: 3px; }
ul.cross li::before { content: "❌ "; }

/* ===== TABLEAUX ===== */
table.synop {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.79rem;
  margin: 6px 0;
}

table.synop th {
  background: var(--primary);
  color: white;
  padding: 5px 8px;
  text-align: left;
  font-size: 0.75rem;
}

table.synop td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.synop tr:nth-child(even) td { background: #f8fafc; }
table.synop tr:last-child td { border-bottom: none; }

table.synop th.accent { background: var(--accent); color: var(--primary); }
table.synop th.green { background: #15803d; }
table.synop th.purple { background: var(--purple); }

/* ===== FORMULES ===== */
.formula {
  background: var(--primary);
  color: white;
  border-radius: 6px;
  padding: 7px 12px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  margin: 6px 0;
}
.formula.accent { background: var(--accent); color: var(--primary); }
.formula.green { background: #15803d; }

/* ===== CALLOUTS ===== */
.note {
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.78rem;
  border-left: 3px solid;
  margin: 6px 0;
  display: flex;
  gap: 6px;
}
.note.info { background: #e0f2fe; border-color: #0369a1; color: #0c4a6e; }
.note.warning { background: #fef3c7; border-color: #d97706; color: #78350f; }
.note.success { background: #dcfce7; border-color: #15803d; color: #14532d; }
.note.danger { background: #fee2e2; border-color: #dc2626; color: #7f1d1d; }
.note-icon { flex-shrink: 0; font-size: 1rem; }
.note p { margin: 0; }

/* ===== KPI BOXES ===== */
.kpi-row { display: flex; gap: 6px; margin: 6px 0; }
.kpi {
  flex: 1;
  background: var(--primary);
  color: white;
  border-radius: 6px;
  padding: 8px;
  text-align: center;
}
.kpi .kpi-val { font-size: 1.1rem; font-weight: 800; }
.kpi .kpi-label { font-size: 0.65rem; opacity: 0.85; margin-top: 2px; }
.kpi.accent { background: var(--accent); color: var(--primary); }
.kpi.green { background: #15803d; }
.kpi.red { background: var(--danger); }
.kpi.purple { background: var(--purple); }

/* ===== TIMELINE COMPACT ===== */
.timeline-compact { padding-left: 20px; border-left: 2px solid var(--primary); margin: 6px 0; }
.timeline-compact li {
  list-style: none;
  position: relative;
  padding: 2px 0 2px 10px;
  font-size: 0.8rem;
  margin-bottom: 4px;
}
.timeline-compact li::before {
  content: '';
  position: absolute;
  left: -15px; top: 7px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* ===== FOOTER ===== */
.page-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 2px solid var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: var(--text-light);
}

.page-footer .footer-logo { font-weight: 800; color: var(--primary); }

/* ===== PRINT ===== */
@media print {
  body { background: white; font-size: 11px; }
  .action-bar { display: none !important; }
  .page {
    margin: 0;
    padding: 10mm 12mm;
    box-shadow: none;
    width: 100%;
    min-height: auto;
  }
  @page { size: A4; margin: 8mm; }
}
