/* chauffeur.css — Module chauffeur (Tâches 4.84 à 4.92)
   RÈGLE : orange, bleu et jaune sont RÉSERVÉS aux usines (D85 orange, S92 bleu, S89 jaune) — jamais pour autre chose. */

/* Champ « Nom du chauffeur » grisé pour les non-administrateurs */
input.chauffeur-grise{background:#e9ecea !important;color:#6b7670 !important;cursor:not-allowed !important;border-color:#cfd6d1 !important;}

/* Écran chauffeur : plus de menu latéral, une seule colonne centrée */
body.role-chauffeur .sidebar,
body.role-chauffeur #navPad,
body.role-chauffeur .hist-nav,
body.role-chauffeur .nav-toggle{display:none !important;}
body.role-chauffeur .main{margin-left:0 !important;max-width:none;width:100%;padding:0;}
body.role-chauffeur .app{display:block;}

.chf{max-width:760px;margin:0 auto;padding:14px 16px 40px;}
.chf-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px;}
.chf-brand{display:flex;align-items:center;gap:10px;font-weight:800;color:var(--g9);font-size:16px;}
.chf-brand img{width:36px;height:36px;border-radius:9px;object-fit:contain;background:#fff;padding:2px;border:1px solid var(--line);}
.chf-btns{display:flex;gap:8px;}
.chf-mini{border:1px solid var(--line);background:#fff;color:var(--g7);border-radius:12px;min-height:44px;min-width:44px;padding:8px 14px;font-size:15px;font-weight:700;}
.chf-red{color:var(--red);}

.chf-id{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:16px;}
.chf-id>div{flex:1 1 220px;background:var(--g1);border:1px solid #cfe6d8;border-radius:16px;padding:12px 16px;}
.chf-id small{display:block;font-size:12.5px;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.04em;}
.chf-id b{display:block;font-size:24px;color:var(--g9);line-height:1.2;margin-top:2px;overflow-wrap:anywhere;}

.chf-title{font-size:26px;color:var(--g9);margin:4px 2px 12px;}
.chf-card{background:#fff;border:1px solid var(--line);border-radius:20px;box-shadow:var(--shadow);padding:18px;margin-bottom:18px;}
.chf-card h3{font-size:20px;color:var(--g9);margin-bottom:8px;}

/* Les trois grandes cages */
.chf-cage{display:block;margin-bottom:16px;}
.chf-lbl{display:block;font-size:19px;font-weight:800;color:var(--g9);margin-bottom:6px;}
.chf-inp{display:flex;align-items:center;gap:10px;background:#fff;border:3px solid var(--g5);border-radius:18px;padding:0 18px;min-height:96px;}
.chf-inp:focus-within{border-color:var(--g9);box-shadow:0 0 0 4px rgba(39,153,90,.22);}
.chf-inp input{flex:1;min-width:0;border:0;outline:0;background:transparent;font-size:46px;font-weight:800;color:var(--text);padding:8px 0;text-align:right;-moz-appearance:textfield;}
.chf-inp input::-webkit-outer-spin-button,.chf-inp input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}
.chf-inp input::placeholder{color:#c3cbc6;}
.chf-inp em{font-style:normal;font-size:26px;font-weight:800;color:var(--muted);}
.chf-auto .chf-inp{background:var(--g1);border-style:dashed;}
.chf-auto .chf-lbl::after{content:' (calculé)';font-weight:600;color:var(--muted);font-size:15px;}

.chf-aide{font-size:15.5px;color:var(--muted);margin:2px 2px 14px;min-height:22px;}
.chf-aide.ok{color:var(--g7);font-weight:700;}
.chf-aide.ko{color:var(--red);font-weight:700;}
.chf-save{display:block;width:100%;min-height:78px;border:0;border-radius:18px;background:var(--g6);color:#fff;font-size:26px;font-weight:800;}
.chf-save:active{background:var(--g9);}
.chf-save:disabled{opacity:.6;}
.chf-cancel{display:block;width:100%;min-height:54px;margin-top:10px;border:1px solid var(--line);border-radius:14px;background:#fff;color:var(--muted);font-size:18px;font-weight:700;}

/* Historique (lignes, pas de tableau : reste lisible sur téléphone) */
.chf-jour{font-size:17px;margin:2px 0 10px;color:var(--text);}
.chf-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 8px;border-bottom:1px solid var(--line);border-radius:10px;}
.chf-row.chf-today{background:#f4faf6;}
.chf-when2{flex:0 0 112px;display:flex;flex-direction:column;font-size:17px;}
.chf-when2 span{color:var(--muted);font-size:14px;}
.chf-vals{flex:1 1 240px;display:grid;grid-template-columns:repeat(3,1fr);gap:8px;font-size:20px;font-variant-numeric:tabular-nums;}
.chf-vals small{display:block;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:700;}
.chf-vals .chf-h{font-weight:800;color:var(--g9);}
.chf-act{display:flex;gap:8px;margin-left:auto;}
.chf-none{font-size:17px;color:var(--muted);padding:8px 2px;}

@media (max-width:520px){
  .chf{padding:10px 10px 30px;}
  .chf-top{flex-wrap:wrap;}
  .chf-btns{width:100%;}
  .chf-btns .chf-mini{flex:1;}
  .chf-inp input{font-size:40px;}
  .chf-id b{font-size:21px;}
  .chf-vals{font-size:18px;flex-basis:100%;order:3;}
  .chf-act{order:2;}
}

/* ── Tâche 4.85 : identification de la livraison en haut de l'écran chauffeur ── */
.chf-idform{background:var(--g1);border:1px solid #cfe6d8;border-radius:16px;padding:14px 14px 4px;margin-bottom:18px;}
.chf-idform h3{font-size:18px;margin-bottom:10px;}
.chf-f{display:block;margin-bottom:12px;}
.chf-f span{display:block;font-size:15px;font-weight:700;color:var(--g9);margin-bottom:4px;}
.chf-f input{width:100%;min-height:58px;border:2px solid var(--g5);border-radius:14px;padding:0 14px;font-size:24px;font-weight:700;background:#fff;color:var(--text);text-transform:none;}
.chf-f input:focus{outline:0;border-color:var(--g9);box-shadow:0 0 0 4px rgba(39,153,90,.22);}
.chf-ident2{flex:1 1 100%;order:-1;display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;font-size:16px;}
.chf-ident2 small{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:700;}
.chf-badge{margin-left:auto;padding:4px 12px;border-radius:999px;background:#eef1ef;color:var(--muted);font-size:13.5px;font-weight:800;}
.chf-badge.ok{background:#d9f2e2;color:var(--g9);}
.chf-badge.todo{background:#f3e8ff;color:#6b21a8;}

/* ── Tâche 4.85 : pesées en attente (page Saisie, tout en haut) ── */
.pa-card{border:2px solid var(--g5);}
.pa-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;}
.pa-head h3{margin:0;color:var(--g9);}
.pa-btn{border:1px solid var(--line);background:#fff;color:var(--g7);border-radius:10px;padding:6px 12px;font-weight:700;cursor:pointer;}
.pa-hint{font-size:13.5px;color:var(--muted);margin:6px 0 10px;}
.pa-sel{background:#e6f6ec;border:1px solid var(--g5);border-radius:12px;padding:10px 12px;margin-bottom:10px;font-size:14.5px;}
.pa-sel .pa-btn{margin-left:8px;}
.pa-list{display:flex;flex-direction:column;gap:8px;max-height:320px;overflow:auto;}
.pa-row{display:flex;align-items:center;gap:10px 16px;flex-wrap:wrap;border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:#fff;}
.pa-row.pa-today{background:#f4faf6;}
.pa-row.pa-on{border-color:var(--g6);box-shadow:0 0 0 3px rgba(39,153,90,.25);}
.pa-when{flex:0 0 92px;display:flex;flex-direction:column;font-size:14.5px;}
.pa-when span{color:var(--muted);font-size:13px;}
.pa-id{flex:1 1 220px;display:flex;flex-wrap:wrap;gap:2px 12px;font-size:14.5px;}
.pa-id b{flex:1 1 100%;}
.pa-id small,.pa-w small{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:700;margin-right:4px;}
.pa-w{display:flex;gap:14px;font-variant-numeric:tabular-nums;font-size:15px;}
.pa-w span{display:flex;flex-direction:column;}
.pa-w .pa-h{font-weight:800;color:var(--g9);}
.pa-use{margin-left:auto;border:0;border-radius:10px;background:var(--g6);color:#fff;font-weight:800;padding:10px 18px;min-height:42px;cursor:pointer;}
.pa-none{color:var(--muted);padding:6px 2px;}
#chfBenne,#chfParcelle{text-transform:uppercase;}

/* ── Tâche 4.91 : programme de livraison en liste déroulante colorée (contractant | benne | parcelle alignés) ── */
.chf-livr{margin-bottom:14px;}
.chf-livr-t{font-size:16px;font-weight:800;color:var(--g9);margin:0 0 2px;}
.chf-nb{display:inline-block;min-width:22px;padding:0 7px;border-radius:999px;background:#1f7a49;color:#fff;font-size:13px;text-align:center;vertical-align:1px;}
.chf-livr-h{font-size:14px;color:var(--muted);margin:0 0 10px;}
.chf-dd{position:relative;}
.chf-dd-btn{width:100%;display:flex;align-items:center;gap:10px;min-height:58px;padding:8px 14px;border:3px solid #1f7a49;border-radius:16px;background:#fff;cursor:pointer;text-align:left;font-size:18px;}
.chf-dd.open .chf-dd-btn{border-color:#0f3d24;box-shadow:0 0 0 4px rgba(39,153,90,.22);}
.chf-dd-val{flex:1;min-width:0;display:grid;grid-template-columns:minmax(0,1.7fr) minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:center;}
.chf-dd-val:not(.plein){display:block;}
.chf-dd-val.plein{padding-right:0;}
.chf-dd-ph{color:#1f7a49;font-weight:800;}
.chf-dd-caret{flex:0 0 auto;font-size:22px;color:#1f7a49;transition:transform .25s ease;}
.chf-dd.open .chf-dd-caret{transform:rotate(180deg);}
.chf-dd-clear{position:absolute;top:-13px;right:12px;width:30px;height:30px;padding:0;border:2px solid #fff;border-radius:50%;background:#b91c1c;color:#fff;font-size:15px;font-weight:800;line-height:1;cursor:pointer;box-shadow:0 2px 6px rgba(0,0,0,.25);z-index:2;}
.chf-dd-clear[hidden]{display:none;}
.chf-dd-panel{position:absolute;left:0;right:0;top:calc(100% + 6px);z-index:40;display:flex;flex-direction:column;background:#fff;border:2px solid #1f7a49;border-radius:16px;box-shadow:0 14px 34px rgba(0,0,0,.25);overflow:hidden;
  max-height:0;opacity:0;visibility:hidden;transform:translateY(-8px);transition:max-height .28s ease,opacity .2s ease,transform .25s ease,visibility .25s;}
.chf-dd.open .chf-dd-panel{max-height:min(420px,62vh);opacity:1;visibility:visible;transform:none;}
.chf-dd-search{margin:10px 10px 4px;padding:10px 12px;border:2px solid #cfe6d8;border-radius:12px;font-size:16px;min-height:44px;}
.chf-dd-head,.chf-opt{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:center;padding:8px 12px;}
.chf-dd-head{font-size:11.5px;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);border-bottom:1px solid var(--line);background:#f4faf6;}
.chf-dd-list{overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;}
.chf-dd-grp{padding:6px 12px;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:#14532d;background:#e6f6ec;position:sticky;top:0;}
.chf-opt{border-left:6px solid var(--c);border-bottom:1px solid #eef1ef;cursor:pointer;min-height:52px;}
.chf-opt:hover,.chf-opt:focus{background:#f4faf6;outline:0;}
.chf-opt.on{background:#e6f6ec;}
.chf-opt.on .chf-c::before{content:'✔ ';}
.chf-c,.chf-b,.chf-p{border:2px solid transparent;border-radius:999px;padding:5px 12px;font-size:15.5px;font-weight:800;line-height:1.15;overflow-wrap:anywhere;text-align:center;}
.chf-c{text-align:left;}
.chf-b{background:#e7e7ea;color:#27272a;border-color:#52525b;}
.chf-p{background:#ccfbf1;color:#115e59;border-color:#0f766e;}
.chf-dd-none{padding:14px;color:var(--muted);text-align:center;}
.chf-dd-none[hidden],.chf-opt[hidden],.chf-dd-grp[hidden]{display:none;}
.chf-sel{display:flex;flex-direction:column;align-items:flex-start;gap:6px;margin-top:12px;}
.chf-sel[hidden]{display:none;}
.chf-pills-t{font-size:12.5px;font-weight:800;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);}
.chf-pill{border:2px solid transparent;border-radius:999px;padding:6px 14px;font-size:15px;font-weight:800;line-height:1.2;overflow-wrap:anywhere;text-align:left;}
.chf-pill small{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;opacity:.75;margin-right:2px;}
.chf-pill.pc{background:#d9f2e2;color:#14532d;border-color:#27995a;}
.chf-pill.pp{background:#ccfbf1;color:#115e59;border-color:#0f766e;}
.chf-pill.pb{background:#e7e7ea;color:#27272a;border-color:#52525b;}
.chf-pill.pu{font-weight:800;}   /* usine : couleur posée par le script (D85 orange, S92 bleu, S89 jaune) */
.chf-pill.pi{background:#eef1ef;color:#44524a;border-color:#d5dcd7;font-weight:700;}
@media (max-width:520px){
  .chf-dd-btn{font-size:16px;padding:8px 10px;}
  .chf-c,.chf-b,.chf-p{font-size:14px;padding:5px 8px;}
  .chf-dd-head,.chf-opt{padding:8px 8px;gap:5px;}
  .chf-dd-val{gap:5px;}
  .chf-dd-val.plein{grid-template-columns:minmax(0,1fr) auto auto;}
  .chf-dd-val .chf-b,.chf-dd-val .chf-p{white-space:nowrap;overflow-wrap:normal;}
}

/* ── Tâche 4.87 : page Programme (admin) — modification d'une ligne ── */
.prog-flash{box-shadow:0 0 0 4px rgba(39,153,90,.45) !important;transition:box-shadow .3s;}
#programmeBody tr.prog-row-edit td{background:#e6f6ec !important;}
.chf-sel[hidden]{display:none;}
/* écran chauffeur : pas de bulle d'aide générique du site par-dessus les boutons et champs */
.chf .help-tooltip::after{display:none !important;}
