/* Espaces personnels et connexion : pensés d'abord pour le téléphone */
:root { --barre-bas: 64px; }
body.app { --clair: #FBF8F1; color: #2F3A33; background: var(--clair); padding-bottom: calc(var(--barre-bas) + env(safe-area-inset-bottom)); }
@media (min-width: 768px) { body.app { padding-bottom: 0; } }

.app-entete { background: linear-gradient(135deg, var(--vert-fonce), var(--vert)); color: #fff; }
.app-entete .etab { font-size: .85rem; opacity: .8; }
.app-entete h1 { font-size: 1.35rem; font-weight: 700; margin: 0; }
.app-entete .avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: flex; align-items: center; justify-content: center; font-weight: 600; color: #fff; text-decoration: none; }

/* Navigation : barre en bas sur téléphone, onglets dans l'en-tête sur ordinateur */
.app-nav { display: flex; }
.app-nav a, .app-nav span { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .45rem .25rem; font-size: .72rem; color: #6b7a72; text-decoration: none; }
.app-nav i { font-size: 1.3rem; line-height: 1; }
.app-nav a.actif { color: var(--vert); font-weight: 600; }
.app-nav span.bientot { opacity: .45; }
.app-nav span.bientot small { font-size: .6rem; }
.app-nav-bas { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030; background: #FFFDF8; border-top: 1px solid #E6DFCF; padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 768px) {
    .app-nav-bas { position: static; border: 0; background: transparent; gap: .25rem; flex-wrap: wrap; }
    .app-nav-bas a, .app-nav-bas span { flex: 0 0 auto; white-space: nowrap; padding: .45rem .9rem; flex-direction: row; justify-content: center; gap: .4rem; font-size: .9rem; color: rgba(255, 255, 255, .75); border-radius: .5rem; }
    .app-nav-bas a.actif { color: #fff; background: rgba(255, 255, 255, .15); }
    .app-nav-bas i { font-size: 1rem; }
}

.bloc { background: #FFFDF8; border: 1px solid #EEE7D7; border-radius: 1rem; box-shadow: 0 1px 6px rgba(0, 0, 0, .05); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.bloc h2 { font-size: 1rem; font-weight: 700; margin-bottom: .75rem; }
.bloc-lien { display: block; color: inherit; text-decoration: none; transition: transform .15s; }
.bloc-lien:active { transform: scale(.98); }
.bloc-lien .chevron { color: #9aa79f; }
.pastille { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(0, 135, 81, .1); color: var(--vert); font-size: 1.25rem; flex-shrink: 0; }
.ligne { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-top: 1px solid #f0f2f0; }
.ligne:first-of-type { border-top: 0; }
.ligne .meta { font-size: .82rem; color: #6b7a72; }
.badge-vert { background: rgba(0, 135, 81, .12); color: var(--vert-fonce); font-weight: 600; }
.bientot-carte { border: 1px dashed #cfd8d2; background: transparent; box-shadow: none; color: #6b7a72; }

/* Connexion */
/* Fond crème, comme le back-office */
.connexion { --clair: #FBF8F1; color: #2F3A33; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem;
    background: radial-gradient(circle at 85% 10%, rgba(252, 209, 22, .25), transparent 40%), radial-gradient(circle at 10% 95%, rgba(232, 17, 45, .15), transparent 35%), var(--clair); }
.connexion .carte-connexion { width: 100%; max-width: 420px; background: #FFFDF8; border-radius: 1.25rem; box-shadow: 0 8px 30px rgba(0, 0, 0, .08); overflow: hidden; }
.connexion .form-control { padding: .75rem .9rem; font-size: 1rem; }
.connexion .btn-lg { padding: .75rem; }
.nav-bureau { display: none; }
@media (min-width: 768px) { .nav-bureau { display: block; } .nav-mobile { display: none; } }

/* Compte à plusieurs profils : passer d'un espace à l'autre */
.choix-espace { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.choix-espace a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: .85rem; font-weight: 500;
    text-decoration: none; color: rgba(255, 255, 255, .92); background: rgba(255, 255, 255, .14); }
.choix-espace a:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.choix-espace a.actif { background: #FCD116; color: #3a3000; font-weight: 600; }

/* Cloche des notifications (partie 2.4) */
.app-entete .cloche { position: relative; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.2rem; text-decoration: none; background: rgba(255, 255, 255, .12); flex-shrink: 0; }
.app-entete .cloche:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.app-entete .pastille-notif { position: absolute; top: -2px; right: -2px; min-width: 19px; height: 19px; border-radius: 999px; background: #FCD116; color: #3a3000; font-size: .7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.app-nav .compteur { display: inline-block; min-width: 18px; border-radius: 999px; background: #FCD116; color: #3a3000; font-size: .66rem; font-weight: 700; padding: 0 5px; line-height: 16px; }

/* Onglet visible seulement sur tablette et ordinateur (barre du haut) */
@media (max-width: 767.98px) { .app-nav-bas a.bureau-seulement { display: none; } }

/* ---------- Mon compte : profil avec couverture (couleur du profil : --vert-fonce → --vert) ---------- */
.compte-profil { background: #FFFDF8; border: 1px solid #EEE7D7; border-radius: 1.1rem; overflow: hidden; margin-bottom: 1rem; box-shadow: 0 1px 6px rgba(0, 0, 0, .05); }
.compte-profil .couverture { height: 120px; background: linear-gradient(120deg, var(--vert-fonce), var(--vert)); }
.compte-profil .identite { display: flex; align-items: flex-start; gap: 1.2rem; padding: 0 1.5rem 1.2rem; margin-top: -72px; }
.photo-profil { width: 144px; height: 144px; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .12); background: var(--vert-clair); flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.photo-profil img { width: 100%; height: 100%; object-fit: cover; }
.initiales-profil { font-size: 3rem; font-weight: 700; color: var(--vert-fonce); letter-spacing: .02em; }
.nom-profil { padding-top: 84px; min-width: 0; }
.nom-profil h2 { font-size: 1.6rem; font-weight: 700; margin: 0; line-height: 1.15; }
.nom-profil .role { color: #6E7468; }
.etiquettes { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.etiquettes span { background: #fff; border: 1px solid #E6DFCF; border-radius: 999px; padding: .2rem .7rem; font-size: .82rem; font-weight: 600; }
.etiquettes span i { color: var(--vert); margin-right: .3rem; }
.compte-grille { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .compte-grille { grid-template-columns: 1.2fr 1fr; } }
.compte-infos .info { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-top: 1px solid #F0EADC; }
.compte-infos .info:first-of-type { border-top: 0; }
.compte-infos .ic, .compte-famille .ini-membre { width: 38px; height: 38px; border-radius: 11px; background: var(--vert-clair); color: var(--vert-fonce); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.compte-famille .ini-membre { border-radius: 50%; font-weight: 700; font-size: .8rem; }
.compte-infos .val { flex: 1; min-width: 0; }
.compte-infos .val span, .compte-famille .membre div span { display: block; font-size: .8rem; color: #6E7468; }
.compte-infos .val strong { overflow-wrap: anywhere; }
.compte-infos .copier { border: 1px solid #D9D1BF; background: #fff; border-radius: 9px; padding: .25rem .65rem; font-size: .82rem; font-weight: 600; color: var(--vert-fonce); white-space: nowrap; }
.compte-infos .copier.copie { background: var(--vert-clair); border-color: var(--vert); }
.compte-famille .membre { display: flex; align-items: center; gap: .8rem; padding: .6rem 0; border-top: 1px solid #F0EADC; }
.compte-famille .membre:first-of-type { border-top: 0; }
.compte-actions a { display: flex; align-items: center; gap: .8rem; padding: .75rem 0; border-top: 1px solid #F0EADC; color: inherit; text-decoration: none; font-weight: 600; }
.compte-actions a:first-of-type { border-top: 0; }
.compte-actions a > i:first-child { font-size: 1.15rem; color: var(--vert); width: 1.5rem; }
.compte-actions a span { flex: 1; }
.compte-actions a:hover span { color: var(--vert); }
.compte-actions a.deconnexion, .compte-actions a.deconnexion i { color: #C0392B !important; }
@media (max-width: 575.98px) {
    .compte-profil .couverture { height: 96px; }
    .compte-profil .identite { flex-direction: column; align-items: center; text-align: center; margin-top: -60px; padding: 0 1rem 1.1rem; gap: .6rem; }
    .photo-profil { width: 120px; height: 120px; }
    .initiales-profil { font-size: 2.5rem; }
    .nom-profil { padding-top: 0; }
    .nom-profil h2 { font-size: 1.4rem; }
    .etiquettes { justify-content: center; }
}
