/* Application mobile — mêmes couleurs que le site (drapeau ivoirien), mise en page pensée pour le pouce */
:root {
    --orange: #f77f00;
    --vert: #009e60;
    --primaire: #00724a;
    --primaire-fonce: #00563a;
    --primaire-clair: #e6f4ee;
    --orange-clair: #ffe9d1;
    --orange-texte: #7a3d00;
    --encre: #1b1b1b;
    --gris: #565c65;
    --bord: #d5d9e0;
    --fond: #f6f7f9;
    --alerte: #b42318;
    --rayon: 0.5rem;
    --bas: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--fond); color: var(--encre); line-height: 1.5;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 1rem;
    padding-bottom: calc(4.5rem + var(--bas));
    -webkit-tap-highlight-color: transparent;
}
h1, h2 { margin: 0; line-height: 1.25; }
h2 { font-size: 1.1rem; }
p { margin: 0.4rem 0; }
a { color: var(--primaire); }
:focus-visible { outline: 3px solid #0a76f6; outline-offset: 2px; }

.drapeau { height: calc(5px + env(safe-area-inset-top, 0px)); background: linear-gradient(90deg, var(--orange) 33.33%, #fff 33.33% 66.66%, var(--vert) 66.66%); }
.entete {
    position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    background: var(--primaire); color: #fff; padding: 0.75rem 1rem;
}
.entete h1 { font-size: 1.1rem; }
.pastille { border: 0; border-radius: 99px; padding: 0.25rem 0.7rem; font-size: 0.8rem; font-weight: 600; background: #fff; color: var(--primaire-fonce); }
.pastille.hors-ligne { background: var(--orange); color: var(--encre); }

main { max-width: 40rem; margin: 0 auto; padding: 0.75rem; }
main:focus { outline: none; }
.bloc { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1rem; margin: 0 0 0.75rem; min-width: 0; }
fieldset.bloc legend { font-weight: 700; font-size: 1.05rem; padding: 0 0.3rem; }
.bloc-titre { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-bottom: 0.4rem; }
.lien-bloc .btn { margin-top: 0; flex: none; }
.lien-bloc { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--encre); border-left: 5px solid var(--orange); }
.centre { text-align: center; }
.discret { color: var(--gris); }
.note { color: var(--gris); font-size: 0.85rem; }
.erreur { color: var(--alerte); font-weight: 600; }
small { display: block; color: var(--gris); font-size: 0.82rem; font-weight: 400; }

.hero { background: var(--primaire); color: #fff; border-radius: var(--rayon); padding: 1.25rem 1rem; margin-bottom: 0.75rem; }
.hero h2 { font-size: 1.35rem; }
.hero p { color: #e3f3ec; margin-bottom: 0.9rem; }
.alerte { display: block; background: var(--orange-clair); color: var(--orange-texte); border-left: 5px solid var(--orange); border-radius: var(--rayon); padding: 0.75rem 1rem; margin-bottom: 0.75rem; font-weight: 500; text-decoration: none; }
.alerte-info { background: var(--primaire-clair); color: var(--primaire-fonce); border-left-color: var(--vert); }
.alerte a { color: inherit; font-weight: 700; }

/* Boutons et champs : zones tactiles d'au moins 44 px */
.btn {
    display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0.55rem 1.1rem; margin-top: 0.6rem;
    border: 2px solid var(--primaire); border-radius: var(--rayon); background: var(--primaire); color: #fff;
    font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:active { background: var(--primaire-fonce); border-color: var(--primaire-fonce); }
.btn[disabled] { opacity: 0.55; }
.btn-contour { background: #fff; color: var(--primaire); }
.btn-contour:active { background: var(--primaire-clair); }
.btn-action { background: var(--orange); border-color: var(--orange); color: var(--encre); }
.btn-action:active { background: #dd7000; border-color: #dd7000; }
.btn-large { display: flex; width: 100%; font-size: 1.05rem; min-height: 3.1rem; }
.btn-petit { min-height: 2.2rem; padding: 0.25rem 0.7rem; font-size: 0.85rem; margin-top: 0.2rem; }
label { display: block; font-weight: 600; margin: 0.8rem 0 0.25rem; }
input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="file"], textarea {
    width: 100%; min-height: 2.75rem; padding: 0.55rem 0.7rem; border: 1px solid #8d95a3; border-radius: var(--rayon);
    font: inherit; background: #fff; color: var(--encre);
}
.groupe { display: flex; gap: 0.4rem; }
.groupe input { flex: 1; min-width: 0; }
.groupe .btn { margin-top: 0; }
.choix { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.choix label { margin: 0; position: relative; font-weight: 600; }
.choix input { position: absolute; opacity: 0; inset: 0; }
.choix span { display: block; height: 100%; padding: 0.7rem; border: 2px solid var(--bord); border-radius: var(--rayon); background: #fff; }
.choix input:checked + span { border-color: var(--primaire); background: var(--primaire-clair); }
.choix input:focus-visible + span { outline: 3px solid #0a76f6; outline-offset: 2px; }
.apercu { display: block; max-width: 100%; max-height: 14rem; margin-top: 0.6rem; border-radius: var(--rayon); }
details.bloc summary { font-weight: 700; cursor: pointer; min-height: 1.75rem; }

/* Listes */
.ligne { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; padding: 0.7rem 0; border-top: 1px solid var(--bord); text-decoration: none; color: var(--encre); }
.ligne:first-of-type { border-top: 0; }
.ligne > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.tag { display: inline-block; flex: none; padding: 0.15rem 0.55rem; border-radius: 0.25rem; font-size: 0.78rem; font-weight: 700; white-space: nowrap; background: #eceef1; color: #3d444d; }
.tag-VALIDE, .tag-ASSIGNEE { background: #fff; color: var(--orange-texte); box-shadow: inset 0 0 0 1px var(--orange); }
.tag-EN_COURS, .tag-EN_ROUTE, .tag-SUR_PLACE, .tag-attente { background: var(--orange-clair); color: var(--orange-texte); }
.tag-RESOLU, .tag-TERMINEE { background: #d9f2e6; color: var(--primaire-fonce); }
dl.fiche { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 0.9rem; margin: 0.7rem 0 0; }
dl.fiche dt { color: var(--gris); }
dl.fiche dd { margin: 0; overflow-wrap: anywhere; }
.journal { list-style: none; margin: 0.8rem 0 0; padding: 0; }
.journal li { padding: 0.55rem 0 0.55rem 0.8rem; border-left: 3px solid var(--orange); margin-bottom: 0.5rem; }

/* Étapes du traitement */
.etapes { list-style: none; display: flex; padding: 0; margin: 1rem 0 0.4rem; counter-reset: etape; }
.etapes li { flex: 1; position: relative; text-align: center; font-size: 0.72rem; color: var(--gris); padding-top: 2.1rem; counter-increment: etape; }
.etapes li::before { content: counter(etape); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--bord); font-weight: 700; z-index: 1; }
.etapes li::after { content: ""; position: absolute; top: 0.85rem; left: -50%; width: 100%; height: 2px; background: var(--bord); }
.etapes li:first-child::after { display: none; }
.etapes li.fait { color: var(--encre); }
.etapes li.fait::before { content: "✓"; background: var(--primaire); border-color: var(--primaire); color: #fff; }
.etapes li.fait::after, .etapes li.courant::after { background: var(--primaire); }
.etapes li.courant { color: var(--primaire); font-weight: 700; }
.etapes li.courant::before { background: var(--orange); border-color: var(--orange); color: var(--encre); }

/* Cartes */
.carte { height: 15rem; border: 1px solid var(--bord); border-radius: var(--rayon); margin: 0.5rem 0 0.75rem; background: #e9ecef; z-index: 0; }
.carte-petite { height: 12rem; }
.carte-grande { height: 55vh; }
.legende { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.82rem; margin-bottom: 0.75rem; }
.legende span::before { content: ""; display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 50%; margin-right: 0.3rem; background: var(--c); }

/* Barre d'onglets */
.onglets { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; display: flex; background: #fff; border-top: 1px solid var(--bord); padding-bottom: var(--bas); }
.onglets a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.1rem; padding: 0.45rem 0.2rem; min-height: 3.5rem; font-size: 0.72rem; font-weight: 600; color: var(--gris); text-decoration: none; border-top: 3px solid transparent; }
.onglets a.actif { color: var(--primaire); border-top-color: var(--orange); }
.toast { position: fixed; left: 0.75rem; right: 0.75rem; bottom: calc(4.6rem + var(--bas)); z-index: 1100; max-width: 38rem; margin: 0 auto; background: var(--encre); color: #fff; padding: 0.75rem 1rem; border-radius: var(--rayon); font-weight: 500; }

/* Cloche des notifications (en-tête) */
.entete-outils { display: flex; align-items: center; gap: 0.6rem; }
.cloche { position: relative; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; color: #fff; }
.cloche-nombre {
    position: absolute; top: 0.15rem; right: 0.05rem; min-width: 1.2rem; padding: 0 0.25rem; border-radius: 99px;
    background: var(--orange); color: var(--encre); font-size: 0.7rem; font-weight: 700; line-height: 1.2rem; text-align: center;
}
.ligne-nouvelle { background: var(--orange-clair); margin: 0 -0.5rem; padding-left: 0.5rem; padding-right: 0.5rem; border-radius: 0.25rem; }

/* Un élément masqué le reste, même s'il porte une classe qui fixe son affichage */
[hidden] { display: none !important; }
