/* ============================================================
   FEYS DIGITAL SERVICES — suivi des projets clients
   Feuille dérivée de template-page-fds.html (charte visuelle) :
   mêmes variables, mêmes composants que l'outil de gestion des devis.
   Tout part des variables ci-dessous : change-les ici, jamais ailleurs.
   ============================================================ */
:root {
  /* Couleurs — relevées sur le logo */
  --navy:    #213455;   /* principale : texte, aplats, en-têtes */
  --or:      #BB8142;   /* accent : filets, liens, pastilles */
  --ardoise: #5D6E8C;   /* texte secondaire */
  --sable:   #E3E0D6;   /* bordures, séparateurs */
  --creme:   #F3F2ED;   /* fond de page */
  --blanc:   #FFFFFF;
  --encre:   #2B2B2B;   /* texte courant sur fond clair */
  --navy-clair: #9FAEC6; /* texte secondaire SUR fond navy */
  --rouge:   #9C3B2E;
  --vert:    #3F6B4A;

  /* Typographie */
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans:  'Public Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --mono:  ui-monospace, 'Cascadia Code', Consolas, monospace;

  /* Rythme */
  --r:  6px;    /* rayon standard */
  --r-l: 100px; /* rayon pilule */
  --gap: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--creme);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
}

.wrap { max-width: 1240px; margin: 0 auto; padding: 32px 28px 70px; }

/* ---------- En-tête ---------- */
.page-header {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  border-bottom: 2px solid var(--or); padding-bottom: 18px; margin-bottom: 12px;
}
.page-header img { width: 56px; height: 56px; border-radius: var(--r); display: block; }
.page-header-texte { flex: 1 1 auto; min-width: 200px; }
.kicker { font-size: 11px; letter-spacing: .14em; color: var(--or); font-weight: 600; }
.page-header h1 { font-family: var(--serif); font-size: 27px; font-weight: 600; margin: 3px 0 0; }
.page-header p { margin: 0; color: var(--ardoise); font-size: 14px; }

/* ---------- Navigation en pilules ---------- */
nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 26px; }
nav a {
  font-size: 13px; color: var(--navy); text-decoration: none; background: var(--blanc);
  border: 1px solid var(--sable); border-radius: var(--r-l); padding: 7px 15px;
}
nav a:hover { border-color: var(--or); color: var(--or); }
nav a.actif { background: var(--navy); color: var(--creme); border-color: var(--navy); }

/* ---------- Texte ---------- */
h2 { font-family: var(--serif); font-size: 23px; font-weight: 600; margin: 0 0 6px; }
h3 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ardoise);
     font-weight: 600; margin: 22px 0 10px; }
.lead { color: var(--ardoise); font-size: 14px; margin: 0 0 22px; max-width: 70ch; }
p { margin: 0 0 14px; }
a { color: var(--or); }
a:hover { color: #9C6A32; }
code { background: var(--sable); padding: 1px 6px; border-radius: 3px; font-family: var(--mono); font-size: .86em; }
strong, b { font-weight: 600; }
small, .muted { color: var(--ardoise); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.libelle { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ardoise); font-weight: 600; margin-bottom: 6px; }
.client-nom { font-size: 17px; font-weight: 600; }
.retour { display: inline-block; font-size: 13px; color: var(--ardoise); text-decoration: none; margin-bottom: 14px; }
.retour:hover { color: var(--or); }

/* ---------- Cartes ---------- */
.card { background: var(--blanc); border: 1px solid var(--sable); border-radius: 8px; padding: 22px 24px; margin-bottom: var(--gap); }
.card.vide { color: var(--ardoise); text-align: center; padding: 40px 24px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--gap); }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 16px; }
.grid-form { grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); }
.callout { background: var(--sable); border-radius: var(--r); padding: 14px 18px; font-size: 13px; line-height: 1.6; margin: 0 0 16px; }

/* ---------- Étiquettes ---------- */
.tag { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .04em;
       padding: 3px 10px; border-radius: var(--r-l); background: var(--sable); color: var(--navy); text-decoration: none; white-space: nowrap; }
