/* Compta Chauffeur — mobile d'abord, gros boutons, gros chiffres. */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #f4f6f4;
  color: #1c2b1e;
  font-size: 17px;
  line-height: 1.45;
}
a { color: #1b5e20; }
.conteneur { max-width: 860px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.6rem; margin: 0.4em 0 0.6em; }
h2 { font-size: 1.2rem; margin-top: 1.2em; }

.entete-public, .entete-app {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: #1b5e20; color: #fff;
}
/* Logotype texte « comptachauffeur » : pastille blanche arrondie pour que
   les gris restent lisibles sur la bande verte des en-têtes (publics et
   connectés, même bande). « compta » en gris moyen, « chauffeur » en gris
   moyen foncé — aucune teinte plus foncée, aucun noir. */
.entete-public .logo, .entete-app .logo {
  background: #fff; border-radius: 999px; padding: 5px 16px 7px;
  text-decoration: none; display: inline-block; line-height: 1.15;
}
.logotype { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; white-space: nowrap; }
.logotype-compta { color: #7a7a7a; }
.logotype-chauffeur { color: #4d4d4d; }
.entete-public nav a { color: #fff; margin-left: 12px; }
/* Le nom de l'utilisateur s'affiche au complet, sur une seule ligne,
   aligné complètement à droite — jamais coupé ni renvoyé à la ligne. */
.entete-app .utilisateur { font-size: 0.9rem; opacity: 0.9; white-space: nowrap; text-align: right; flex-shrink: 0; }
@media (max-width: 639px) {
  .entete-app { padding: 10px 12px; }
  .entete-app .logo { padding: 4px 12px 6px; }
  .entete-app .logotype { font-size: 1rem; }
  .entete-app .utilisateur { font-size: 0.85rem; }
}

.nav-app {
  background: #e8f0e8; position: sticky; top: 0; z-index: 5;
}
/* Barre principale fixée au bas de l'écran (Accueil, Revenus, Mon quart, Profil),
   toujours visible pendant le défilement. Le bas de page reçoit un espace égal
   à la hauteur de la barre (+ zone sûre du téléphone) pour ne rien couvrir. */
.nav-bas {
  background: #e8f0e8; position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  border-top: 1px solid #c8d8c8; box-shadow: 0 -2px 8px rgba(27, 94, 32, 0.08);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
.nav-grille {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; gap: 6px;
  max-width: 860px; margin: 0 auto; padding: 8px;
}
.nav-app a, .nav-bas a {
  display: flex; align-items: center; justify-content: center;
  padding: 10px 2px; border-radius: 12px; text-decoration: none;
  color: #1b5e20; font-weight: 600; background: #fff; border: 1px solid #c8d8c8;
  transition: background 0.15s ease, transform 0.1s ease;
}
.nav-app a:hover, .nav-bas a:hover { background: #eef6ee; }
.nav-app a:active, .nav-bas a:active { transform: scale(0.97); }
.nav-app a.actif, .nav-bas a.actif { background: #2e7d32; color: #fff; border-color: #2e7d32; }
.nav-app a.actif:hover, .nav-bas a.actif:hover { background: #2e7d32; }
.tuile-libelle { font-size: 0.85rem; line-height: 1.15; text-align: center; }
@media (min-width: 640px) {
  .nav-grille { gap: 8px; padding: 10px 8px; }
  .nav-app a, .nav-bas a { padding: 12px 4px; }
  .tuile-libelle { font-size: 0.95rem; }
  body { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
}

.bouton {
  display: inline-block; background: #2e7d32; color: #fff; border: none;
  padding: 12px 20px; border-radius: 12px; font-size: 1rem; font-weight: 700;
  cursor: pointer; text-decoration: none; text-align: center;
}
.bouton-grand { display: block; width: 100%; padding: 16px; font-size: 1.15rem; margin-top: 10px; }
.bouton-petit { padding: 8px 12px; font-size: 0.9rem; }
.bouton-danger { background: #c62828; }
.bouton-discret { background: #eceff1; color: #37474f; }
.entete-public .bouton { background: #fff; color: #1b5e20; }

.hero { text-align: center; padding: 24px 0; }
.hero h1 { font-size: 2rem; }
.gros { font-size: 1.15rem; }
.cartes-3 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cartes-3 { grid-template-columns: 1fr 1fr; } }
.carte-info, .bloc { background: #fff; border: 1px solid #dde5dd; border-radius: 14px; padding: 16px; margin: 14px 0; }

.cartes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.carte { background: #fff; border: 1px solid #dde5dd; border-radius: 14px; padding: 14px; text-align: center; }
.carte-libelle { display: block; font-size: 0.95rem; color: #546e58; }
.carte-valeur { display: block; font-size: 1.7rem; font-weight: 800; margin-top: 4px; }
.carte-valeur.positif { color: #2e7d32; }
.carte-valeur.negatif { color: #c62828; }

.bandeau-quart { background: #fff8e1; border: 2px solid #f9a825; border-radius: 14px; padding: 16px; margin: 14px 0; }
.bandeau-quart.en-cours { background: #e8f5e9; border-color: #2e7d32; }
.bloc-quart { border: 2px solid #2e7d32; }

.formulaire label { display: block; margin: 12px 0; font-weight: 600; }
.formulaire input[type="text"], .formulaire input[type="email"], .formulaire input[type="password"],
.formulaire input[type="number"], .formulaire input[type="date"], .formulaire select {
  display: block; width: 100%; margin-top: 6px; padding: 13px; font-size: 1.05rem;
  border: 1.5px solid #aebfae; border-radius: 10px; background: #fff; font-weight: 400;
}
.formulaire input[type="file"] { display: block; margin-top: 6px; font-size: 1rem; }
.formulaire .case { font-weight: 400; }
.formulaire-ligne { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.formulaire-ligne label { margin: 0; flex: 1; min-width: 150px; }
fieldset { border: 1.5px solid #c8d8c8; border-radius: 12px; margin: 12px 0; padding: 12px; }
fieldset legend { font-weight: 700; padding: 0 6px; }
.point-inspection .choix-ok, .point-inspection .choix-probleme {
  display: inline-block; padding: 10px 14px; margin: 4px 6px 4px 0; border-radius: 10px; font-weight: 700;
}
.choix-ok { background: #e8f5e9; }
.choix-probleme { background: #fdecea; }

.nav-mois { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 10px 0; flex-wrap: wrap; }

.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { border-bottom: 1px solid #e0e7e0; padding: 9px 8px; text-align: left; font-size: 0.97rem; }
th { background: #eef3ee; }
tr.ligne-probleme { background: #fdecea; }

.erreur { background: #fdecea; border: 1.5px solid #c62828; color: #7f1010; padding: 12px; border-radius: 10px; }
.succes { background: #e8f5e9; border: 1.5px solid #2e7d32; color: #1b5e20; padding: 12px; border-radius: 10px; }
.alerte-discret { background: #fff8e1; border: 1px solid #f9a825; padding: 10px 12px; border-radius: 10px; }
.discret { color: #5f7261; font-size: 0.93rem; }
.valeur-lue { margin: 12px 0; font-weight: 600; }

.badge-ok { background: #e8f5e9; color: #1b5e20; padding: 3px 9px; border-radius: 999px; font-weight: 700; font-size: 0.88rem; }
.badge-probleme { background: #fdecea; color: #b71c1c; padding: 3px 9px; border-radius: 999px; font-weight: 700; font-size: 0.88rem; }

.graphique { width: 100%; height: auto; background: #fff; border: 1px solid #dde5dd; border-radius: 12px; }
.legende .pastille-vert, .legende .pastille-rouge { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.pastille-vert { background: #2e7d32; }
.pastille-rouge { background: #c62828; }

.pied { text-align: center; color: #5f7261; padding: 20px 16px 30px; font-size: 0.92rem; }
.impression-mention { display: none; }

@media print {
  .nav-app, .nav-bas, .entete-app, .pied, .hors-impression, .bouton { display: none !important; }
  .impression-mention { display: inline; }
  body { background: #fff; }
}
