/* Appli v1.1 – pensée pour le téléphone (une main, gros boutons, lisible dehors) */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; color: #1d1d1f; background: #f4f5f7; -webkit-tap-highlight-color: transparent; }
.cache { display: none !important; }

.ecran { position: fixed; inset: 0; display: flex; flex-direction: column; }
.barre { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #14213d; color: #fff;
  min-height: 56px; }
.barre h1 { flex: 1; margin: 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.moi { font-size: 13px; opacity: .85; }
.retour, .icone { background: none; border: 0; color: #fff; font-size: 24px; width: 44px; height: 44px; }
.contenu { flex: 1; overflow-y: auto; padding: 12px; }
.pied { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff;
  box-shadow: 0 -2px 8px rgba(0,0,0,.08); }

button { font: inherit; cursor: pointer; }
.gros { display: block; width: 100%; min-height: 56px; margin: 8px 0; border-radius: 12px; border: 1px solid #c8ccd4;
  background: #fff; font-size: 18px; font-weight: 600; }
.moyen { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid #c8ccd4; background: #fff;
  font-weight: 600; }
.principal { background: #fca311; border-color: #fca311; color: #14213d; }
.danger { background: #c62828; border-color: #c62828; color: #fff; }
.champ { display: block; margin-bottom: 12px; font-weight: 600; }
.champ select, .champ input, #recherche-rue { display: block; width: 100%; min-height: 48px; margin-top: 6px;
  padding: 0 12px; font-size: 17px; border: 1px solid #c8ccd4; border-radius: 10px; background: #fff; }

/* Tournées */
.tournee { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tournee .titre { font-weight: 700; font-size: 17px; }
.tournee .sous { color: #555; font-size: 14px; margin: 4px 0 8px; }
.jauge { height: 10px; background: #e3e6ea; border-radius: 5px; overflow: hidden; }
.jauge div { height: 100%; background: #2e7d32; }
.vide { color: #666; text-align: center; margin-top: 40px; }
.commune-res { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff;
  border-radius: 10px; padding: 12px; margin-bottom: 8px; }
.commune-res small { color: #666; }
.titre-zone { font-weight: 700; font-size: 18px; }

.deux-boutons { display: flex; gap: 10px; }
.deux-boutons .gros { flex: 1; }
.bouton-lien { display: flex; align-items: center; justify-content: center; text-decoration: none; }

/* Mes rues */
.ma-rue { background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.ma-rue .titre { font-weight: 700; font-size: 16px; }
.ma-rue .sous { color: #555; font-size: 14px; margin: 4px 0 8px; }
.actions-ligne { display: flex; gap: 8px; flex-wrap: wrap; }
.actions-ligne .moyen { flex: 1; }

/* Carte */
.carte { flex: 1; min-height: 0; }
.zone-carte { position: relative; flex: 1; min-height: 0; display: flex; }
.flottant { position: absolute; right: 10px; bottom: 44px; width: 52px; height: 52px; border-radius: 50%;
  border: 0; background: #fff; color: #1565c0; font-size: 28px; box-shadow: 0 2px 8px rgba(0,0,0,.3); z-index: 4; }
.legende div { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 14px; }
.legende svg { flex: 0 0 56px; }
.choix { text-align: left; padding: 0 14px; font-size: 16px; }
.reseau { position: fixed; top: calc(6px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 40;
  padding: 4px 12px; border-radius: 14px; font-size: 13px; font-weight: 700; background: #ff6d00; color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.25); white-space: nowrap; pointer-events: none; }
.reseau.hors-ligne { background: #b71c1c; }
#ecran-nouvelle .carte { position: absolute; top: 56px; left: 0; right: 0; bottom: 0; }
.bandeau { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); background: #14213d; color: #fff;
  padding: 8px 14px; border-radius: 20px; font-size: 14px; z-index: 5; white-space: nowrap; }
.pastilles { padding-top: 8px; }
#pastilles { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.pastille { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: 6px;
  border: 3px solid transparent; border-radius: 14px; background: #f4f5f7; }
.pastille .rond { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; text-shadow: 0 0 3px rgba(0,0,0,.6); }
.pastille .nom { font-size: 12px; margin-top: 2px; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pastille .compte { font-size: 12px; font-weight: 700; }
.pastille.choisie { border-color: #14213d; background: #fff; }
.pastille.autre { opacity: .85; }
.actions-pied { display: flex; gap: 8px; justify-content: space-between; }

/* Liste des rues */
#table-rues { width: 100%; border-collapse: collapse; margin-top: 10px; background: #fff; font-size: 14px; }
#table-rues th { position: sticky; top: 0; background: #e9ecf1; text-align: left; padding: 10px 6px; cursor: pointer; }
#table-rues td { padding: 10px 6px; border-top: 1px solid #eee; }
#table-rues small { color: #777; }
.statut { display: inline-block; padding: 2px 6px; border-radius: 6px; font-size: 12px; color: #fff; }
.s-vierge { background: #7f8c9a; } .s-affectee { background: #1565c0; } .s-en_cours { background: #ef6c00; }
.s-faite { background: #1b5e20; } .s-bloquee { background: #757575; } .s-attente { background: #ff6d00; }

/* Fiche (point de porte, rue) */
.fiche { position: fixed; left: 0; right: 0; bottom: 0; max-height: 82%; overflow-y: auto; background: #fff;
  border-radius: 18px 18px 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,.25); padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  z-index: 20; }
.fermer { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; background: none; font-size: 22px; }
.adresse-saisir { font-size: 24px; font-weight: 800; line-height: 1.25; margin: 6px 0 10px; }
.etiquette { color: #666; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.categorie { display: inline-block; padding: 4px 10px; border-radius: 8px; color: #fff; font-weight: 700; margin: 6px 0; }
.alertes { color: #b71c1c; font-size: 14px; }
.batiments { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.batiments td, .batiments th { border-top: 1px solid #eee; padding: 6px 4px; text-align: left; vertical-align: top; }
.fiche h2 { margin: 0 40px 6px 0; font-size: 20px; }
.ligne { margin: 4px 0; }

.message { position: fixed; left: 12px; right: 12px; top: 64px; padding: 14px 16px; border-radius: 12px; z-index: 30;
  font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.message.info { background: #14213d; color: #fff; }
.message.alerte { background: #fff3cd; color: #6b4e00; border: 1px solid #f0c36d; }
.message.erreur { background: #c62828; color: #fff; }
