/* Tableau de bord BizPilot : pensé d'abord pour un téléphone et un forfait limité, sans dépendance externe. */
:root {
  --fond: #f6f5f1;
  --surface: #ffffff;
  --texte: #1c2321;
  --discret: #5e6a66;
  --bord: #e3e1da;
  --marque: #0d6b52;
  --marque-fonce: #0a5240;
  --marque-pale: #e2f1ec;
  --alerte: #a23b1e;
  --alerte-pale: #fbe9e3;
  --attente: #8a5a00;
  --attente-pale: #fdf1d8;
  --rayon: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--marque); }
h1 { font-size: 1.4rem; margin: 0; line-height: 1.25; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
p { margin: 0 0 .75rem; }

.page { max-width: 760px; margin: 0 auto; padding: 16px 16px 96px; }
.entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.boutique { font-size: .85rem; color: var(--discret); }
.discret { color: var(--discret); font-size: .9rem; }
.pile > * + * { margin-top: 12px; }

.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 14px 16px; }
.carte-lien { display: block; color: inherit; text-decoration: none; }
.carte-lien:hover { border-color: var(--marque); }
.ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ligne > :first-child { min-width: 0; overflow-wrap: anywhere; }

.grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.chiffre { font-size: 1.35rem; font-weight: 650; line-height: 1.2; overflow-wrap: anywhere; }
.libelle { font-size: .82rem; color: var(--discret); }

.pastille { display: inline-block; white-space: nowrap; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--bord); color: var(--texte); }
.pastille-en_attente, .pastille-humain { background: var(--attente-pale); color: var(--attente); }
.pastille-payee, .pastille-livree, .pastille-agent { background: var(--marque-pale); color: var(--marque-fonce); }
.pastille-annulee, .pastille-expiree { background: var(--alerte-pale); color: var(--alerte); }

.bouton { display: inline-block; border: 0; border-radius: 10px; padding: 11px 18px; font: inherit; font-weight: 600; background: var(--marque); color: #fff; cursor: pointer; text-decoration: none; text-align: center; }
.bouton:hover { background: var(--marque-fonce); }
.bouton-second { background: var(--surface); color: var(--texte); border: 1px solid var(--bord); }
.bouton-second:hover { background: var(--fond); }
.bouton-danger { background: var(--surface); color: var(--alerte); border: 1px solid var(--alerte); }
.bouton-danger:hover { background: var(--alerte-pale); }
.bouton-large { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.message { padding: 10px 14px; border-radius: 10px; background: var(--marque-pale); color: var(--marque-fonce); margin-bottom: 12px; }
.message-error, .message-alerte { background: var(--alerte-pale); color: var(--alerte); }
.message-attente { background: var(--attente-pale); color: var(--attente); }

form p { margin-bottom: 14px; }
label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], input[type=url], input[type=month], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--bord); border-radius: 10px; font: inherit; background: var(--surface); color: var(--texte);
}
input[type=checkbox] { width: 20px; height: 20px; vertical-align: middle; }
:focus-visible { outline: 2px solid var(--marque); outline-offset: 2px; }
.helptext { display: block; font-size: .82rem; color: var(--discret); font-weight: 400; }
.errorlist { list-style: none; padding: 0; margin: 4px 0; color: var(--alerte); font-size: .88rem; }

.filtres { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; }
.filtre { white-space: nowrap; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--bord); background: var(--surface); color: var(--texte); text-decoration: none; font-size: .88rem; }
.filtre-actif { background: var(--marque); border-color: var(--marque); color: #fff; }

.fil { display: flex; flex-direction: column; gap: 8px; }
.bulle { max-width: 85%; padding: 8px 12px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--bord); align-self: flex-start; }
.bulle-agent, .bulle-humain { align-self: flex-end; background: var(--marque-pale); border-color: transparent; }
.bulle-meta { display: block; font-size: .72rem; color: var(--discret); margin-top: 2px; }
.vignette { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; flex: none; background: var(--bord); }

.nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--surface); border-top: 1px solid var(--bord); z-index: 10; }
.nav a { flex: 1; text-align: center; padding: 12px 2px; font-size: .78rem; color: var(--discret); text-decoration: none; }
.nav a.actif { color: var(--marque); font-weight: 700; }

.centre { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.centre .carte { width: 100%; max-width: 420px; }
.marque { font-weight: 750; color: var(--marque); font-size: 1.2rem; margin-bottom: 12px; }

table.recu { width: 100%; border-collapse: collapse; }
table.recu td { padding: 6px 0; border-bottom: 1px solid var(--bord); vertical-align: top; }
table.recu td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; }
table.recu tr.total td { font-weight: 700; border-bottom: 0; }

@media (min-width: 900px) {
  .page { padding-bottom: 32px; padding-left: 216px; max-width: 980px; }
  .nav { top: 0; right: auto; width: 190px; flex-direction: column; border-top: 0; border-right: 1px solid var(--bord); padding-top: 16px; }
  .nav a { flex: none; text-align: left; padding: 10px 20px; font-size: .95rem; }
  .grille { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media print {
  .nav, .bouton { display: none; }
  body { background: #fff; }
}

.jauge { height: 8px; border-radius: 99px; background: var(--bord); overflow: hidden; }
.jauge span { display: block; height: 100%; background: var(--marque); border-radius: 99px; }
.jauge .jauge-haute { background: var(--attente); }
.carte-conseillee { border: 2px solid var(--marque); }
.choix-durees { display: grid; gap: 8px; }
.choix-durees .bouton small { display: block; font-weight: 500; font-size: .8rem; opacity: .9; }
.code { font-size: 1.3rem; letter-spacing: .08em; }
.carte-cadeau { background: var(--attente-pale); border-color: #f0d9a6; }
@media (min-width: 560px) { .choix-durees { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
