/* ══════════════════════════════════════════════════════════════
   Predictive Project Management — Styles partagés entre index.html et les 4 modules
   Chaque page définit sa propre palette d'accent avant ce fichier
   n'est pas chargé, mais après : elle définit --accent / --accent-bg /
   --accent-border dans son propre <style> (voir en tête de chaque page).
   Défauts ci-dessous = bleu (module 1/2).
   ══════════════════════════════════════════════════════════════ */

:root {
  --accent: #2e6be6;
  --accent-bg: #eef3ff;
  --accent-border: #c8d4f8;
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #f0f3f9; color: #1a1d2e; min-height: 100vh; }

/* ── Topbar ── */
.topbar { background: #1a1d2e; color: #fff; display: flex; align-items: center; gap: 12px; padding: 0 22px; height: 50px; }
.back-btn { font-size: 0.75rem; color: #7eb8f7; text-decoration: none; display: flex; align-items: center; gap: 4px; border: 1px solid #7eb8f730; border-radius: 6px; padding: 3px 9px; transition: background 0.15s; }
.back-btn:hover { background: #2a3050; }
.topbar-title { font-size: 0.88rem; font-weight: 800; color: #fff; }
.topbar-sub { font-size: 0.72rem; color: #7a839e; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.agent-badge { display: flex; align-items: center; gap: 5px; font-size: 0.7rem; color: #8ef5b0; border: 1px solid #8ef5b030; border-radius: 20px; padding: 3px 10px; }
.adot { width: 6px; height: 6px; border-radius: 50%; background: #8ef5b0; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── Process nav ── */
.process-nav { background: #fff; border-bottom: 1px solid #e2e8f4; padding: 0 22px; display: flex; gap: 0; overflow-x: auto; }
.pnav-item { padding: 12px 16px; font-size: 0.74rem; font-weight: 600; color: #9099b5; border-bottom: 3px solid transparent; white-space: nowrap; cursor: pointer; transition: all 0.15s; display: flex; align-items: center; gap: 5px; }
.pnav-item.active { color: var(--accent); border-bottom-color: var(--accent); }
.pnav-item.done { color: #2e7d32; }
.pnav-item.done::after { content: '✓'; font-size: 0.65rem; background: #e8f5e9; color: #2e7d32; border-radius: 10px; padding: 1px 5px; }
.pnav-item.locked { opacity: 0.4; cursor: not-allowed; }

/* ── Page layout ── */
.page { max-width: 980px; margin: 0 auto; padding: 24px 20px; }

/* ── Process header ── */
.process-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.ph-num { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff; font-size: 1.1rem; font-weight: 900; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ph-title { font-size: 1.1rem; font-weight: 900; color: #1a1d2e; }
.ph-sub { font-size: 0.78rem; color: #7a839e; margin-top: 2px; }
.ph-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.67rem; font-weight: 700; background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent-border); border-radius: 20px; padding: 2px 9px; margin-top: 5px; }

/* ── Section label ── */
.slabel { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.09em; color: #9099b5; margin-bottom: 8px; margin-top: 20px; }

/* ── Cards ── */
.card { background: #fff; border: 1px solid #e2e8f4; border-radius: 14px; padding: 18px 20px; margin-bottom: 14px; }
.card-title { font-size: 0.82rem; font-weight: 800; color: #1a1d2e; margin-bottom: 14px; display: flex; align-items: center; gap: 7px; }

/* ── Form elements ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1/-1; }
label { font-size: 0.71rem; font-weight: 700; color: #555; }
label span { font-weight: 400; color: #9099b5; margin-left: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], select, textarea {
  border: 1.5px solid #d0d7f0; border-radius: 9px;
  padding: 9px 12px; font-size: 0.8rem; font-family: inherit;
  color: #1a1d2e; background: #fff; transition: border-color 0.2s;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; }

/* ── Save bar & buttons ── */
.save-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid #e2e8f4; padding: 13px 20px; display: flex; align-items: center; gap: 10px; margin: 0 -20px; }
.btn { padding: 9px 20px; border-radius: 9px; font-size: 0.82rem; font-weight: 700; cursor: pointer; border: none; transition: opacity 0.15s, transform 0.1s; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: 0.88; }
.btn-secondary { background: #f0f3f9; color: #555; border: 1px solid #e2e8f4; }
.btn-danger { background: #fdecea; color: #c0392b; border: 1px solid #f5c0c0; }
.btn-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.btn-next { background: #1a1d2e; color: #fff; margin-left: auto; display: flex; align-items: center; gap: 6px; }
.btn-next:hover { opacity: 0.88; }
.btn-sm { padding: 5px 11px; font-size: 0.68rem; border-radius: 7px; }
.save-status { font-size: 0.72rem; color: #9099b5; display: flex; align-items: center; gap: 5px; }
.save-dot { width: 6px; height: 6px; border-radius: 50%; background: #2e7d32; }

/* ── Fichiers IN/OUT (en tête de chaque onglet) — même format que les autres
   tableaux de l'app : .slabel + .card + .pl-table, avec un .score-pill pour
   le badge IN/OUT (au lieu d'un composant dédié qui ne ressemblait à rien
   d'autre dans l'app). ── */
.file-io-in { background: #eef3ff; color: #2e6be6; }
.file-io-out { background: #e8f5e9; color: #2e7d32; }
.file-io-name { font-family: 'Courier New', monospace; font-weight: 700; color: #1a1d2e; white-space: nowrap; }
.file-io-link { font-size: 0.68rem; font-weight: 700; color: #2e6be6; text-decoration: none; white-space: nowrap; }
.file-io-link:hover { text-decoration: underline; }

/* ── Toast ── */
.toast { position: fixed; bottom: 80px; right: 22px; background: #1a1d2e; color: #fff; border-radius: 10px; padding: 10px 18px; font-size: 0.79rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 0.3s; z-index: 99; }
.toast.show { opacity: 1; }

/* ── KPI / stats ── */
.stats-bar { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 14px; }
.stat-box { background: #fff; border: 1px solid #e2e8f4; border-radius: 10px; padding: 10px 13px; text-align: center; }
.stat-val { font-size: 1.1rem; font-weight: 900; color: #1a1d2e; }
.stat-label { font-size: 0.64rem; color: #9099b5; margin-top: 2px; }

/* ── Generic data table ── */
.pl-table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid #e2e8f4; }
.pl-table { width: 100%; border-collapse: collapse; font-size: 0.73rem; }
.pl-table th { background: #1a1d2e; color: #c8d4f8; padding: 8px 10px; text-align: left; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.pl-table td { padding: 7px 10px; border-bottom: 1px solid #f0f2f8; color: #333; vertical-align: middle; }
.pl-table tr:last-child td { border-bottom: none; }
.pl-table tr:hover td { background: #f7f9ff; }

/* ── Score pills (used by identification/scoring tables) ── */
.score-pill { font-size: 0.65rem; font-weight: 800; border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.score-h { background: #e8f5e9; color: #2e7d32; }
.score-m { background: #fff3e0; color: #d07000; }
.score-l { background: #fdecea; color: #c0392b; }

/* ── Prompt box (prompt Claude Code à copier) ── */
.prompt-box { background: #1a1d2e; border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.prompt-label { font-size: 0.63rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; color: #7eb8f7; margin-bottom: 8px; }
.prompt-text { font-family: 'Courier New', monospace; font-size: 0.7rem; color: #c8d4f8; line-height: 1.65; white-space: pre-wrap; }
.prompt-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.prompt-btn { font-size: 0.68rem; font-weight: 700; border: 1px solid #3a4060; border-radius: 7px; padding: 5px 12px; background: #2a2f45; color: #c8d4f8; cursor: pointer; transition: background 0.15s; }
.prompt-btn:hover { background: #3a4060; }
.prompt-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Import zone (glisser-déposer un fichier) ── */
.import-zone { border: 2px dashed var(--accent-border); border-radius: 12px; padding: 24px 20px; text-align: center; cursor: pointer; transition: all 0.15s; background: var(--accent-bg); }
.import-zone:hover { border-color: var(--accent); }
.import-zone .iz-icon { font-size: 1.8rem; margin-bottom: 6px; }
.import-zone .iz-title { font-size: 0.8rem; font-weight: 700; color: #1a1d2e; margin-bottom: 4px; }
.import-zone .iz-sub { font-size: 0.71rem; color: #9099b5; }
.import-zone .iz-formats { font-size: 0.65rem; color: #bbb; margin-top: 6px; }

.empty-hint { text-align: center; padding: 30px 15px; color: #9099b5; font-size: 0.78rem; }

/* ── Footer ── */
.app-footer { text-align: center; font-size: 0.68rem; color: #9099b5; padding: 14px 10px 70px; letter-spacing: 0.02em; display: flex; align-items: center; justify-content: center; gap: 0; }

@media(max-width:640px){
  .form-grid { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: 1fr 1fr; }
}
