/* ═══════════════════════════════════════════════════════════════════════════
   Livraisons — feuille de style commune.

   Reprise des couleurs et des proportions de la démonstration validée par
   Nicolas : c'est le même produit, il ne doit pas le redécouvrir.

   Les variables --encre et --azur sont réécrites par le gabarit à partir de
   la couleur enregistrée pour l'entreprise : l'application est aux couleurs
   de chaque blanchisserie, sans duplication de feuille de style.
   ═══════════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Manrope";
  src: url("manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --encre: #101F3D;
  --encre-2: #1B2E52;
  --encre-doux: #4A5A78;
  --gris-texte: #5E6A80;
  --azur: #3E74D8;
  --azur-fonce: #2A55A8;
  --azur-pale: #EEF3FC;
  --carte: #FFFFFF;
  --fond: #F3F5F9;
  --trait: #E2E7EF;
  --vert: #15803D;
  --vert-pale: #ECFDF3;
  --rouge: #B42318;
  --rouge-pale: #FEF3F2;
  --sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --rayon: 18px;
  --ombre: 0 1px 2px rgba(16, 31, 61, .04), 0 8px 24px -12px rgba(16, 31, 61, .20);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--fond);
  color: var(--encre);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 3px solid var(--azur); outline-offset: 2px; border-radius: 8px; }
svg { display: block; flex-shrink: 0; }

.sr {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ── Écrans d'entrée : connexion, mot de passe ───────────────────────── */

.entree {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 32px 16px;
  color: #fff;
  background:
    radial-gradient(900px 520px at 100% 0, rgba(62, 116, 216, .32), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(62, 116, 216, .12), transparent 60%),
    linear-gradient(135deg, var(--encre-2) 0%, var(--encre) 60%);
}

.entree-carte { width: 100%; max-width: 400px; }

