/* ==========================================================================
   TRANSLUX — Nouveau style (couche visuelle uniquement)
   Aucune fonction n'est modifiée : ce fichier ne fait que changer l'apparence.
   Pour revenir à l'ancien style : retirer les 2 lignes "translux-theme" des pages
   (ou restaurer la sauvegarde /root/backups/translux-avant-nouveau-style-*.tar.gz).
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Exo+2:ital,wght@1,700;1,800&display=swap');

:root{
  --tx-bg:#eaf0fb; --tx-surface:#ffffff; --tx-surface2:#f1f5fd; --tx-line:#d9e2f5; --tx-fg:#0a1738; --tx-muted:#5b6c99;
  --tx-navy:#030814; --tx-navy2:#0a1a45; --tx-side-fg:#b4c3ec;
  --tx-blue:#1f6bff; --tx-blue2:#123fb8; --tx-orange:#ff7a00; --tx-amber:#ffb020;
  --tx-glow:0 0 0 1px rgba(31,107,255,.25),0 8px 26px rgba(31,107,255,.18);
  --tx-shadow:0 1px 2px rgba(10,23,56,.06),0 10px 28px rgba(18,63,184,.10);
  --tx-font:'Manrope','Segoe UI',system-ui,sans-serif; --tx-disp:'Exo 2','Manrope',system-ui,sans-serif;
}

/* ---------- base ---------- */
html{-webkit-text-size-adjust:100%}
body{font-family:var(--tx-font)!important;color:var(--tx-fg)}
body:has(.sidebar){background:var(--tx-bg)!important}
button,input,select,textarea{font-family:inherit}
:focus-visible{outline:2px solid var(--tx-amber);outline-offset:2px}
::selection{background:rgba(255,122,0,.25)}

