/* Appli de prospection : téléphone d'abord, couleurs du Trade (ardoise, bronze) */
:root {
  --fond: #F4F1EC; --carte: #FFFFFF; --encre: #18222D; --doux: #5F6B76; --trait: #E2DCD2;
  --bronze: #A98B5D; --bronze-fonce: #7D6540; --rouge: #B3402E; --vert: #3F7D4E; --bleu: #2F6FB0;
  --rayon: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #11181F; --carte: #1A232D; --encre: #E8E4DD; --doux: #98A3AD; --trait: #2B3743;
    --bronze: #C4A574; --bronze-fonce: #D9BE8E; --rouge: #E07A66; --vert: #7CC08C; --bleu: #7DB0E6;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--encre);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--bronze-fonce); }
[hidden] { display: none !important; }

/* barre du haut */
.barre {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: #18222D; color: #fff;
}
.barre h1 { flex: 1; margin: 0; font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre a { color: #fff; text-decoration: none; }
.retour, .plus { font-size: 28px; line-height: 1; padding: 0 6px; }
.plus { width: 36px; height: 36px; border-radius: 50%; background: var(--bronze); display: grid; place-items: center; font-size: 24px; padding: 0; }
.essai { font-size: 12px; background: #B3402E; color: #fff; border-radius: 6px; padding: 2px 6px; }

main { max-width: 760px; margin: 0 auto; padding: 12px 16px 40px; }
.attente, .vide-liste { color: var(--doux); text-align: center; padding: 32px 0; }

/* recherche et filtres */
.recherche { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--carte); color: var(--encre); }
.filtres { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 6px; scrollbar-width: none; }
.filtres::-webkit-scrollbar { display: none; }
.puce {
  flex: none; font: inherit; font-size: 14px; border: 1px solid var(--trait); background: var(--carte); color: var(--encre);
  border-radius: 999px; padding: 5px 12px; cursor: pointer;
}
.puce[aria-pressed="true"] { background: var(--encre); color: var(--fond); border-color: var(--encre); }
.puce small { color: inherit; opacity: .65; margin-left: 4px; }
.compte { color: var(--doux); font-size: 13px; margin: 4px 2px 8px; }

/* liste */
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ligne a {
  display: block; text-decoration: none; color: inherit; background: var(--carte);
  border: 1px solid var(--trait); border-radius: var(--rayon); padding: 10px 12px;
}
.ligne .haut { display: flex; align-items: baseline; gap: 8px; }
.ligne .nom { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne .bas { color: var(--doux); font-size: 14px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref { color: var(--doux); font-size: 13px; font-variant-numeric: tabular-nums; }
.retard { color: var(--rouge); font-weight: 600; }
.jour { color: var(--bronze-fonce); font-weight: 600; }

/* statuts */
.statut { flex: none; font-size: 12px; border-radius: 6px; padding: 2px 7px; background: var(--trait); color: var(--encre); white-space: nowrap; }
.s-contacte { background: #DCE7F3; color: #1F4E7A; }
.s-non-remis, .s-ecarte { background: #F1DAD5; color: #8A2E20; }
.s-a-repondu { background: #F3E6CF; color: #6E5226; }
.s-tarif-recu, .s-compte-ouvert { background: #DDEBDD; color: #2C5E38; }
.s-demande-de-prix { background: #18222D; color: #fff; }
@media (prefers-color-scheme: dark) {
  .s-contacte { background: #1F3348; color: #A9CBEE; }
  .s-non-remis, .s-ecarte { background: #45261F; color: #F0A898; }
  .s-a-repondu { background: #42361F; color: #E5C88F; }
  .s-tarif-recu, .s-compte-ouvert { background: #213A27; color: #A6D8B1; }
  .s-demande-de-prix { background: #E8E4DD; color: #18222D; }
}

/* fiche */
.bloc { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px; margin-bottom: 12px; }
.bloc h2 { font-size: 15px; margin: 0 0 10px; color: var(--doux); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.entete .haut { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.entete .nom { font-size: 20px; font-weight: 700; margin: 0; flex-basis: 100%; }
.entete .infos { margin: 8px 0 0; color: var(--doux); font-size: 14px; }
.entete .liens { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.entete .liens a { font-size: 14px; border: 1px solid var(--trait); border-radius: 8px; padding: 6px 10px; text-decoration: none; overflow-wrap: anywhere; }
.texte-long { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; margin: 6px 0 0; }
dl.paires { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
dl.paires dt { color: var(--doux); }
dl.paires dd { margin: 0; overflow-wrap: anywhere; }

/* formulaires */
label { display: block; font-size: 14px; color: var(--doux); margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px; padding: 9px 10px; border: 1px solid var(--trait);
  border-radius: 8px; background: var(--fond); color: var(--encre);
}
textarea { min-height: 80px; resize: vertical; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.bouton {
  display: inline-block; font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 11px 16px;
  background: var(--bronze); color: #fff; cursor: pointer; text-decoration: none; margin-top: 14px;
}
.bouton.large { width: 100%; }
.bouton.second { background: transparent; color: var(--encre); border: 1px solid var(--trait); }
.bouton:disabled { opacity: .55; cursor: wait; }
details.bloc > summary { cursor: pointer; font-size: 15px; color: var(--doux); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; list-style: none; }
details.bloc > summary::after { content: " ▾"; }
details.bloc[open] > summary::after { content: " ▴"; }
.alerte { background: #F1DAD5; color: #8A2E20; border-radius: 8px; padding: 10px 12px; font-size: 14px; margin-top: 12px; }
@media (prefers-color-scheme: dark) { .alerte { background: #45261F; color: #F0A898; } }
.alerte ul { margin: 6px 0 0; padding-left: 18px; }

/* journal */
.journal { list-style: none; margin: 0; padding: 0; }
.journal li { border-left: 2px solid var(--trait); padding: 0 0 12px 12px; position: relative; }
.journal li::before { content: ""; position: absolute; left: -5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--bronze); }
.journal .quand { font-size: 13px; color: var(--doux); }
.journal .quoi { font-size: 15px; margin-top: 1px; overflow-wrap: anywhere; }
.journal .detail { font-size: 13px; color: var(--doux); white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }

/* tableaux (tarifs, prix) */
.defile { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--trait); vertical-align: top; }
th { color: var(--doux); font-weight: 600; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* message flottant */
.message {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 10;
  max-width: 480px; margin: 0 auto; background: var(--encre); color: var(--fond); border-radius: 10px;
  padding: 12px 14px; font-size: 15px; box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.message.ko { background: var(--rouge); color: #fff; }

/* pages du serveur (connexion refusée, etc.) */
main.vide { text-align: center; padding-top: 60px; }
body > .compte { text-align: center; margin: 0 0 24px; }

/* onglets */
.onglets { display: flex; background: #18222D; padding: 0 16px; gap: 4px; }
.onglets a { flex: 1; text-align: center; color: #C9CED3; text-decoration: none; padding: 8px 0 10px; font-size: 15px; border-bottom: 3px solid transparent; }
.onglets a[aria-current="page"] { color: #fff; border-bottom-color: var(--bronze); font-weight: 600; }

/* Zayd */
.aide { color: var(--doux); font-size: 14px; margin: 0 0 4px; }
.prospect { border-top: 1px solid var(--trait); padding: 10px 0; display: flex; gap: 10px; align-items: flex-start; }
.prospect:first-of-type { border-top: 0; }
.prospect input[type="checkbox"] { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.prospect .corps { flex: 1; min-width: 0; }
.prospect .nom { font-weight: 600; }
.prospect .bas { color: var(--doux); font-size: 13px; overflow-wrap: anywhere; }
.prospect .note { font-size: 13px; margin-top: 4px; overflow-wrap: anywhere; }
.etiquette { font-size: 12px; border-radius: 6px; padding: 1px 6px; background: var(--trait); }
.etiquette.ok { background: #DDEBDD; color: #2C5E38; }
.etiquette.ko { background: #F3E6CF; color: #6E5226; }
@media (prefers-color-scheme: dark) { .etiquette.ok { background: #213A27; color: #A6D8B1; } .etiquette.ko { background: #42361F; color: #E5C88F; } }
.sticky-bas { position: sticky; bottom: calc(8px + env(safe-area-inset-bottom)); }
.prospect .corps > .bas, .prospect .corps > .note { display: block; }

/* produits, comparaison */
.coche { display: flex; gap: 8px; align-items: center; color: var(--encre); }
.coche input { width: 20px; height: 20px; }
.produit .haut { display: flex; align-items: baseline; gap: 8px; }
.produit .nom { flex: 1; font-weight: 600; }
tr.meilleur td { background: color-mix(in srgb, var(--vert) 12%, transparent); }
tr.debut td { border-top: 2px solid var(--trait); }
.onglets a { font-size: 14px; }