.marque { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.marque img { width: 46px; height: 46px; border-radius: 14px; }
.marque-logo {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(90deg, var(--azur), var(--azur-fonce));
  box-shadow: 0 10px 30px -8px rgba(42, 85, 168, .6);
}
.marque-nom { font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.marque-sous { font-size: 12.5px; color: #93A2BC; font-weight: 600; }

.entree h1 {
  font-size: 27px; line-height: 1.15; letter-spacing: -.035em;
  font-weight: 800; margin-bottom: 10px;
}
.entree .intro { color: #B3BECE; font-size: 15px; margin-bottom: 24px; }

.entree form { display: grid; gap: 14px; }
.entree label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: #C9CED6; }
.entree input {
  font-size: 16px;          /* en dessous de 16 px, iOS zoome à la saisie */
  color: #fff;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 14px;
  padding: 14px 16px; min-height: 52px; width: 100%;
  transition: border-color .15s, background .15s;
}
.entree input:focus { outline: none; border-color: #fff; background: rgba(255, 255, 255, .1); }

.entree button[type="submit"] {
  font-weight: 800; font-size: 16px; min-height: 56px;
  border-radius: 16px; background: #fff; color: var(--encre);
  margin-top: 6px; transition: transform .12s;
}
.entree button[type="submit"]:active { transform: scale(.98); }
.entree :focus-visible { outline-color: #fff; }

.entree .lien {
  display: block; text-align: center; margin-top: 18px;
  font-size: 13.5px; font-weight: 700; color: #93A2BC; text-decoration: none;
}
.entree .lien:hover { color: #fff; }

.message {
  border-radius: 12px; padding: 12px 14px;
  font-size: 14px; font-weight: 600; line-height: 1.45;
}
.message-erreur {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .28);
  color: #fff;
}
.message-ok {
  background: rgba(21, 128, 61, .18);
  border: 1px solid rgba(74, 222, 128, .45);
  color: #DCFCE7;
}

.note {
  margin-top: 22px; font-size: 12.5px; color: #8695B0;
  display: flex; gap: 8px; align-items: flex-start;
}

.aide-mdp {
  font-size: 12.5px; color: #93A2BC; font-weight: 600;
  margin-top: -4px;
}

/* ── Écrans connectés : en-tête et navigation ────────────────────────── */

.entete {
  position: sticky; top: 0; z-index: 10;
  background: var(--encre); color: #fff;
  padding: 0 16px; padding-top: env(safe-area-inset-top);
}
.entete-in {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px; min-height: 60px;
}
.marque-app { display: flex; align-items: center; gap: 10px; min-width: 0; }
.marque-app img { width: 34px; height: 34px; border-radius: 10px; }
.marque-app-nom {
  font-weight: 800; font-size: 15px; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.marque-app-sous { font-size: 11.5px; color: #93A2BC; font-weight: 700; }

.onglets { display: none; gap: 4px; margin-left: auto; }
.onglets a {
  color: #BFCBE0; text-decoration: none; font-weight: 700; font-size: 14px;
  padding: 8px 14px; border-radius: 10px;
}
.onglets a[aria-current="page"] { background: rgba(255,255,255,.14); color: #fff; }

.sortir { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.onglets + .sortir { margin-left: 0; }
.qui { font-size: 13px; font-weight: 700; color: #BFCBE0; }
.sortir button {
  color: #BFCBE0; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
}
.sortir button:hover { background: rgba(255,255,255,.12); color: #fff; }
.entete :focus-visible { outline-color: #fff; }

.app {
  max-width: 1100px; margin: 0 auto;
  padding: 18px 16px calc(84px + env(safe-area-inset-bottom));
}

/* Navigation basse, pour le pouce. Masquée dès qu'il y a de la place. */
.barre-bas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; background: var(--carte);
  border-top: 1px solid var(--trait);
  padding-bottom: env(safe-area-inset-bottom);
}
.barre-bas a {
  flex: 1; text-align: center; padding: 14px 4px;
  font-size: 13px; font-weight: 700; color: var(--gris-texte); text-decoration: none;
}
.barre-bas a[aria-current="page"] { color: var(--azur); }

@media (min-width: 760px) {
  .onglets { display: flex; }
  .barre-bas { display: none; }
  .app { padding-bottom: 40px; }
}

/* ── Blocs communs ───────────────────────────────────────────────────── */

.titre-page { margin-bottom: 16px; }
.titre-page h1 { font-size: 24px; letter-spacing: -.03em; font-weight: 800; }

.carte {
  background: var(--carte); border-radius: var(--rayon);
  box-shadow: var(--ombre); overflow: hidden;
}
.carte-pad { padding: 18px; }
.vide { padding: 28px 18px; text-align: center; color: var(--gris-texte); font-weight: 600; }

.bandeau {
  border-radius: 14px; padding: 13px 16px; margin-bottom: 16px;
  font-weight: 700; font-size: 14.5px;
}
.bandeau-ok     { background: var(--vert-pale);  color: var(--vert);  border: 1px solid #A7E8C0; }
.bandeau-erreur { background: var(--rouge-pale); color: var(--rouge); border: 1px solid #F3B9B4; }

.etiquette {
  font-size: 11.5px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--gris-texte);
}
.aide { font-size: 13px; color: var(--gris-texte); margin-top: 12px; line-height: 1.5; }

.etape { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.etape-num {
  width: 26px; height: 26px; border-radius: 9px; flex-shrink: 0;
  background: var(--azur-pale); color: var(--azur-fonce);
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.etape-titre { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }

/* ── Saisie ──────────────────────────────────────────────────────────── */

.saisie { display: grid; gap: 16px; }
.colonne { display: grid; gap: 16px; min-width: 0; }

@media (min-width: 900px) {
  .saisie { grid-template-columns: 1fr 320px; align-items: start; }
  .recap { position: sticky; top: 78px; }
}

.date-jour { display: block; margin-bottom: 14px; }
.date-jour input {
  width: 100%; font-size: 16px; font-weight: 700;
  padding: 12px 14px; min-height: 50px;
  border: 1px solid var(--trait); border-radius: 13px; background: var(--fond);
}

.clients { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.client { position: relative; display: block; }
.client input {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%;
  margin: 0; cursor: pointer;
}
.client-nom {
  display: block; padding: 13px 14px; min-height: 50px;
  border: 1.5px solid var(--trait); border-radius: 13px;
  font-weight: 700; font-size: 14.5px; background: var(--carte);
  display: flex; align-items: center;
}
.client input:checked + .client-nom {
  border-color: var(--azur); background: var(--azur-pale); color: var(--azur-fonce);
}
.client input:focus-visible + .client-nom { outline: 3px solid var(--azur); outline-offset: 2px; }

.articles { display: grid; gap: 8px; }
.article {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px 8px 14px;
  border: 1.5px solid var(--trait); border-radius: 14px;
}
.article.actif { border-color: var(--azur); background: var(--azur-pale); }
.article-nom { flex: 1; font-weight: 700; font-size: 14.5px; min-width: 0; }

.pas { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pas button {
  /* 52 px : utilisable au pouce, et à travers un gant, sur la tablette du local. */
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--carte); border: 1.5px solid var(--trait);
  font-size: 24px; font-weight: 700; line-height: 1;
  color: var(--encre); display: grid; place-items: center;
}
.pas button:active { background: var(--azur); border-color: var(--azur); color: #fff; }
.pas input {
  width: 62px; height: 52px; text-align: center;
  font-size: 17px;              /* ≥ 16 px : sinon iOS zoome à chaque saisie */
  font-weight: 800;
  border: 1.5px solid var(--trait); border-radius: 13px; background: var(--carte);
  -moz-appearance: textfield;
}
.pas input::-webkit-outer-spin-button,
.pas input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.recap-vide { color: var(--gris-texte); font-size: 14px; padding: 14px 0; }
.recap-lignes { display: grid; gap: 6px; padding: 12px 0; }
.recap-ligne {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 14px; font-weight: 600;
}
.recap-ligne b { font-weight: 800; white-space: nowrap; }
.recap-total {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 12px 0; margin-bottom: 12px;
  border-top: 1px solid var(--trait);
}
.recap-total b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }

.btn-grand {
  width: 100%; min-height: 56px; border-radius: 16px;
  background: var(--azur); color: #fff;
  font-weight: 800; font-size: 16px;
  transition: transform .12s, background .15s;
}
.btn-grand:active { transform: scale(.985); }
.btn-grand:disabled { background: var(--trait); color: var(--gris-texte); cursor: not-allowed; }

.recap-note {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 14px; font-size: 12.5px; color: var(--gris-texte); font-weight: 600;
}

/* ── Liste des livraisons ─────────────────────────────────────────────── */

.sous-titre { color: var(--gris-texte); font-size: 14px; font-weight: 600; margin-top: 4px; }
.sous-titre a { color: var(--azur); font-weight: 700; }

.liste { display: grid; gap: 10px; }

.livraison { display: flex; align-items: flex-start; gap: 14px; padding: 14px; }
.livraison.modifiable { border-left: 3px solid var(--azur); }

.livraison-date {
  width: 46px; flex-shrink: 0; text-align: center;
  background: var(--fond); border-radius: 12px; padding: 7px 0;
}
.livraison-date .j { font-size: 19px; font-weight: 800; line-height: 1; }
.livraison-date .m {
  font-size: 10.5px; font-weight: 700; color: var(--gris-texte);
  text-transform: uppercase; margin-top: 2px;
}

.livraison-corps { flex: 1; min-width: 0; }
.livraison-titre { font-size: 15.5px; font-weight: 800; letter-spacing: -.01em; }
.livraison-meta { font-size: 12.5px; color: var(--gris-texte); font-weight: 600; margin-top: 2px; }

.puces { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.puce {
  background: var(--fond); border-radius: 8px;
  padding: 3px 8px; font-size: 12.5px; font-weight: 600; color: var(--encre-doux);
}
.puce b { font-weight: 800; color: var(--encre); }

.livraison-actions {
  display: flex; flex-direction: column; gap: 6px;
  align-items: stretch; flex-shrink: 0;
}
.btn-ligne {
  display: block; text-align: center; white-space: nowrap;
  padding: 9px 13px; min-height: 40px;
  border: 1.5px solid var(--trait); border-radius: 11px;
  font-size: 13.5px; font-weight: 700; color: var(--encre);
  text-decoration: none; background: var(--carte);
}
.btn-ligne:active { background: var(--fond); }
.btn-danger { color: var(--rouge); border-color: #F3B9B4; width: 100%; }
.livraison-actions form { margin: 0; }

.verrou {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: var(--gris-texte);
  padding: 9px 4px; white-space: nowrap;
}

.lien-action {
  display: inline-block; margin-top: 10px;
  color: var(--azur); font-weight: 700; text-decoration: none;
}

@media (max-width: 520px) {
  .livraison { flex-wrap: wrap; }
  .livraison-actions { flex-direction: row; width: 100%; }
  .livraison-actions > * { flex: 1; }
}

/* ── Relevé : indicateurs, kits, tableaux ─────────────────────────────── */

.titre-avec-actions {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}

.segment {
  display: flex; gap: 2px; padding: 3px;
  background: var(--trait-2, #EDF0F5); border-radius: 12px;
}
.segment a {
  padding: 8px 14px; border-radius: 9px; text-decoration: none;
  font-size: 13.5px; font-weight: 700; color: var(--gris-texte);
}
.segment a[aria-current="page"] { background: var(--carte); color: var(--encre); box-shadow: var(--ombre); }

.kpis {
  display: grid; gap: 12px; margin-bottom: 16px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.kpi { padding: 16px 18px; }
.kpi .v { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin: 6px 0 2px; }
.kpi .d { font-size: 12.5px; color: var(--gris-texte); font-weight: 600; line-height: 1.45; }
.kpi-fort { background: var(--encre); color: #fff; }
.kpi-fort .etiquette, .kpi-fort .d { color: #93A2BC; }

.grille-2 { display: grid; gap: 16px; }
@media (min-width: 900px) { .grille-2 { grid-template-columns: 1fr 340px; align-items: start; } }

.kit-bloc {
  background: var(--fond); border-radius: 14px; padding: 14px 16px; margin-top: 10px;
}
.kit-bloc .l {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 7px 0; font-size: 14px; font-weight: 600;
}
.kit-bloc .l b { font-weight: 800; font-size: 16px; white-space: nowrap; }
.kit-bloc .l small { display: block; color: var(--gris-texte); font-size: 12px; font-weight: 600; }
.kit-bloc .tot {
  border-top: 1px solid var(--trait); margin-top: 6px; padding-top: 12px;
}
.kit-bloc .tot span { font-weight: 800; }
.kit-bloc .tot b { font-size: 22px; color: var(--azur-fonce); }

.tableau-simple { margin-top: 10px; }
.tl {
  display: grid; grid-template-columns: 1fr 64px 92px; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--trait-2, #EDF0F5);
  font-size: 13.5px; align-items: baseline;
}
.tl.sans-total { grid-template-columns: 1fr 92px; }
.tl .n { text-align: right; font-weight: 700; }
.tl b { text-align: right; font-weight: 800; }
.tl-tete {
  font-size: 11.5px; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; color: var(--gris-texte);
}
.tl small { display: block; color: var(--gris-texte); font-size: 12px; font-weight: 600; }

/* ── Écrans du gérant ─────────────────────────────────────────────────── */

.bandeau-attention {
  background: #FFF7ED; color: #9A3412; border: 1px solid #FDBA74;
}
.bandeau a { color: inherit; font-weight: 800; }

.segment-large { margin-bottom: 16px; overflow-x: auto; }
.segment-large a { white-space: nowrap; }

/* Détail par client, replié */
.dc { border-top: 1px solid var(--trait-2, #EDF0F5); }
.dc:first-of-type { border-top: 0; }
.dc summary {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; cursor: pointer; list-style: none;
}
.dc summary::-webkit-details-marker { display: none; }
.dc summary:hover { background: var(--fond); }
.dc-nom { flex: 1; min-width: 0; }
.dc-nom b { display: block; font-size: 15px; font-weight: 800; }
.dc-meta { font-size: 12.5px; color: var(--gris-texte); font-weight: 600; }
.dc-montant { font-size: 16px; font-weight: 800; white-space: nowrap; }
.dc-chevron { color: var(--gris-bord, #8792A6); font-size: 20px; transition: transform .15s; }
.dc[open] .dc-chevron { transform: rotate(90deg); }
.dc-corps { padding: 0 18px 18px; }

.barre-prog {
  display: block; height: 4px; border-radius: 3px;
  background: var(--trait-2, #EDF0F5); margin-top: 7px; max-width: 320px;
}
.barre-prog span { display: block; height: 100%; border-radius: 3px; background: var(--azur); }

/* Graphe des quatorze jours */
.graph { display: flex; align-items: flex-end; gap: 4px; height: 120px; margin-top: 12px; }
.graph .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.graph .b { background: var(--azur-pale); border-radius: 4px 4px 0 0; min-height: 4px; }
.graph .col.max .b { background: var(--azur); }
.graph .lbl { font-size: 10px; color: var(--gris-texte); text-align: center; margin-top: 4px; font-weight: 700; }

/* Lignes de réglage */
.reglage-ligne {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 0; border-bottom: 1px solid var(--trait-2, #EDF0F5);
}
.reglage-ligne .nom { flex: 1; min-width: 130px; font-weight: 700; font-size: 14px; }
.reglage-suppr { padding: 0 0 12px; border-bottom: 1px solid var(--trait-2, #EDF0F5); }

.champ-texte {
  flex: 1; min-width: 130px; font-size: 16px;
  padding: 10px 12px; min-height: 44px;
  border: 1.5px solid var(--trait); border-radius: 11px; background: var(--carte);
}
.champ-unite {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1.5px solid var(--trait); border-radius: 11px;
  padding: 0 11px 0 0; background: var(--carte);
}
.champ-unite input {
  width: 92px; border: 0; background: none; text-align: right;
  font-size: 16px; font-weight: 700; padding: 10px 4px 10px 11px; min-height: 44px;
  -moz-appearance: textfield;
}
.champ-unite input::-webkit-outer-spin-button,
.champ-unite input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.champ-unite.etroit input { width: 62px; }
.champ-unite span { font-size: 12.5px; color: var(--gris-texte); font-weight: 700; white-space: nowrap; }

.select {
  font-size: 15px; padding: 10px 12px; min-height: 44px;
  border: 1.5px solid var(--trait); border-radius: 11px; background: var(--carte);
}

.champ-bloc { display: grid; gap: 6px; margin-bottom: 12px; }
.champ-bloc > span:first-child { font-size: 13px; font-weight: 700; color: var(--encre-doux); }
.form-tarif { max-width: 380px; }

.ajout { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.btn-primaire { background: var(--azur); color: #fff; border-color: var(--azur); }

.badge {
  font-size: 11.5px; font-weight: 800; padding: 4px 9px; border-radius: 7px;
  background: var(--fond); color: var(--encre-doux); white-space: nowrap;
}
.badge-attente { background: #FFF7ED; color: #9A3412; }

.somme {
  margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  background: var(--vert-pale); color: var(--vert);
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.somme b { font-size: 17px; font-weight: 800; }
.somme small { flex-basis: 100%; font-size: 12.5px; font-weight: 600; opacity: .9; }
.somme-alerte { background: var(--rouge-pale); color: var(--rouge); }
