/* ===================================================================
   espace.abdelaziznour.com — espace privé
   Mêmes tokens que le site public, chrome plus sobre (application interne)
   =================================================================== */

:root {
  --bleu-nuit: #0d2438;
  --bleu-plan: #1a3a5c;
  --trait-clair: #e8f0f7;
  --papier: #f7f5f0;
  --encre: #12181f;
  --rouge-calque: #d4572a;
  --vert-ok: #4c8c6b;

  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --marge: clamp(1rem, 3vw, 2.5rem);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--papier);
  color: var(--encre);
  line-height: 1.5;
}

a { color: var(--bleu-plan); }
button, input, textarea, select { font-family: inherit; font-size: inherit; }

/* --- En-tête applicatif --- */
.entete-app {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem var(--marge);
  background: var(--bleu-nuit);
  color: var(--papier);
}
.entete-app .sigle { font-family: var(--mono); font-size: 0.9rem; text-decoration: none; color: var(--papier); }
.entete-app .qui { font-size: 0.85rem; display: flex; align-items: center; gap: 1rem; }
.entete-app button.lien {
  background: none; border: none; color: rgba(247,245,240,0.75);
  cursor: pointer; font-size: 0.85rem; text-decoration: underline;
}

main.app { max-width: 980px; margin: 0 auto; padding: var(--marge); }

/* --- Connexion --- */
.ecran-connexion {
  max-width: 380px;
  margin: 10vh auto;
  padding: var(--marge);
}
.ecran-connexion h1 { font-size: 1.4rem; margin-bottom: 0.25rem; }
.ecran-connexion .sous-titre { color: #5a5a5a; font-size: 0.92rem; margin-bottom: 1.75rem; }

.champ { margin-bottom: 1.1rem; }
.champ label { display: block; font-size: 0.85rem; margin-bottom: 0.35rem; color: #444; }
.champ input, .champ textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #c9c2b4;
  background: #fff;
  border-radius: 2px;
}
.champ input:focus, .champ textarea:focus { outline: 2px solid var(--bleu-plan); outline-offset: 1px; }

.bouton-primaire {
  display: inline-block;
  background: var(--bleu-nuit);
  color: var(--papier);
  border: none;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
  font-size: 0.95rem;
}
.bouton-primaire:hover { background: var(--bleu-plan); }
.bouton-primaire:disabled { opacity: 0.6; cursor: default; }

.message-erreur {
  background: #fbeae4;
  color: #8a3418;
  padding: 0.6rem 0.85rem;
  font-size: 0.88rem;
  margin-bottom: 1rem;
  border-left: 3px solid var(--rouge-calque);
}

/* --- Tableau de bord (liste de projets) --- */
.entete-page { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem; }

.liste-projets { display: flex; flex-direction: column; border-top: 1px solid #d9d2c3; }
.projet-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0.25rem;
  border-bottom: 1px solid #d9d2c3;
  text-decoration: none;
  color: inherit;
}
.projet-item:hover { background: #efe9dc; }
.projet-item h3 { margin: 0; font-size: 1.05rem; }
.badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  border: 1px solid #b8ae99;
  color: #5a5142;
  white-space: nowrap;
}
.badge.phase { border-color: var(--bleu-plan); color: var(--bleu-plan); }

/* --- Fiche projet : onglets --- */
.onglets { display: flex; gap: 0; border-bottom: 2px solid var(--bleu-nuit); margin-bottom: 1.5rem; }
.onglet {
  background: none; border: none; cursor: pointer;
  padding: 0.6rem 1.1rem; font-size: 0.92rem; color: #5a5142;
}
.onglet.actif { color: var(--bleu-nuit); font-weight: 600; border-bottom: 2px solid var(--rouge-calque); margin-bottom: -2px; }
.panneau { display: none; }
.panneau.actif { display: block; }

/* --- Messagerie --- */
.fil-messages { display: flex; flex-direction: column; gap: 0.9rem; margin-bottom: 1.25rem; max-height: 50vh; overflow-y: auto; }
.message-bulle { max-width: 70%; padding: 0.6rem 0.85rem; border-radius: 2px; }
.message-bulle .auteur { font-size: 0.72rem; color: #7a7263; margin-bottom: 0.2rem; }
.message-bulle.moi { align-self: flex-end; background: var(--bleu-plan); color: #fff; }
.message-bulle.moi .auteur { color: rgba(255,255,255,0.75); }
.message-bulle.autre { align-self: flex-start; background: #efe9dc; }
.form-message { display: flex; gap: 0.6rem; }
.form-message textarea { flex: 1; resize: none; height: 2.6rem; }

/* --- Documents --- */
.liste-documents { border-top: 1px solid #d9d2c3; margin-bottom: 1.25rem; }
.document-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 0.25rem; border-bottom: 1px solid #d9d2c3; font-size: 0.92rem;
}
.document-item .nom { font-weight: 500; }
.document-item .type { font-size: 0.75rem; color: #7a7263; margin-left: 0.5rem; }

/* --- Planning --- */
.tableau-planning { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tableau-planning th, .tableau-planning td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid #d9d2c3; }
.tableau-planning th { font-family: var(--mono); font-size: 0.72rem; color: #7a7263; font-weight: 400; }
.statut-tache { font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 2px; }
.statut-tache.a_faire { background: #efe9dc; }
.statut-tache.en_cours { background: #fde8d6; color: #8a4f18; }
.statut-tache.termine { background: #e2f0e8; color: var(--vert-ok); }

.etat-vide { color: #7a7263; font-size: 0.9rem; padding: 1rem 0; }

@media (max-width: 640px) {
  .projet-item { grid-template-columns: 1fr; }
}