/* ---------- barre latérale (logo en haut à gauche) ---------- */
body .sidebar{
  background:
    radial-gradient(120% 45% at 0% 100%,rgba(255,122,0,.26),transparent 62%),
    radial-gradient(120% 40% at 100% 0%,rgba(31,107,255,.38),transparent 62%),
    var(--tx-navy)!important;
  border-right:1px solid rgba(255,255,255,.07);
  box-shadow:8px 0 40px rgba(3,8,20,.35)!important;
  scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.18) transparent;
}
body .sidebar-logo{margin:10px 12px 4px!important;padding:6px!important;text-align:left!important}
body .sidebar-logo img{mix-blend-mode:screen;border-radius:14px;max-width:210px!important;width:100%;height:auto;filter:drop-shadow(0 0 14px rgba(31,107,255,.35))}
body .sidebar-user{margin:0 14px 6px!important;padding:10px 14px!important;border-radius:14px!important;background:rgba(255,255,255,.07)!important;border:1px solid rgba(255,255,255,.08)}
body .sidebar-user .user-name{font-weight:800!important;color:#fff!important}
body .sidebar-user .user-role{color:var(--tx-amber)!important;font-weight:700}
body .nav-section-title{font-size:11px!important;letter-spacing:.14em!important;text-transform:uppercase;color:#6f86c8!important;font-weight:800!important;padding:16px 22px 6px!important}
body .sidebar-nav{padding:4px 10px!important}
body .sidebar .nav-item{
  display:flex!important;align-items:center;gap:12px;margin:2px 0;padding:10px 12px!important;border-radius:12px!important;border:0!important;border-left:0!important;
  color:var(--tx-side-fg)!important;font-weight:600;font-size:14px;position:relative;text-decoration:none;
  transition:background .15s,color .15s,transform .15s;
}
body .sidebar .nav-item:hover{background:rgba(255,255,255,.09)!important;color:#fff!important;transform:translateX(3px)}
body .sidebar .nav-item.active{
  background:linear-gradient(90deg,rgba(31,107,255,.6),rgba(31,107,255,.12))!important;color:#fff!important;font-weight:800;
  box-shadow:inset 0 0 0 1px rgba(127,176,255,.35)!important;
}
body .sidebar .nav-item.active::before{content:"";position:absolute;left:-10px;top:8px;bottom:8px;width:4px;border-radius:0 4px 4px 0;background:linear-gradient(var(--tx-amber),var(--tx-orange));box-shadow:0 0 12px var(--tx-orange)}
body .sidebar .nav-item-icon{display:inline-grid!important;place-items:center;width:22px;height:22px;flex:none;font-size:17px;margin:0!important}
body .sidebar .nav-item-icon svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
body .sidebar .nav-item.active .nav-item-icon{color:var(--tx-amber)}
body .sidebar-footer{border-top:1px solid rgba(255,255,255,.1)!important;background:transparent!important}
body .btn-logout{border-radius:12px!important;background:rgba(255,255,255,.08)!important;border:1px solid rgba(255,255,255,.14)!important;color:#fff!important;font-weight:700;transition:background .15s,border-color .15s}
body .btn-logout:hover{background:rgba(255,122,0,.25)!important;border-color:var(--tx-orange)!important}

/* ---------- modules masqués pour le moment (pour les remettre : supprimer la ligne) ---------- */
body .sidebar a[href^="suivi_chauffeurs.html"]{display:none!important}
body .btn-tracking{display:none!important}

/* ---------- zone principale ---------- */
body .top-bar{
  background:color-mix(in srgb,var(--tx-surface) 82%,transparent)!important;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  border-bottom:1px solid var(--tx-line)!important;box-shadow:none!important;
}
body .page-title{font-family:var(--tx-disp)!important;font-style:italic;font-weight:800!important;letter-spacing:-.01em;color:var(--tx-fg)!important}
body .btn-icon{border-radius:12px!important;border:1px solid var(--tx-line)!important;background:var(--tx-surface)!important;transition:border-color .15s,box-shadow .15s}
body .btn-icon:hover{border-color:var(--tx-blue)!important;box-shadow:var(--tx-glow)}

/* cartes */
body .card,body .table-card,body .stat-card,body .form-card,body .stats-summary,body .filters-card,body .section-card,body .summary-card{
  border-radius:20px!important;border:1px solid var(--tx-line)!important;box-shadow:var(--tx-shadow)!important;background:var(--tx-surface);
}
body .stat-card{position:relative;overflow:hidden;transition:transform .15s,box-shadow .2s,border-color .2s}
body .stat-card:hover{transform:translateY(-4px);border-color:var(--tx-blue)!important;box-shadow:var(--tx-glow)!important}
body .stat-card::after{content:"";position:absolute;right:-30px;top:-30px;width:110px;height:110px;border-radius:50%;background:var(--tx-blue);opacity:.10;filter:blur(8px);pointer-events:none}
body .stat-card:nth-child(even)::after{background:var(--tx-orange)}
body .stat-value{font-family:var(--tx-disp)!important;font-style:italic;font-weight:800!important}
body .section-title,body .card-title{font-family:var(--tx-disp);font-style:italic;font-weight:800}
body .stat-pill{border-radius:99px!important;border:1px solid var(--tx-line);box-shadow:var(--tx-shadow)}

/* boutons : action principale = orange, secondaire = bleu/blanc */
body .btn-primary,body .btn-add,body .modal-btn-primary,body .btn-save,body .btn-create,body .btn-submit,body .btn-login,body button[type="submit"].btn{
  background:linear-gradient(135deg,var(--tx-orange),var(--tx-amber))!important;color:#fff!important;border:0!important;
  border-radius:12px!important;font-weight:800!important;box-shadow:0 6px 18px rgba(255,122,0,.40);transition:transform .12s,box-shadow .15s,filter .15s;
}
body .btn-primary:hover,body .btn-add:hover,body .modal-btn-primary:hover,body .btn-save:hover,body .btn-create:hover,body .btn-submit:hover,body .btn-login:hover{
  transform:translateY(-2px);box-shadow:0 10px 26px rgba(255,122,0,.55);filter:brightness(1.05)
}
body .btn-save:disabled,body .btn-primary:disabled{opacity:.5;box-shadow:none;transform:none}
body .btn-edit,body .btn-view,body .btn-action:not(.btn-print){border-radius:10px!important;transition:transform .12s,box-shadow .15s}
body .btn-edit:hover,body .btn-view:hover,body .btn-action:hover{transform:translateY(-1px);box-shadow:var(--tx-shadow)}
body .btn-back,body .modal-btn-cancel{border-radius:12px!important}
body .btn-hdr{border-radius:11px!important;font-weight:700!important}

/* formulaires */
body input[type="text"],body input[type="email"],body input[type="tel"],body input[type="number"],body input[type="date"],body input[type="password"],
body input[type="search"],body input[type="time"],body input[type="datetime-local"],body input[type="url"],body select,body textarea,
body .f-input,body .f-select,body .f-textarea,body .form-input,body .search-input,body .form-control{
  border-radius:12px!important;border:1px solid var(--tx-line)!important;background-color:var(--tx-surface2);transition:border-color .15s,box-shadow .15s,background .15s;
}
body input:focus,body select:focus,body textarea:focus,body .f-input:focus,body .f-select:focus,body .f-textarea:focus,body .form-input:focus,body .search-input:focus{
  border-color:var(--tx-blue)!important;box-shadow:0 0 0 3px rgba(31,107,255,.22)!important;background-color:var(--tx-surface);outline:0
}
body .form-label,body .f-label{font-weight:700!important;color:var(--tx-fg)}
body .f-label.req::after,body .form-label.required::after{color:var(--tx-orange)!important}

/* tableaux */
body table{border-collapse:collapse}
body th{font-size:11.5px!important;letter-spacing:.08em;text-transform:uppercase;font-weight:800!important;color:var(--tx-muted)!important;background:var(--tx-surface2)!important}
body tbody tr{transition:background .12s,box-shadow .12s}
body tbody tr:hover{background:var(--tx-surface2)!important;box-shadow:inset 3px 0 0 var(--tx-orange)}
body .status-badge,body .type-badge{border-radius:99px!important;font-weight:800!important}

/* onglets */
body .tab-btn{font-weight:800!important;transition:color .15s,background .15s}
body .tab-btn:hover{color:var(--tx-blue)!important}
body .tab-btn.active{color:var(--tx-blue)!important;border-bottom-color:var(--tx-orange)!important}

/* fenêtres (modales) */
body .modal-overlay,body .modal-overlay-confirm,body .overlay{backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}
body .modal,body .modal-confirm,body .modal-content{border-radius:22px!important;box-shadow:0 30px 80px rgba(3,8,20,.45)!important;border:1px solid var(--tx-line)}
body .toast{border-radius:14px!important;box-shadow:0 12px 34px rgba(3,8,20,.35)!important;font-weight:700}
body .empty-state-icon{opacity:.55}

/* ---------- pages "éditeur" (en-tête sombre : nouvel OT, devis, facture…) ---------- */
body .hdr,body .header{
  background:
    radial-gradient(60% 200% at 100% 0%,rgba(255,122,0,.32),transparent 60%),
    radial-gradient(60% 200% at 0% 0%,rgba(31,107,255,.45),transparent 60%),
    var(--tx-navy)!important;
  box-shadow:0 4px 24px rgba(3,8,20,.4)!important;border-bottom:1px solid rgba(255,255,255,.08);
}
body .hdr-title,body .header-title{font-family:var(--tx-disp);font-style:italic;font-weight:800!important}
body .hdr-left img{height:38px!important;border-radius:8px;mix-blend-mode:screen}

/* ---------- connexion ---------- */
body .login-container{border-radius:26px!important;box-shadow:0 30px 90px rgba(3,8,20,.6),0 0 60px rgba(31,107,255,.25)!important}
body .login-container .logo{background:radial-gradient(90% 90% at 50% 0%,rgba(31,107,255,.35),transparent),var(--tx-navy)!important}
body .form-title{font-family:var(--tx-disp);font-style:italic}

/* ---------- burger + fond (tablette / téléphone) ---------- */
.tx-burger{display:none;position:fixed;top:calc(10px + env(safe-area-inset-top,0px));left:12px;z-index:1200;width:44px;height:44px;border-radius:14px;border:1px solid rgba(255,255,255,.25);
  background:linear-gradient(135deg,var(--tx-navy2),var(--tx-navy));box-shadow:0 6px 18px rgba(3,8,20,.4);cursor:pointer;place-items:center;padding:0}
.tx-burger svg{width:22px;height:22px;stroke:#fff;fill:none;stroke-width:2.2;stroke-linecap:round}
.tx-scrim{position:fixed;inset:0;background:rgba(3,8,20,.62);backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);z-index:1090;opacity:0;pointer-events:none;transition:opacity .25s}

/* ---------- TABLETTE (≤ 1024 px) ---------- */
@media (max-width:1024px){
  body .sidebar{transform:translateX(-105%)!important;transition:transform .28s cubic-bezier(.2,.8,.2,1)!important;z-index:1100!important;width:min(300px,86vw)!important;padding-top:env(safe-area-inset-top,0px)}
  body.tx-open .sidebar{transform:none!important}
  body.tx-open .tx-scrim{opacity:1;pointer-events:auto}
  body.tx-open{overflow:hidden}
  body .main-content{margin-left:0!important;width:100%!important;max-width:100%!important}
  .tx-burger{display:grid}
  body .top-bar{padding-left:72px!important;padding-right:14px!important;min-height:64px}
  body .container{padding:16px!important}
  body .btn-menu{display:none!important}
  body .two-cols{grid-template-columns:1fr!important}
}

/* ---------- TÉLÉPHONE (≤ 700 px) ---------- */
@media (max-width:700px){
  body{font-size:15px}
  body .top-bar{flex-wrap:wrap;gap:8px}
  body .page-title{font-size:20px!important}
  body .container{padding:12px!important}
  body .stats-grid,body .form-grid,body .form-grid-3,body .form-row,body .modal-row,body .detail-grid,body .annual-summary,body .permissions-grid,body .plan-cards,body .preview-grid,body .resultat-cols,body .three-cols,body .two-cols,body .tva-grid,body .split-row,
  body .grid-2,body .grid-3,body .g2,body .g3,body .g4,body .g5,body .g2-3,body .two-col,body .row{grid-template-columns:1fr!important}
  body .kpi-grid,body .stats-bar,body .watch-grid,body .tt-grid-mini{grid-template-columns:repeat(2,1fr)!important}
  body .split-arrow{transform:rotate(90deg);justify-self:center}
  body .stats-summary{flex-wrap:wrap}
  body .table-card,body .table-wrapper,body .table-container{overflow-x:auto!important;-webkit-overflow-scrolling:touch}
  body .table-card table,body .table-wrapper table{min-width:640px}
  body input,body select,body textarea{font-size:16px!important}               /* évite le zoom automatique sur iPhone */
  body .btn,body button,body .btn-primary,body .btn-add{min-height:42px}
  body .modal,body .modal-confirm,body .modal-content{width:calc(100vw - 20px)!important;max-width:calc(100vw - 20px)!important;max-height:92vh;overflow-y:auto;border-radius:18px!important}
  body .search-bar,body .filters,body .filter-row,body .actions-bar,body .toolbar,body .form-actions,body .modal-actions{flex-wrap:wrap!important;gap:8px}
  body .search-bar>*,body .filters>*{min-width:0}
  body .search-input{min-width:0!important;width:100%!important}
  /* pages éditeur (nouvel OT, devis…) : on libère le défilement */
  body:not(:has(.sidebar)){height:auto!important;min-height:100vh;overflow:auto!important}
  body .hdr,body .header{height:auto!important;min-height:54px;flex-wrap:wrap;gap:8px;padding:8px 12px!important}
  body .hdr-right,body .header-actions{flex-wrap:wrap;gap:6px}
  body .main-wrap,body .page{height:auto!important;overflow:visible!important}
  body .tab-bar{overflow-x:auto;white-space:nowrap;-webkit-overflow-scrolling:touch}
  body .tab-btn{flex:none}
}


/* ---------- correction : tableaux coupés à droite (grands écrans) ---------- */
@media (min-width:701px){
  body .table-card,body .table-wrapper{overflow-x:auto}
  body .table-wrapper table{min-width:0!important}
  body .actions-cell{white-space:normal!important;min-width:170px;max-width:300px}
  body .order-number{white-space:nowrap}
  body .btn-action{margin:2px!important}
}
body .main-content{min-width:0;max-width:100%}

/* ---------- MODE SOMBRE (par défaut, interrupteur dans le menu) ----------
   Principe : la page est inversée par le navigateur, puis les éléments qui doivent garder
   leurs vraies couleurs (logo, menu, photos, cartes, boutons colorés) sont ré-inversés.
   Les valeurs ci-dessous sont « pré-inversées » pour afficher exactement la palette de la maquette. */
html.tx-dark{
  --tx-bg:#f0f5ff; --tx-surface:#e1eaff; --tx-surface2:#d6e2ff; --tx-line:#c3d4ff; --tx-fg:#070c18; --tx-muted:#495d8e;
  --tx-shadow:0 1px 2px rgba(255,255,255,.04),0 10px 28px rgba(255,255,255,.05);
  filter:invert(1) hue-rotate(180deg);background:var(--tx-bg);color-scheme:dark;
}
html.tx-dark body{background:var(--tx-bg)!important}
html.tx-dark body :is(.search-bar,.stat-pill,.modal,.modal-confirm,.modal-content,.form-card,.table-card,.top-bar,.card,.stat-card,.filters-card,.section-card,.summary-card,.stats-summary,.main-wrap,.page){background-color:var(--tx-surface)!important}
html.tx-dark :is(img,video,iframe,canvas,.gm-style,.leaflet-container,.tx-scrim,.tx-burger,.sidebar,.hdr,.header,.btn-action):not(.sidebar *):not(.hdr *):not(.header *):not(.tx-page .hdr){
  filter:invert(1) hue-rotate(180deg)
}
/* boutons principaux : orange pré-inversé pour s'afficher en vrai orange */
html.tx-dark body :is(.btn-primary,.btn-add,.modal-btn-primary,.btn-save,.btn-create,.btn-submit,.btn-login):not(.sidebar *){
  background:linear-gradient(135deg,#f36300,#cc5a00)!important;color:#000!important;box-shadow:0 6px 18px rgba(0,120,255,.35)!important
}
html.tx-dark body :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=range]){background-color:var(--tx-surface2)!important}
html.tx-dark .tx-surf{background-color:var(--tx-surface)!important}
@media print{html.tx-dark{filter:none!important}html.tx-dark :is(img,video,iframe,canvas,.sidebar,.hdr,.header,.btn-action,.status-badge){filter:none!important}}

/* interrupteur clair / sombre (dans le menu) */
.tx-mode{display:flex;align-items:center;justify-content:center;gap:8px;width:calc(100% - 0px);margin:0 0 10px;padding:9px 12px;border-radius:12px;border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.08);color:#fff;font-weight:700;font-size:13px;cursor:pointer;transition:background .15s,border-color .15s}
.tx-mode:hover{background:rgba(31,107,255,.35);border-color:var(--tx-blue)}


/* ---------- pages de saisie (Nouvel OT, devis…) : plus grand, lisible, qui remplit toute la page ---------- */
body .g2,body .g-2{grid-template-columns:repeat(2,minmax(0,1fr))}
body .g3{grid-template-columns:repeat(3,minmax(0,1fr))}
body .g4{grid-template-columns:repeat(4,minmax(0,1fr))}
body .g5{grid-template-columns:repeat(5,minmax(0,1fr))}
body .g2-3{grid-template-columns:minmax(0,2fr) minmax(0,3fr)}
body .split-row{grid-template-columns:minmax(0,1fr) 44px minmax(0,1fr)}
body .f-group,body .split-col{min-width:0}
body .f-input,body .f-select,body .f-textarea{min-width:0;max-width:100%}
body .main-wrap,body .form-card,body #orderForm{min-width:0;max-width:100%}
@media (min-width:1025px){
  body .hdr{height:68px!important;padding:0 28px!important}
  body .hdr-title{font-size:21px!important}
  body .hdr-sub{font-size:13px!important}
  body .hdr-left img{height:44px!important}
  body .btn-hdr{font-size:15px!important;padding:11px 20px!important}
  body .tab-bar{padding:0 28px!important}
  body .tab-btn{font-size:16px!important;padding:16px 28px!important}
  body .tab-pane{padding:26px 32px 32px!important}
  body .tab-pane.active{gap:20px!important}
  body .f-label{font-size:14px!important;margin-bottom:6px!important}
  body .f-input,body .f-select,body .f-textarea{font-size:16px!important;padding:13px 16px!important;border-width:1.5px!important}
  body .f-textarea{min-height:90px!important}
  body .g2,body .g3,body .g4,body .g5,body .g2-3{gap:18px!important}
  body .split-row{gap:18px!important}
  body .split-col{gap:14px!important}
  body .split-arrow{font-size:28px!important;padding-top:32px!important}
  body .split-title{font-size:14px!important;padding:12px 16px!important;border-radius:12px!important}
  body .sec-hdr{font-size:14px!important;padding-bottom:8px!important}
  body .pal-row{font-size:14px!important;padding:11px 14px!important;gap:10px!important;border-radius:12px!important}
  body .pal-badge{font-size:12px!important;padding:3px 8px!important}
  body .pal-row input[type="number"]{width:78px!important;padding:7px 8px!important;font-size:15px!important}
  body .ac-item{font-size:15px!important;padding:11px 14px!important}
  body .ss-item{font-size:15px!important;padding:12px 14px!important}
  body .ss-item .ss-sub,body .ac-item .ac-cp{font-size:13px!important}
  body .fuel-row{padding:12px 16px!important;border-radius:12px!important}
  body .fuel-label{font-size:14px!important}
  body .fuel-chip{font-size:13px!important;padding:7px 12px!important}
  body .adr-check label{font-size:15px!important}
  body .adr-check input{width:20px!important;height:20px!important}
  body .adr-box,body .vrac-box,body .container-box{padding:16px 18px!important;border-radius:14px!important}
  body .vrac-total-chip{font-size:17px!important;padding:10px 16px!important}
  body .ref-col{padding:14px 16px!important;border-radius:12px!important}
  body .doc-dropzone{font-size:15px!important;padding:28px!important}
  body .goods-sel-info{font-size:13px!important}
}


/* ---------- base du menu latéral (pour les pages qui n'ont pas leur propre style de menu) ---------- */
body .sidebar{position:fixed;left:0;top:0;width:280px;height:100vh;overflow-y:auto;display:flex;flex-direction:column;z-index:1000}
body .sidebar-nav{flex:1}
body .sidebar-footer{padding:14px 16px}
body .btn-logout{width:100%;padding:11px;cursor:pointer;font-size:14px}
body .main-content.tx-page{margin-left:280px}

/* ==========================================================================
   PAGE « NOUVEL ORDRE DE TRANSPORT » — même présentation que la maquette
   ========================================================================== */
/* fenêtres inutilisées de l'ancienne page (non reliées à des boutons) : masquées */
body:has(.tx-page) .modal-overlay{display:none}
body:has(.tx-page){display:block!important;height:auto!important;min-height:100vh;overflow:auto!important;background:var(--tx-bg)!important}
.tx-page{padding:0 32px 48px}
.tx-page .hdr{background:transparent!important;box-shadow:none!important;border:0!important;height:auto!important;padding:26px 0 16px!important;align-items:flex-end;flex-wrap:wrap;gap:14px}
.tx-page .hdr-left img{display:none!important}
.tx-page .hdr-title{font-size:32px!important;color:var(--tx-fg)!important;line-height:1.15}
.tx-page .hdr-sub{font-size:15px!important;color:var(--tx-muted)!important;margin-top:4px!important}
.tx-page .hdr-right{gap:10px}
.tx-page .btn-hdr{height:46px;padding:0 22px!important;font-size:15px!important;border-radius:13px!important}
.tx-page .btn-back{background:var(--tx-surface)!important;color:var(--tx-fg)!important;border:1px solid var(--tx-line)!important}
.tx-page .btn-back:hover{border-color:var(--tx-blue)!important}
.tx-page .alert-bar{border-radius:12px;margin-bottom:12px}
.tx-page .main-wrap{display:grid!important;grid-template-columns:minmax(0,1fr) 320px;gap:18px;align-items:start;overflow:visible!important;padding:0!important}
.tx-page .form-card{background:transparent!important;border:0!important;box-shadow:none!important;overflow:visible!important;display:block!important;border-radius:0!important}
.tx-page #orderForm{display:block!important;overflow:visible!important}
html.tx-dark body .tx-page .main-wrap,html.tx-dark body .tx-page .form-card{background:transparent!important}
@media (min-width:1025px) and (max-width:1699px){.tx-page .g5{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
/* onglet actif en mode sombre : bleu pré-inversé */
html.tx-dark body .tx-page .tab-btn.active{background:linear-gradient(135deg,#3693ff,#72b4ff)!important;color:#000!important;box-shadow:0 8px 22px rgba(255,140,0,.35)!important}
html.tx-dark body .tab-btn.active .tx-num{color:#000}
/* onglets numérotés */
.tx-page .tab-bar{background:transparent!important;border:0!important;padding:0!important;gap:10px!important;margin-bottom:16px;flex-wrap:wrap}
.tx-page .tab-btn{display:inline-flex;align-items:center;gap:10px;border:1px solid var(--tx-line)!important;background:var(--tx-surface)!important;color:var(--tx-muted)!important;
  border-radius:15px!important;padding:12px 20px!important;font-size:16px!important;font-weight:800!important;margin:0!important;transition:all .15s}
.tx-page .tab-btn:hover{border-color:var(--tx-blue)!important;color:var(--tx-fg)!important}
.tx-page .tab-btn.active{background:linear-gradient(135deg,var(--tx-blue),var(--tx-blue2))!important;color:#fff!important;border-color:transparent!important;box-shadow:0 8px 22px rgba(31,107,255,.45)}
.tx-num{width:28px;height:28px;border-radius:50%;background:var(--tx-surface2);color:var(--tx-fg);display:inline-grid;place-items:center;font-family:var(--tx-disp);font-style:italic;font-size:14px}
.tab-btn.active .tx-num{background:linear-gradient(135deg,var(--tx-orange),var(--tx-amber));color:#fff}
/* cartes */
.tx-page .tab-pane{padding:0!important;overflow:visible!important}
.tx-page .tab-pane.active{gap:18px!important}
.tx-card,.tx-page .split-col,.tx-page .doc-section.show,.tx-page #documentsSection{background:var(--tx-surface);border:1px solid var(--tx-line);border-radius:20px;box-shadow:var(--tx-shadow);padding:22px 24px}
.tx-card{display:flex;flex-direction:column;gap:16px}
.tx-card-title{font-family:var(--tx-disp);font-style:italic;font-size:19px;font-weight:800;color:var(--tx-fg);display:flex;align-items:center;gap:10px}
.tx-page .split-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:18px!important}
.tx-page .split-arrow{display:none!important}
.tx-page .split-title{background:transparent!important;border:0!important;padding:0!important;margin:0 0 2px!important;font-family:var(--tx-disp);font-style:italic;font-size:19px!important;font-weight:800;text-transform:none!important;letter-spacing:0!important;color:var(--tx-fg)!important;display:flex;align-items:center;gap:10px}
.tx-page .split-title::before{content:"";width:15px;height:15px;border-radius:50%;flex:none}
.tx-page .split-title.charg::before{background:linear-gradient(135deg,var(--tx-blue),#5aa0ff)}
.tx-page .split-title.livr::before{background:linear-gradient(135deg,var(--tx-orange),var(--tx-amber))}
.tx-page .container-box,.tx-page .vrac-box,.tx-page .adr-box,.tx-page .fuel-row{border-radius:16px!important}
/* résumé à droite */
.tx-sum{position:sticky;top:18px;background:var(--tx-surface);border:1px solid var(--tx-line);border-radius:20px;box-shadow:var(--tx-shadow);padding:22px;display:flex;flex-direction:column;gap:10px}
.tx-sum h3{font-family:var(--tx-disp);font-style:italic;font-size:19px;font-weight:800}
.tx-rt{display:flex;align-items:center;gap:10px;background:var(--tx-surface2);border-radius:15px;padding:13px 14px}
.tx-rt div{flex:1;min-width:0}.tx-rt small{display:block;color:var(--tx-muted);font-size:13px}
.tx-rt b{font-family:var(--tx-disp);font-style:italic;font-size:18px;word-break:break-word}
.tx-rt svg{width:22px;height:22px;stroke:var(--tx-orange);fill:none;stroke-width:2.4;flex:none}
.tx-kv{display:flex;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid var(--tx-line);font-size:15px}
.tx-kv span:first-child{color:var(--tx-muted)}.tx-kv b{text-align:right;min-width:0;word-break:break-word}
.tx-mg{display:flex;align-items:center;gap:10px;padding:14px;border-radius:15px;background:linear-gradient(135deg,rgba(31,107,255,.18),rgba(255,122,0,.18))}
.tx-mg small{color:var(--tx-muted);flex:1;font-size:14px}.tx-mg b{font-family:var(--tx-disp);font-style:italic;font-size:24px}
.tx-mgp{font-size:12.5px;font-weight:800;padding:3px 10px;border-radius:99px;background:#dcf6e8;color:#0e9f55}
.tx-mgp.warn{background:#ffecd0;color:#b45f00}.tx-mgp.bad{background:#fde4e8;color:#d6334a}
.tx-bar{height:8px;border-radius:9px;background:var(--tx-line);overflow:hidden}
.tx-bar i{display:block;height:100%;border-radius:9px;background:linear-gradient(90deg,var(--tx-blue),var(--tx-orange));transition:width .3s}
.tx-sum small.tx-pct{color:var(--tx-muted);font-size:13.5px}
@media (max-width:1280px){.tx-page .main-wrap{grid-template-columns:minmax(0,1fr)}.tx-sum{display:none}}
@media (max-width:1024px){.tx-page{padding:0 16px 40px}.tx-page .hdr{padding-left:62px!important}.tx-page .split-row{grid-template-columns:minmax(0,1fr)!important}}
@media (max-width:700px){.tx-page .hdr-title{font-size:24px!important}.tx-page .tab-btn{padding:10px 14px!important;font-size:14px!important}.tx-card,.tx-page .split-col{padding:16px}}
@media (max-width:1280px) and (min-width:1025px){.tx-page .g5{grid-template-columns:repeat(3,minmax(0,1fr))!important}}


/* ==========================================================================
   LISTE DES ORDRES : plus de petits boutons — un clic sur la ligne ouvre la fiche d'actions (option C)
   ========================================================================== */
:root{--c-or:#ff7a00;--c-am:#ffb020;--c-bl:#1f6bff;--c-bd:#d6334a;--tx-scrimc:rgba(3,8,20,.62)}
html.tx-dark{--c-or:#f36300;--c-am:#cc5a00;--c-bl:#3693ff;--c-bd:#ff364e;--tx-scrimc:rgba(245,249,255,.7)}
body.tx-ordlist .actions-cell > *{display:none!important}
body.tx-ordlist .actions-cell::before{content:"Ouvrir";display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:99px;font-weight:800;font-size:13px;background:var(--tx-surface2);border:1px solid var(--tx-line);color:var(--tx-fg);white-space:nowrap}
body.tx-ordlist .actions-cell::after{content:" ›";color:var(--c-or);font-weight:800}
body.tx-ordlist tbody tr{cursor:pointer}
body.tx-ordlist tbody tr:hover .actions-cell::before{border-color:var(--c-bl)}
body.tx-ordlist .actions-cell{min-width:0!important;white-space:nowrap!important}
.txd-ov{position:fixed;inset:0;background:var(--tx-scrimc);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);opacity:0;pointer-events:none;transition:opacity .2s;z-index:2000}
.txd-ov.on{opacity:1;pointer-events:auto}
.txd{position:fixed;top:0;right:0;bottom:0;width:min(500px,100%);background:var(--tx-surface);border-left:1px solid var(--tx-line);z-index:2001;transform:translateX(102%);transition:transform .3s cubic-bezier(.2,.8,.2,1);padding:24px;overflow-y:auto;display:flex;flex-direction:column;gap:12px;box-shadow:-20px 0 60px rgba(0,0,0,.45);padding-bottom:calc(24px + env(safe-area-inset-bottom,0px))}
.txd.on{transform:none}
.txd-h{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.txd-h h2{font-family:var(--tx-disp);font-style:italic;font-size:26px;font-weight:800;color:var(--tx-fg)}
.txd-m{color:var(--tx-muted);font-size:14px;margin-top:2px}
.txd-x{width:42px;height:42px;border-radius:13px;border:1px solid var(--tx-line);background:var(--tx-surface2);color:var(--tx-fg);font-size:22px;line-height:1;cursor:pointer;flex:none}
.txd-x:hover{border-color:var(--c-bl)}
.txd-g{font-size:11.5px;text-transform:uppercase;letter-spacing:.12em;color:var(--tx-muted);font-weight:800;margin-top:8px}
.txd-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.txd-b{display:flex;align-items:center;gap:12px;padding:13px;border-radius:15px;border:1px solid var(--tx-line);background:var(--tx-surface2);color:var(--tx-fg);text-align:left;font-family:inherit;font-weight:800;font-size:14.5px;cursor:pointer;transition:transform .12s,border-color .15s,box-shadow .15s;min-height:56px}
.txd-b:hover{border-color:var(--c-bl);transform:translateY(-2px);box-shadow:var(--tx-shadow)}
.txd-b svg{width:20px;height:20px;stroke:var(--c-bl);fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;flex:none}
.txd-b.f svg{stroke:var(--c-or)}
.txd-b.d{border-color:color-mix(in srgb,var(--c-bd) 45%,var(--tx-line));grid-column:1/-1}
.txd-b.d svg,.txd-b.d{color:var(--c-bd);stroke:var(--c-bd)}
@media (max-width:520px){.txd-grid{grid-template-columns:1fr}.txd{padding:18px}}


/* ==========================================================================
   FENÊTRES (modales) — nouveau style : lisible, gros champs, gros choix d'envoi
   ========================================================================== */
:root{--route-bg:#0a1a45;--route-fg:#fff;--route-chip:rgba(255,255,255,.12);--g-red:linear-gradient(135deg,#d6334a,#ff7088);--g-or:linear-gradient(135deg,#ff7a00,#ffb020);--g-bl:linear-gradient(135deg,#1f6bff,#5aa0ff)}
html.tx-dark{--route-bg:#ceddff;--route-fg:#000;--route-chip:rgba(0,0,0,.12);--g-red:linear-gradient(135deg,#ff364e,#ff6d82);--g-or:linear-gradient(135deg,#f36300,#cc5a00);--g-bl:linear-gradient(135deg,#3693ff,#72b4ff)}
body .modal-overlay,body .modal-docs-overlay,body .overlay,body .modal-overlay-confirm{background:var(--tx-scrimc)!important;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);padding:16px}
body .modal,body .modal-docs,body .modal-box,body .modal-confirm,body .modal-content{
  background:var(--tx-surface)!important;color:var(--tx-fg)!important;border:1px solid var(--tx-line)!important;border-radius:24px!important;
  box-shadow:0 30px 80px rgba(0,0,0,.5)!important;max-width:640px!important;width:100%;max-height:calc(100vh - 32px);overflow-y:auto;padding:26px 28px!important;position:relative}
body .modal-docs{max-width:760px!important}
body .modal h2,body .modal-docs-title,body .modal-box h2,body .modal-confirm h2{font-family:var(--tx-disp)!important;font-style:italic;font-size:24px!important;font-weight:800;color:var(--tx-fg)!important;line-height:1.2;display:flex;align-items:center;gap:14px;margin-bottom:8px!important;padding-right:52px}
.tx-mi{width:50px;height:50px;border-radius:16px;background:var(--g-bl);display:inline-grid;place-items:center;flex:none;box-shadow:0 8px 20px rgba(31,107,255,.35)}
.tx-mi svg{width:26px;height:26px;stroke:#fff;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
html.tx-dark .tx-mi svg{stroke:#000}
.tx-mi.red{background:var(--g-red)}.tx-mi.or{background:var(--g-or)}
body .modal .modal-subtitle,body .modal-docs-subtitle,body .modal .modal-sub{display:inline-block;align-self:flex-start;font-family:var(--tx-disp);font-weight:800!important;font-size:13px!important;letter-spacing:.04em;padding:2px 12px;border-radius:99px;background:var(--tx-surface2);border:1px solid var(--tx-line);color:var(--tx-fg)!important;margin:0 0 18px!important}
body .modal-btn-close,body .modal-docs-close,body .modal-close{position:absolute!important;top:20px!important;right:20px!important;width:42px;height:42px;border-radius:13px!important;border:1px solid var(--tx-line)!important;background:var(--tx-surface2)!important;color:var(--tx-fg)!important;font-size:22px!important;line-height:1;display:grid;place-items:center;padding:0!important;cursor:pointer}
body .modal-btn-close:hover,body .modal-docs-close:hover,body .modal-close:hover{border-color:var(--c-bl)!important}
body .modal label,body .confirm-input-row label{display:block;font-size:15px!important;font-weight:800!important;color:var(--tx-fg)!important;margin:16px 0 6px!important}
body .modal input:not([type=checkbox]):not([type=radio]):not([type=file]),body .modal select,body .modal textarea,body .confirm-input-row input{
  width:100%;height:54px;border-radius:14px!important;border:2px solid var(--tx-line)!important;background:var(--tx-surface2)!important;color:var(--tx-fg)!important;padding:0 16px!important;font-size:17px!important;font-weight:700;outline:0}
body .modal textarea{height:auto;min-height:100px;padding:12px 16px!important}
body .modal input::placeholder,body .modal textarea::placeholder{color:var(--tx-muted)!important;font-weight:500}
body .modal input:focus,body .modal select:focus,body .modal textarea:focus,body .confirm-input-row input:focus{border-color:var(--c-bl)!important;box-shadow:0 0 0 4px rgba(31,107,255,.22)!important}
body .modal-actions{display:flex;gap:12px;margin-top:24px!important;justify-content:flex-end;flex-wrap:wrap}
body .modal-btn{min-height:50px;padding:0 24px!important;border-radius:14px!important;font-size:15px!important;font-weight:800!important}
body .modal-btn-cancel{background:var(--tx-surface2)!important;color:var(--tx-fg)!important;border:1px solid var(--tx-line)!important}
body .modal-btn-cancel:hover{border-color:var(--c-bl)!important}
/* bandeau du trajet */
body .confirm-summary,body .driver-summary{background:var(--route-bg)!important;color:var(--route-fg)!important;border:0!important;border-radius:18px!important;padding:18px 20px!important;margin:6px 0 4px!important}
body .confirm-summary .route,body .driver-summary .route{font-family:var(--tx-disp)!important;font-style:italic;font-weight:800;font-size:26px!important;color:var(--route-fg)!important;display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:10px}
body .confirm-summary .route .arrow{color:var(--c-or)!important;font-weight:800}
body .confirm-summary .detail,body .driver-summary .detail{display:inline-block;background:var(--route-chip);color:var(--route-fg)!important;border-radius:12px;padding:6px 12px;font-size:14px!important;font-weight:700;margin:4px 8px 0 0!important}
/* gros choix d'envoi */
body .confirm-actions-grid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px!important;margin-top:22px!important}
body .confirm-action-btn{display:flex!important;flex-direction:column;align-items:center;gap:10px;text-align:center;padding:16px 10px!important;border-radius:18px!important;border:2px solid var(--tx-line)!important;background:var(--tx-surface2)!important;color:var(--tx-fg)!important;font-weight:800;text-decoration:none;cursor:pointer;transition:transform .12s,border-color .15s,box-shadow .15s}
body .confirm-action-btn:hover{transform:translateY(-3px);border-color:var(--c-bl)!important;box-shadow:0 10px 24px rgba(31,107,255,.25)!important;background:var(--tx-surface2)!important}
body .confirm-action-btn .label{font-size:15px!important;font-weight:800!important;color:var(--tx-fg)!important}
body .confirm-action-btn .icon{font-size:0!important;width:50px;height:50px;border-radius:16px;background-color:transparent;background-repeat:no-repeat;background-position:center;background-size:26px;margin:0!important;display:block}
body .confirm-action-btn.ca-pdf .icon{background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23fff%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M6 3h9l4 4v14H6z%22/%3E%3Cpath d=%22M14 3v5h5M9 14h6M9 17h4%22/%3E%3C/svg%3E") center/26px no-repeat,var(--g-red)}
html.tx-dark body .confirm-action-btn.ca-pdf .icon{background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M6 3h9l4 4v14H6z%22/%3E%3Cpath d=%22M14 3v5h5M9 14h6M9 17h4%22/%3E%3C/svg%3E") center/26px no-repeat,var(--g-red)}
body .confirm-action-btn.ca-mail .icon{background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23fff%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%223%22 y=%225%22 width=%2218%22 height=%2214%22 rx=%222%22/%3E%3Cpath d=%22m3 7 9 6 9-6%22/%3E%3C/svg%3E") center/26px no-repeat,var(--g-or)}
html.tx-dark body .confirm-action-btn.ca-mail .icon{background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%223%22 y=%225%22 width=%2218%22 height=%2214%22 rx=%222%22/%3E%3Cpath d=%22m3 7 9 6 9-6%22/%3E%3C/svg%3E") center/26px no-repeat,var(--g-or)}
body .confirm-action-btn.ca-sms .icon{background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23fff%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%227%22 y=%222%22 width=%2210%22 height=%2220%22 rx=%222.5%22/%3E%3Cpath d=%22M11 18h2%22/%3E%3C/svg%3E") center/26px no-repeat,var(--g-bl)}
html.tx-dark body .confirm-action-btn.ca-sms .icon{background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%227%22 y=%222%22 width=%2210%22 height=%2220%22 rx=%222.5%22/%3E%3Cpath d=%22M11 18h2%22/%3E%3C/svg%3E") center/26px no-repeat,var(--g-bl)}
body .confirm-action-btn.ca-send .icon{background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23fff%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M22 2 11 13M22 2l-7 20-4-9-9-4z%22/%3E%3C/svg%3E") center/26px no-repeat,var(--g-or)}
html.tx-dark body .confirm-action-btn.ca-send .icon{background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M22 2 11 13M22 2l-7 20-4-9-9-4z%22/%3E%3C/svg%3E") center/26px no-repeat,var(--g-or)}
body .confirm-action-btn:not(.ca-pdf):not(.ca-mail):not(.ca-sms):not(.ca-send) .icon{background:var(--g-bl)}
body .confirm-action-btn.sending{opacity:.6;pointer-events:none}
/* choix d'un chauffeur, documents */
body .driver-card{border:2px solid var(--tx-line)!important;border-radius:16px!important;background:var(--tx-surface2)!important;color:var(--tx-fg)!important}
body .driver-card:hover,body .driver-card.selected{border-color:var(--c-bl)!important;background:var(--tx-surface2)!important}
body .driver-name{color:var(--tx-fg)!important}body .driver-vehicle{color:var(--tx-muted)!important}
body .modal-docs-header{border-bottom:1px solid var(--tx-line)!important;background:transparent!important}
body .doc-item{background:var(--tx-surface2)!important;border:1px solid var(--tx-line)!important;border-radius:14px!important}
body .doc-item:hover{border-color:var(--c-bl)!important}
@media (max-width:600px){body .modal,body .modal-docs,body .modal-box{padding:20px 18px!important}body .confirm-summary .route,body .driver-summary .route{font-size:22px!important}}

/* écrans très larges */
@media (min-width:1700px){body .container{max-width:1500px}}

/* impression : on garde un rendu propre */
@media print{.tx-burger,.tx-scrim{display:none!important}body .sidebar{display:none!important}body .main-content{margin-left:0!important}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
