/* Tableau de bord du client.
 *
 * Il reprend l'entete et les couleurs de la boutique : c'est la meme maison,
 * pas un outil a part. Seul le corps a ses regles, que la feuille de la
 * boutique ne couvrait pas.
 */

.compte { max-width: 1080px; margin: 0 auto; padding: 32px 24px 60px; }

.compte-tete {
  display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap;
  padding-bottom: 22px; border-bottom: 1px solid var(--border);
}
.compte-kicker {
  font-size: .68rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 6px;
}
.compte-tete h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; color: var(--navy); margin: 0; }
.compte-tete p { margin: 6px 0 0; font-size: .86rem; color: var(--slate); }
.compte-tete > div:first-child { flex: 1; min-width: 220px; }
/* Le tarif est ce qu'un client vient verifier en premier : il se lit sans
   chercher, pas au bas d'un tableau. */
.compte-tarif {
  padding: 12px 18px; border-radius: 12px;
  background: var(--green-light); border: 1px solid var(--green);
  font-size: .84rem; color: var(--navy); line-height: 1.5;
}
.compte-tarif strong { display: block; font-size: 1.25rem; font-weight: 800; }

.compte-chiffres {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px; margin: 22px 0;
}
.compte-chiffre {
  padding: 16px 18px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--white);
}
.compte-chiffre b { display: block; font-size: 1.5rem; font-weight: 800; color: var(--navy); letter-spacing: -.02em; }
.compte-chiffre span { font-size: .76rem; color: var(--slate); }

.compte-onglets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.compte-onglet {
  padding: 9px 16px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--white);
  color: var(--slate); font-family: inherit; font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: all .12s;
}
.compte-onglet:hover { border-color: var(--slate-2); color: var(--navy); }
.compte-onglet.on { background: var(--navy); border-color: var(--navy); color: var(--white); }

.compte-liste { display: grid; gap: 10px; }
.compte-ligne {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  width: 100%; text-align: left;
  padding: 16px 18px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--white);
  font-family: inherit; cursor: pointer; transition: all .12s;
}
.compte-ligne:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(22,35,57,.06); }
.compte-ligne-corps { flex: 1; min-width: 200px; }
.compte-ligne-titre { font-size: .9rem; font-weight: 700; color: var(--navy); }
.compte-ligne-sous { margin-top: 4px; font-size: .78rem; color: var(--slate); line-height: 1.45; }
.compte-ligne-montant { font-size: .95rem; font-weight: 800; color: var(--navy); white-space: nowrap; }

.compte-etat {
  padding: 4px 11px; border-radius: 999px;
  font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--bg-2); color: var(--slate);
  white-space: nowrap;
}
.compte-etat.neuf { background: var(--accent-light); color: var(--accent-2); }
.compte-etat.fini { background: var(--green-light); color: var(--green); }

.compte-vide {
  padding: 44px 24px; text-align: center;
  border: 1px dashed var(--border-2); border-radius: 12px;
  color: var(--slate); font-size: .88rem; line-height: 1.6;
}
.compte-vide a { color: var(--accent); font-weight: 600; }

/* Formulaire des informations : deux colonnes tant qu'il y a la place. */
.compte-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; max-width: 700px; }
.compte-form label { display: block; font-size: .72rem; font-weight: 600; color: var(--slate); margin-bottom: 5px; }
.compte-form input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: .88rem; background: var(--white);
}
.compte-form input:disabled { background: var(--bg); color: var(--slate-2); }
.compte-form-pied { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.compte-form-pied span { flex: 1; font-size: .78rem; color: var(--slate-2); }

/* Tiroir de detail, meme geste que dans le back office. */
.compte-panneau[hidden] { display: none; }
.compte-voile { position: fixed; inset: 0; z-index: 59; background: rgba(22,35,57,.22); }
.compte-tiroir {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
  width: min(560px, 100vw);
  background: var(--white); border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(22,35,57,.14);
  display: flex; flex-direction: column;
}
.compte-tiroir-tete {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.compte-tiroir-tete > div:first-child { flex: 1; min-width: 0; font-size: .95rem; font-weight: 700; color: var(--navy); }
.compte-tiroir-corps { flex: 1; min-height: 0; overflow-y: auto; padding: 18px; }

.compte-detail { width: 100%; border-collapse: collapse; font-size: .84rem; }
.compte-detail td { padding: 9px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.compte-detail td:last-child { text-align: right; font-weight: 600; color: var(--navy); white-space: nowrap; }
.compte-detail tr:last-child td { border-bottom: 0; }

.compte-bulle {
  max-width: 84%; padding: 9px 12px; border-radius: 12px;
  font-size: .85rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--bg); color: var(--navy); border: 1px solid var(--border);
  border-bottom-left-radius: 4px; margin-bottom: 10px;
}
.compte-bulle.moi {
  margin-left: auto; background: var(--navy); color: var(--white); border: 0;
  border-bottom-left-radius: 12px; border-bottom-right-radius: 4px;
}

/* Porte d'entree quand personne n'est connecte.
 *
 * Le [hidden] doit etre declare explicitement : une regle de classe qui pose
 * un display l'emporte sur le display:none que le navigateur attache a
 * l'attribut. Sans ca, la carte de connexion restait affichee au-dessus du
 * tableau de bord d'un client deja connecte.
 */
.compte-porte[hidden], .compte[hidden] { display: none; }
.compte-porte { display: flex; justify-content: center; padding: 60px 20px; }
.compte-carte-vide {
  width: 380px; max-width: 100%;
  padding: 30px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--white); box-shadow: var(--shadow-sm);
}
.compte-carte-vide h1 { font-size: 1.3rem; font-weight: 800; color: var(--navy); margin: 0 0 8px; }
.compte-carte-vide p { font-size: .86rem; color: var(--slate); line-height: 1.55; margin: 0 0 20px; }
.compte-carte-vide label { display: block; font-size: .72rem; font-weight: 600; color: var(--slate); margin-bottom: 5px; }
.compte-carte-vide input {
  width: 100%; padding: 10px 12px; margin-bottom: 14px;
  border: 1px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: .88rem;
}
.compte-err { color: var(--red); font-size: .8rem; margin-bottom: 12px; }
.compte-err[hidden] { display: none; }
.compte-retour { display: block; margin-top: 16px; text-align: center; font-size: .8rem; color: var(--slate); }

/* Commandes : en cours d'abord, historique ensuite, chacun sous son titre. */
.compte-sstitre {
  font-size: .72rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--slate-2);
  margin: 4px 0 10px;
}
.compte-liste + .compte-sstitre { margin-top: 26px; }
.compte-ligne-date { font-weight: 500; color: var(--slate); }
.compte-ligne-sous code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .74rem; color: var(--slate);
}

/* Rappel de remplacement. Trois tons : lointain, proche, depasse. */
.compte-rappel {
  display: inline-block; margin-top: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 600;
  background: var(--bg-2); color: var(--slate);
}
.compte-rappel.bientot { background: var(--accent-light); color: var(--accent-2); }
.compte-rappel.du { background: var(--red-light); color: var(--red); }
.compte-rappel.muet { background: transparent; color: var(--slate-2); font-weight: 500; padding-left: 0; }

.compte-racheter {
  flex-shrink: 0;
  padding: 8px 16px; border-radius: 8px;
  border: 1px solid var(--border-2); background: var(--white);
  color: var(--navy); font-family: inherit; font-size: .8rem; font-weight: 700;
  cursor: pointer; transition: all .12s;
}
.compte-racheter:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