.tag.or { background: var(--or); color: var(--navy); }
.tag.navy { background: var(--navy); color: var(--creme); }
/* Statuts projet */
.tag.statut-a_commencer { background: var(--sable); color: var(--ardoise); }
.tag.statut-en_cours { background: #DCE4F0; color: var(--navy); }
.tag.statut-en_pause { background: #F3E6D3; color: #8A5E2C; }
.tag.archive         { background: var(--navy); color: var(--creme); }
.tags-statut { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tag.statut-termine  { background: #DCE9DE; color: var(--vert); }
.tag.statut-bloque   { background: #F0DCD8; color: var(--rouge); }
.tag.statut-annule   { background: var(--creme); color: var(--ardoise); border: 1px solid var(--sable); }
/* Statuts étape */
.tag.statut-a_faire  { background: var(--sable); color: var(--ardoise); }
.tag.statut-fait     { background: #DCE9DE; color: var(--vert); }
.tag.type-etape      { background: var(--creme); color: var(--ardoise); border: 1px solid var(--sable); font-weight: 500; letter-spacing: 0; }
.tag.type-attente_client { border-color: var(--navy-clair); color: var(--navy); }
.tag.type-assistee   { border-color: var(--or); color: var(--or); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; border-radius: 8px; }
table { width: 100%; border-collapse: collapse; background: var(--blanc); border: 1px solid var(--sable); border-radius: 8px; overflow: hidden; }
thead th {
  background: var(--navy); color: var(--creme); text-align: left; font-weight: 600;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 11px 14px;
}
tbody td { padding: 10px 14px; border-bottom: 1px solid var(--sable); font-size: 14px; vertical-align: middle; }
tbody tr:nth-child(even) { background: var(--creme); }
tbody tr:last-child td { border-bottom: none; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn.ouvrir { margin-right: 10px; }
tbody td a { color: var(--navy); text-decoration: none; }
tbody td a:hover { color: var(--or); }

/* ---------- Pastille numérotée (motif de la marque) ---------- */
.pastille {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  background: var(--or); color: var(--navy);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}
.pastille.faite { background: var(--sable); color: var(--ardoise); }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.steps .txt { padding-top: 4px; }
.steps .txt b { display: block; color: var(--navy); }
.steps .txt span { color: var(--ardoise); font-size: 13.5px; }

/* ---------- Table repères (clé -> valeur) ---------- */
table.reperes { border: none; background: transparent; width: 100%; }
table.reperes th { background: transparent; color: var(--ardoise); font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 14px; padding: 5px 14px 5px 0; white-space: nowrap; }
table.reperes td { text-align: right; font-weight: 600; padding: 5px 0; border: none; background: transparent; font-variant-numeric: tabular-nums; }
table.reperes tr:nth-child(even) { background: transparent; }
.prelignes { white-space: pre-line; }

/* ---------- Boutons ---------- */
button, .btn {
  font-family: var(--sans); font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--navy); color: var(--creme); border: 1px solid var(--navy); border-radius: 5px;
  padding: 9px 16px; white-space: nowrap; text-decoration: none; display: inline-block; line-height: 1.3; text-align: center;
}
button:hover, .btn:hover { background: #2C4570; color: var(--creme); }
button.ghost, .btn.ghost { background: transparent; color: var(--navy); border: 1px solid var(--sable); }
button.ghost:hover, .btn.ghost:hover { background: var(--blanc); border-color: var(--or); color: var(--or); }
button.danger, .btn.danger { color: var(--rouge); }
button.danger:hover { border-color: var(--rouge); color: var(--rouge); }
.btn.petit, button.petit { font-size: 12px; padding: 6px 12px; }
button:disabled { opacity: .35; cursor: default; }
button.icone { padding: 3px 7px; font-size: 14px; line-height: 1; background: transparent; color: var(--ardoise); border: 1px solid transparent; }
button.icone:hover { border-color: var(--sable); background: var(--blanc); color: var(--navy); }
button.icone:disabled:hover { border-color: transparent; background: transparent; color: var(--ardoise); }
button.icone.danger:hover { color: var(--rouge); }
.boutons { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.boutons form { margin: 0; }
.barre-outils { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.barre-outils .lead { margin: 0; }
.ligne-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ligne-form select, .ligne-form input { flex: 1 1 auto; width: auto; min-width: 0; }
.ligne-form input[name="nom"] { flex: 3 1 240px; }
form.inline { display: inline; margin: 0; }

/* ---------- Champs ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ardoise); }
input, select, textarea {
  font-family: var(--sans); font-size: 14px; color: var(--navy);
  background: var(--blanc); border: 1px solid var(--sable);
  border-radius: 5px; padding: 8px 11px; width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--or); box-shadow: 0 0 0 3px rgba(187,129,66,.15);
}
/* Select : chevron maison (ardoise), même rendu partout. */
select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235D6E8C' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
select:hover { border-color: var(--or); }
.field input[hidden] { display: none; }
textarea { min-height: 70px; resize: vertical; }
textarea.mono { font-family: var(--mono); font-size: 13px; }
/* Select compact de changement de statut dans un tableau */
select.compact { width: auto; padding: 4px 28px 4px 9px; font-size: 12.5px; font-weight: 600; }

/* ---------- Fiche ---------- */
.fiche-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.fiche-titre { font-family: var(--serif); font-size: 23px; font-weight: 600; margin: 0 0 4px; }
.etapes-liste tr.courante td { background: #FBF6EE; }
.etapes-liste tr.courante td:first-child { box-shadow: inset 4px 0 0 var(--or); }
.etapes-liste tr.faite td { color: var(--ardoise); }
.etapes-liste tr.faite .etape-nom b { font-weight: 500; }
.etape-nom .tag.or { margin-left: 6px; vertical-align: 1px; }
.etape-detail { font-size: 12.5px; line-height: 1.5; margin-top: 3px; max-width: 520px; }
.pastille.courante { background: var(--or); color: var(--creme); }
details.statut-fin { margin-top: 6px; }
details.statut-fin summary { font-size: 11px; cursor: pointer; list-style: none; }
details.statut-fin summary::-webkit-details-marker { display: none; }
details.statut-fin summary::after { content: ' ▾'; }
details.statut-fin[open] summary::after { content: ' ▴'; }
details.statut-fin form { margin-top: 4px; display: block; }
.card-courante .fiche-titre { color: var(--or); }
.progression { height: 6px; background: var(--sable); border-radius: 3px; overflow: hidden; margin: 10px 0 8px; }
.progression-barre { height: 100%; background: var(--or); }

/* ---------- Actions projet + modale de confirmation ---------- */
.actions-projet { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--sable); }
.actions-projet select.compact { padding-top: 5px; padding-bottom: 5px; }
button.danger-plein { background: var(--rouge); border-color: var(--rouge); color: var(--creme); }
button.danger-plein:hover { background: #7E2F24; color: var(--creme); }
dialog.modale { border: 1px solid var(--sable); border-radius: 8px; padding: 26px 28px; max-width: 460px; width: calc(100% - 40px); color: var(--navy); font-family: var(--sans); }
dialog.modale.large { max-width: 640px; }
dialog.modale::backdrop { background: rgba(33, 52, 85, .45); }
dialog.modale h2 { margin-bottom: 10px; }
dialog.modale form { margin: 0; }
dialog.modale .field { margin: 14px 0; }
dialog.modale .boutons { margin-top: 18px; }

/* ---------- Filtres de liste ---------- */
.filtres { display: flex; gap: 8px; margin: -8px 0 16px; }
.filtres a { font-size: 13px; color: var(--ardoise); text-decoration: none; padding: 5px 12px; border-radius: var(--r-l); border: 1px solid transparent; }
.filtres a:hover { color: var(--or); }
.filtres a.actif { background: var(--blanc); border-color: var(--sable); color: var(--navy); font-weight: 600; }
.filtres .compte { display: inline-block; min-width: 18px; text-align: center; font-size: 11px; background: var(--sable); border-radius: var(--r-l); padding: 1px 6px; margin-left: 4px; }

/* ---------- Checklist de démarrage ---------- */
.champs-checklist .field.case { flex-direction: row; align-items: center; gap: 10px; margin-bottom: 10px; }
.champs-checklist .field.case input { width: auto; margin: 0; accent-color: var(--or); }
.champs-checklist .field.case label { font-size: 14px; color: var(--navy); font-weight: 500; }
.champs-checklist .boutons { margin-top: 8px; }
button.envoyer { background: var(--or); color: var(--navy); border-color: var(--or); }
button.envoyer:hover { background: #CE9450; color: var(--navy); }

/* ---------- Messages ---------- */
.flash { border-radius: var(--r); padding: 12px 18px; font-size: 14px; margin: 0 0 18px; }
.flash-erreur { background: #F0DCD8; color: var(--rouge); }
.flash-ok { background: #DCE9DE; color: var(--vert); }
.flash ul { margin: 0; padding-left: 20px; }

/* ---------- Page d'erreur ---------- */
.page-erreur { min-height: 56vh; display: flex; align-items: center; justify-content: center; }
.page-erreur .card { max-width: 520px; width: 100%; text-align: center; padding: 40px 36px 34px; }
.erreur-code { font-family: var(--serif); font-size: 64px; font-weight: 600; line-height: 1; color: var(--or); margin: 14px 0 6px; }
.erreur-titre { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 0 0 10px; }

/* ---------- Pied ---------- */
.page-footer { margin-top: 50px; padding-top: 16px; border-top: 1px solid var(--sable); font-size: 12px; color: var(--ardoise); }

@media (max-width: 900px) {
  .grid-form { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .wrap { padding: 20px 14px 50px; }
}

/* ---------- Connexion / déconnexion (mêmes règles que le générateur de devis) ---------- */
.deconnexion { display: flex; align-items: center; gap: 12px; margin: 0; }
.login { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 400px; padding: 34px 36px; }
.login-logo { width: 64px; height: 64px; display: block; margin-bottom: 18px; }
.login-card h1 { font-family: var(--serif); font-size: 26px; font-weight: 600; margin: 4px 0 6px; }
.login-card button { width: 100%; margin-top: 6px; }
