/* PrestigeDrivers — Back Office
   Direction « Hybride » : cadre sombre (barre du haut, menu) + contenu ivoire.
   Les anciens noms de variables (--char, --ash, --fog, --silver…) sont conservés
   car ils sont utilisés dans les styles en ligne des vues : ils prennent ici
   un sens « clair » dans le contenu, et un sens « sombre » dans le cadre. */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}

/* ── Jetons de couleur ─────────────────────────────────────────────── */
:root{
  /* Contenu ivoire */
  --bg:#F7F3EA;          /* fond de page */
  --surface:#FFFFFF;     /* cartes */
  --surface-2:#FBF8F1;   /* zones secondaires, en-têtes de tableau */
  --border:#E6DFCF;
  --text:#1F1B14;
  --text-2:#5C5446;      /* texte secondaire (contraste 6,7:1 sur ivoire) */
  --or:#B8960C;          /* or de marque : fonds, bordures */
  --or-hover:#A5860A;
  --or-texte:#7A5F00;    /* or lisible pour du texte (5,5:1 sur ivoire) */
  --sur-or:#1F1B14;      /* texte posé sur l'or */
  --focus:rgba(184,150,12,.35);
  --ombre:0 1px 2px rgba(31,27,20,.06);
  --rayon:12px;
  /* Statuts (fond clair + texte foncé, tous ≥ 4,5:1) */
  --red-bg:#FDECEC;--red-tx:#A61B1B;
  --pur-bg:#F1EAFB;--pur-tx:#6B32B5;
  --blu-bg:#E6F1FB;--blu-tx:#1D5FA0;
  --grn-bg:#E7F5EC;--grn-tx:#1F7A45;
  --tea-bg:#E3F4F2;--tea-tx:#0F6E66;
  --gld-bg:#F6EED5;--gld-tx:#7A5F00;
  --emr-bg:#E2F3EA;--emr-tx:#17663C;
  --sla-bg:#ECEEF0;--sla-tx:#3D4752;
  --ora-bg:#FCEFE3;--ora-tx:#A04A0C;
  /* Cadre sombre */
  --cadre:#16140F;--cadre-2:#1F1C16;--cadre-bord:#2E2A21;
  --cadre-tx:#EDE6D6;--cadre-tx2:#A39A88;--cadre-actif:#2A2414;--cadre-or:#E2C25B;
  /* Anciens noms, sens « contenu clair » */
  --gold:var(--or-texte);--gold-l:var(--or);
  --noir:var(--text);--char:var(--surface);--smoke:var(--surface-2);--ash:var(--border);
  --silver:var(--text-2);--fog:var(--text);--white:var(--text);
  --green:var(--grn-tx);--red:var(--red-tx);--blue:var(--blu-tx);
}
/* Dans le cadre sombre, les anciens noms reprennent leur sens d'origine */
.bo-topbar,.bo-sidebar,.bo-mobile-menu,.bo-login-body{
  --gold:var(--cadre-or);--gold-l:var(--cadre-or);
  --char:var(--cadre);--smoke:var(--cadre-2);--ash:var(--cadre-bord);
  --silver:var(--cadre-tx2);--fog:var(--cadre-tx);--white:var(--cadre-tx);
  --red:#FCA5A5;--blue:#93C5FD;--green:#86EFAC;
}

/* ── Typographie ───────────────────────────────────────────────────── */
body.bo-body{font-family:'Inter',system-ui,-apple-system,'Segoe UI',Arial,sans-serif;background:var(--bg);color:var(--text);font-size:15px;line-height:1.5;font-variant-numeric:tabular-nums;-webkit-font-smoothing:antialiased}
.bo-main,.bo-sidebar,.bo-topbar,.bo-mobile-menu,.bo-modal,.bo-login-wrap{font-family:'Inter',system-ui,-apple-system,'Segoe UI',Arial,sans-serif}
.bo-main input,.bo-main select,.bo-main textarea,.bo-main button,.bo-modal input,.bo-modal select,.bo-modal textarea,.bo-modal button{font-family:inherit}
.bo-page-title,.bo-logo,.bo-login-logo,.bo-modal h3{font-family:'Cormorant Garamond',Georgia,serif}
a{color:var(--or-texte)}

/* ── Barre du haut (cadre sombre) ──────────────────────────────────── */
.bo-topbar{background:var(--cadre);border-bottom:1px solid var(--cadre-bord);padding:0 1.5rem;height:60px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:200;color:var(--cadre-tx)}
.bo-logo{font-size:1.5rem;font-weight:400;color:var(--cadre-or);text-decoration:none;display:flex;align-items:baseline;white-space:nowrap;line-height:1}
/* Logo : « Prestige » en Cormorant Garamond, « Drivers » en Jost italique (identité de marque, ne pas changer) */
.bo-logo em,.bo-login-logo em{font-family:'Jost',system-ui,sans-serif;font-style:italic;color:var(--cadre-tx)}
.bo-logo span{font-family:'Inter',sans-serif;font-size:.8rem;font-weight:500;color:var(--cadre-tx2);margin-left:.75rem}
.bo-topbar-right{display:flex;align-items:center;gap:1rem;font-size:.875rem}
.bo-user-info{display:flex;align-items:center;gap:.75rem}
.bo-role-badge{font-size:.75rem;font-weight:600;padding:.2rem .6rem;border-radius:20px;display:inline-block;white-space:nowrap}
.bo-role-super_admin{background:var(--cadre-actif);color:var(--cadre-or)}
.bo-role-gestionnaire{background:#18222E;color:#93C5FD}
.bo-username{color:var(--cadre-tx);font-size:.9rem;font-weight:500;white-space:nowrap}
.bo-logout{color:var(--cadre-tx);font-size:.85rem;font-weight:500;border:1px solid var(--cadre-bord);border-radius:10px;padding:.5rem .9rem;transition:all .2s;text-decoration:none}
.bo-logout:hover{border-color:#FCA5A5;color:#FCA5A5}
.bo-burger{display:none;flex-direction:column;justify-content:center;align-items:center;gap:5px;background:none;border:1px solid var(--cadre-bord);border-radius:10px;width:44px;height:44px;cursor:pointer}
.bo-burger span{display:block;width:18px;height:2px;background:var(--cadre-tx);border-radius:2px}

/* ── Menu mobile (tiroir) ──────────────────────────────────────────── */
.bo-mobile-menu{position:fixed;top:0;right:-300px;width:300px;max-width:85vw;height:100vh;height:100dvh;background:var(--cadre);border-left:1px solid var(--cadre-bord);z-index:300;transition:right .3s ease;display:flex;flex-direction:column}
.bo-mobile-menu:not(.open){visibility:hidden;transition:right .3s ease,visibility 0s .3s}
.bo-mobile-menu.open{right:0}
.bo-mobile-menu-inner{display:flex;flex-direction:column;height:100%;padding:1rem .75rem;overflow-y:auto}
.bo-mobile-close{background:none;border:1px solid var(--cadre-bord);border-radius:10px;color:var(--cadre-tx);font-size:1.1rem;cursor:pointer;align-self:flex-end;width:44px;height:44px;margin-bottom:.5rem}
.bo-mobile-user{padding:.5rem .75rem 1rem;border-bottom:1px solid var(--cadre-bord);margin-bottom:.5rem}
.bo-mobile-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:299}
.bo-mobile-overlay.open{display:block}

/* ── Mise en page + menu latéral (cadre sombre) ────────────────────── */
.bo-layout{display:grid;grid-template-columns:240px minmax(0,1fr);min-height:calc(100vh - 60px);background:linear-gradient(to right,var(--cadre) 240px,var(--bg) 240px)}
.bo-sidebar{background:var(--cadre);padding:1rem .75rem;position:sticky;top:60px;height:calc(100vh - 60px);overflow-y:auto}
.bo-nav-section{font-size:.75rem;font-weight:600;color:var(--cadre-tx2);padding:1rem .75rem .35rem;letter-spacing:.02em}
.bo-nav-item{display:flex;align-items:center;gap:.75rem;padding:.65rem .75rem;border-radius:10px;font-size:.95rem;font-weight:500;color:var(--cadre-tx);text-decoration:none;transition:background .15s}
.bo-nav-item:hover{background:var(--cadre-2)}
.bo-nav-item.active{background:var(--cadre-actif);color:var(--cadre-or);font-weight:600}
.bo-nav-icon{display:inline-flex;align-items:center;justify-content:center;width:20px;flex:none}
.bo-nav-icon svg{width:19px;height:19px}
.bo-main{padding:2rem 2.25rem 3rem;min-width:0;background:var(--bg)}

/* ── En-tête de page ───────────────────────────────────────────────── */
.bo-page-header{display:flex;justify-content:space-between;align-items:flex-end;gap:1rem;flex-wrap:wrap;margin-bottom:1.75rem}
.bo-page-title{font-size:2.25rem;font-weight:600;line-height:1.1;color:var(--text)}
.bo-page-title.bo-titre-ref{font-family:'Inter',system-ui,sans-serif;font-weight:700;font-size:1.9rem;letter-spacing:.01em;font-variant-numeric:tabular-nums lining-nums}
.bo-page-sub{font-size:.95rem;color:var(--text-2);margin-top:.35rem}
.bo-back{font-size:.9rem;font-weight:500;color:var(--text-2);display:inline-block;margin-bottom:.5rem;text-decoration:none}
.bo-back:hover{color:var(--or-texte)}
.bo-page-actions{display:flex;gap:.75rem;flex-wrap:wrap}

/* ── Messages flash ────────────────────────────────────────────────── */
.bo-flash{padding:.9rem 1.1rem;margin-bottom:1.5rem;font-size:.95rem;display:flex;justify-content:space-between;align-items:center;gap:1rem;border-radius:var(--rayon)}
.bo-flash-success{background:var(--grn-bg);border:1px solid #BFE3CC;color:var(--grn-tx)}
.bo-flash-error{background:var(--red-bg);border:1px solid #F5C2C2;color:var(--red-tx)}
.bo-flash-close{background:none;border:none;color:inherit;cursor:pointer;font-size:1.3rem;width:32px;height:32px}

/* ── Tableau de bord : cartes « à traiter » ────────────────────────── */
.bo-section-title{font-size:1.05rem;font-weight:600;color:var(--text);margin-bottom:.9rem}
.bo-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem;margin-bottom:2rem}
.bo-kpi{background:var(--surface);border:1px solid var(--border);border-top:4px solid var(--border);border-radius:var(--rayon);padding:1.1rem 1.2rem 1rem;box-shadow:var(--ombre);display:flex;flex-direction:column;gap:.15rem;text-decoration:none;color:var(--text);transition:transform .15s,box-shadow .15s}
a.bo-kpi:hover{transform:translateY(-1px);box-shadow:0 4px 14px rgba(31,27,20,.08)}
.bo-kpi-val{font-size:2.1rem;font-weight:700;line-height:1.1;color:var(--text)}
.bo-kpi-label{font-size:.95rem;font-weight:600;color:var(--text)}
.bo-kpi-desc{font-size:.85rem;color:var(--text-2)}
.bo-kpi-link{display:inline-flex;align-items:center;gap:.3rem;font-size:.9rem;font-weight:600;margin-top:.5rem;text-decoration:none;color:var(--or-texte)}
.bo-kpi-red{border-top-color:var(--red-tx)}.bo-kpi-red .bo-kpi-val,.bo-kpi-red .bo-kpi-link{color:var(--red-tx)}
.bo-kpi-purple{border-top-color:var(--pur-tx)}.bo-kpi-purple .bo-kpi-val,.bo-kpi-purple .bo-kpi-link{color:var(--pur-tx)}
.bo-kpi-blue{border-top-color:var(--blu-tx)}.bo-kpi-blue .bo-kpi-val,.bo-kpi-blue .bo-kpi-link{color:var(--blu-tx)}
.bo-kpi-teal{border-top-color:var(--tea-tx)}.bo-kpi-teal .bo-kpi-val,.bo-kpi-teal .bo-kpi-link{color:var(--tea-tx)}
.bo-kpi-green{border-top-color:var(--grn-tx)}.bo-kpi-green .bo-kpi-val,.bo-kpi-green .bo-kpi-link{color:var(--grn-tx)}
.bo-kpi-gold{border-top-color:var(--or)}.bo-kpi-gold .bo-kpi-val,.bo-kpi-gold .bo-kpi-link{color:var(--or-texte)}
.bo-kpi-orange{border-top-color:var(--ora-tx)}.bo-kpi-orange .bo-kpi-val,.bo-kpi-orange .bo-kpi-link{color:var(--ora-tx)}
.bo-kpi-silver .bo-kpi-val{color:var(--text-2)}
.bo-kpi-zero{opacity:.75}

/* ── Tableau de bord : deux colonnes ───────────────────────────────── */
.bo-dash-cols{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:1.5rem;align-items:start}
.bo-dash-col{display:flex;flex-direction:column;gap:1.5rem;min-width:0}
.bo-panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--rayon);box-shadow:var(--ombre);overflow:hidden}
.bo-panel-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.25rem;border-bottom:1px solid var(--border)}
.bo-panel-head h2{font-size:1.05rem;font-weight:600;color:var(--text)}
.bo-panel-head a{font-size:.9rem;font-weight:600;color:var(--or-texte);text-decoration:none}
.bo-panel .bo-empty{border:0;border-radius:0;box-shadow:none}
.bo-course{display:grid;grid-template-columns:64px minmax(0,1fr) auto;gap:1rem;align-items:center;padding:1rem 1.25rem;border-bottom:1px solid var(--border);text-decoration:none;color:var(--text)}
.bo-course:last-child{border-bottom:0}
.bo-course:hover{background:var(--surface-2)}
.bo-course-heure{font-size:1.25rem;font-weight:700;color:var(--text)}
.bo-course-jour{font-size:.8rem;font-weight:600;color:var(--text-2);display:block}
.bo-course-client{font-weight:600}
.bo-course-trajet{font-size:.9rem;color:var(--text-2);margin-top:.1rem}
.bo-course-meta{display:flex;gap:1rem;flex-wrap:wrap;font-size:.85rem;color:var(--text-2);margin-top:.35rem}
.bo-course-meta span{display:inline-flex;align-items:center;gap:.35rem}
.bo-a-assigner{color:var(--ora-tx);font-weight:600}

/* Agences (liste des agences + bloc du tableau de bord) */
.bo-agences-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:1rem;margin-bottom:2rem}
.bo-agence-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--rayon);box-shadow:var(--ombre);overflow:hidden}
.bo-agence-color{height:4px}
.bo-agence-body{padding:1.1rem 1.2rem}
.bo-panel .bo-agence-card{border:0;border-radius:0;box-shadow:none;border-bottom:1px solid var(--border);padding:1rem 1.25rem}
.bo-panel .bo-agence-card:last-child{border-bottom:0}
.bo-agence-top{display:flex;align-items:center;gap:.6rem}
.bo-agence-dot{width:10px;height:10px;border-radius:50%;flex:none}
.bo-agence-name{font-size:1.05rem;font-weight:600;color:var(--text);text-decoration:none}
.bo-agence-region{font-size:.85rem;color:var(--text-2)}
.bo-agence-top .bo-agence-region{margin-left:auto}
.bo-agence-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.5rem;margin:.8rem 0}
.bo-astat{display:block;background:var(--surface-2);border:1px solid var(--border);border-radius:10px;padding:.5rem .6rem;text-decoration:none;color:var(--text);transition:border-color .15s}
a.bo-astat:hover{border-color:var(--or)}
.bo-astat span{display:block;font-size:1.25rem;font-weight:700;line-height:1.2;color:var(--text)}
.bo-astat small{font-size:.75rem;color:var(--text-2);line-height:1.2;display:block}
.bo-astat .rouge{color:var(--red-tx)}.bo-astat .green{color:var(--grn-tx)}.bo-astat .gold{color:var(--or-texte)}
.bo-astat small.rouge,.bo-astat small.green,.bo-astat small.gold{color:var(--text-2)}
.bo-agence-ca{font-size:.9rem;color:var(--text-2)}
.bo-agence-ca strong{color:var(--text)}
.bo-agence-link{display:block;font-size:.9rem;font-weight:600;color:var(--or-texte);text-decoration:none;padding:.75rem 1.2rem;border-top:1px solid var(--border)}
.bo-agence-link:hover{background:var(--surface-2)}
.bo-agence-tag{font-size:.8rem;font-weight:500;border:1px solid var(--border);border-left-width:3px;border-radius:6px;padding:.15rem .5rem;color:var(--text);white-space:nowrap;display:inline-block}

/* ── Tableaux ──────────────────────────────────────────────────────── */
.bo-table-wrap{overflow-x:auto;background:var(--surface);border:1px solid var(--border);border-radius:var(--rayon);box-shadow:var(--ombre)}
.bo-panel .bo-table-wrap{border:0;border-radius:0;box-shadow:none}
.bo-table{width:100%;border-collapse:collapse;font-size:.92rem}
.bo-table th{font-size:.8rem;font-weight:600;color:var(--text-2);padding:.7rem 1rem;text-align:left;background:var(--surface-2);border-bottom:1px solid var(--border);white-space:nowrap}
.bo-table td{padding:.85rem 1rem;border-bottom:1px solid var(--border);vertical-align:middle;color:var(--text)}
.bo-table tbody tr:last-child td{border-bottom:0}
.bo-table tbody tr:hover td{background:var(--surface-2)}
.bo-cell-main{font-size:.95rem;color:var(--text)}
.bo-cell-sub{font-size:.85rem;color:var(--text-2);margin-top:.1rem}
.bo-ref{color:var(--or-texte);font-size:.9rem;font-weight:600;text-decoration:none;white-space:nowrap}
.bo-empty{background:var(--surface);border:1px solid var(--border);border-radius:var(--rayon);padding:2.5rem;text-align:center;color:var(--text-2);font-size:.95rem}

/* ── Pastilles de statut ───────────────────────────────────────────── */
.bo-status{display:inline-flex;align-items:center;gap:.4rem;font-size:.82rem;font-weight:600;padding:.25rem .7rem;border-radius:20px;white-space:nowrap;line-height:1.4}
.bo-status::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor;flex:none}
.bo-status-en_attente,.bo-badge.bo-status-en_attente{background:var(--red-bg);color:var(--red-tx)}
.bo-status-attente_client,.bo-badge.bo-status-attente_client{background:var(--blu-bg);color:var(--blu-tx)}
.bo-status-en_cours_traitement,.bo-badge.bo-status-en_cours_traitement{background:var(--pur-bg);color:var(--pur-tx)}
.bo-status-confirmee,.bo-badge.bo-status-confirmee{background:var(--grn-bg);color:var(--grn-tx)}
.bo-status-payee,.bo-badge.bo-status-payee{background:var(--tea-bg);color:var(--tea-tx)}
.bo-status-terminee,.bo-badge.bo-status-terminee{background:var(--gld-bg);color:var(--gld-tx)}
.bo-status-soldee,.bo-badge.bo-status-soldee{background:var(--emr-bg);color:var(--emr-tx)}
.bo-status-en_cours{background:var(--blu-bg);color:var(--blu-tx)}
.bo-status-annulee,.bo-badge.bo-status-annulee{background:var(--sla-bg);color:var(--sla-tx)}
.bo-status-tarif_refuse,.bo-badge.bo-status-tarif_refuse{background:var(--ora-bg);color:var(--ora-tx)}
.bo-badge{font-size:.8rem;font-weight:600;padding:.2rem .65rem;border:1px solid var(--border);border-radius:20px;color:var(--text);display:inline-block;margin-right:.4rem;background:var(--surface)}
.bo-badge[class*="bo-status-"]{border-color:transparent}
.bo-badge-gold{border-color:#E8D9A8;color:var(--gld-tx);background:var(--gld-bg)}
.bo-badge-green{border-color:#BFE3CC;color:var(--grn-tx);background:var(--grn-bg)}
.bo-badge-blue{border-color:#C3DAF0;color:var(--blu-tx);background:var(--blu-bg)}
.bo-badge-red{border-color:#F5C2C2;color:var(--red-tx);background:var(--red-bg)}
.bo-badge-warn{background:var(--ora-bg);color:var(--ora-tx);border:none;font-size:.8rem;font-weight:600;padding:.15rem .55rem;border-radius:20px}

/* ── Boutons ───────────────────────────────────────────────────────── */
.bo-btn{font-family:inherit;font-size:.9rem;font-weight:600;padding:0 1.1rem;min-height:42px;border:1px solid;border-radius:10px;cursor:pointer;transition:background .15s,border-color .15s,color .15s;white-space:nowrap;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:.45rem;line-height:1.2}
.bo-btn:disabled{opacity:.5;cursor:not-allowed}
.bo-btn-gold{background:var(--or);color:var(--sur-or);border-color:var(--or)}
.bo-btn-gold:hover{background:var(--or-hover);border-color:var(--or-hover)}
.bo-btn-outline{background:var(--surface);color:var(--text);border-color:var(--border)}
.bo-btn-outline:hover{border-color:var(--or);color:var(--or-texte)}
.bo-btn-green{background:var(--grn-bg);color:var(--grn-tx);border-color:#BFE3CC}
.bo-btn-green:hover{background:#D5EEDD}
.bo-btn-red{background:var(--red-bg);color:var(--red-tx);border-color:#F5C2C2}
.bo-btn-red:hover{background:#FADADA}
.bo-btn-ghost{background:transparent;color:var(--text-2);border-color:transparent}
.bo-btn-ghost:hover{color:var(--text);background:var(--surface-2)}
.bo-btn-sm{min-height:36px;padding:0 .8rem;font-size:.85rem}
.bo-btn-full{width:100%}

/* ── Onglets de statut ─────────────────────────────────────────────── */
.bo-tabs{display:flex;gap:.25rem;overflow-x:auto;margin:-.5rem 0 1.25rem;border-bottom:1px solid var(--border);scrollbar-width:thin}
.bo-tab{display:inline-flex;align-items:center;gap:.5rem;padding:.7rem .8rem .8rem;border-bottom:3px solid transparent;font-size:.95rem;font-weight:500;color:var(--text-2);text-decoration:none;white-space:nowrap;min-height:44px}
.bo-tab:hover{color:var(--text)}
.bo-tab.active{color:var(--text);font-weight:600;border-bottom-color:var(--or)}
.bo-tab-n{font-size:.78rem;font-weight:700;border-radius:20px;padding:.05rem .5rem;background:var(--sla-bg);color:var(--sla-tx)}

/* ── Filtres ───────────────────────────────────────────────────────── */
.bo-filters{display:flex;gap:.6rem;flex-wrap:wrap;align-items:center;margin-bottom:1.25rem;background:var(--surface);padding:.75rem;border:1px solid var(--border);border-radius:var(--rayon)}
.bo-filters select,.bo-filters input[type=date]{min-height:42px;padding:0 .8rem;font-size:.9rem;cursor:pointer;border-radius:10px}
.bo-filters .bo-select,.bo-filters .bo-input{width:auto;flex:1 1 170px}
.bo-search-wrap{display:flex;gap:.5rem;align-items:center;flex:1 1 280px;flex-wrap:wrap}
.bo-search{min-height:42px;padding:0 .9rem;font-size:.95rem;flex:1 1 200px;border-radius:10px}

/* ── Cartes de détail ──────────────────────────────────────────────── */
.bo-detail-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:1.5rem}
.bo-detail-col{display:flex;flex-direction:column;gap:1.5rem;min-width:0}
.bo-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--rayon);padding:1.4rem;box-shadow:var(--ombre);color:var(--text)}
.bo-card-title{font-size:1.05rem;font-weight:600;color:var(--text);margin-bottom:1rem}
.bo-detail-field{display:flex;gap:.75rem;align-items:baseline;margin-bottom:.65rem;font-size:.95rem;color:var(--text)}
.bo-detail-field label{color:var(--text-2);min-width:120px;flex-shrink:0;font-size:.88rem}
.bo-detail-field a{color:var(--or-texte)}
.bo-card p,.bo-card>span{color:var(--text)}
.bo-notes-client{margin-top:.75rem;padding:.9rem 1rem;background:var(--surface-2);border:1px solid var(--border);border-radius:10px}
.bo-notes-client label{font-size:.85rem;font-weight:600;color:var(--text-2);display:block;margin-bottom:.35rem}
.bo-notes-client p,.bo-notes-client span{font-size:.95rem;color:var(--text);line-height:1.6}
.bo-link-sm{font-size:.9rem;font-weight:600;color:var(--or-texte);margin-top:.9rem;display:inline-block;text-decoration:none}

/* ── Formulaires ───────────────────────────────────────────────────── */
.bo-form-group{margin-bottom:1rem}
.bo-form-group label{display:block;font-size:.88rem;font-weight:600;color:var(--text);margin-bottom:.4rem}
.bo-input,.bo-select,.bo-textarea,.bo-input-sm,
.bo-main input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=file]),
.bo-main select,.bo-main textarea,
.bo-modal input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=file]),
.bo-modal select,.bo-modal textarea{
  background:var(--surface);color:var(--text);border:1px solid #D9D0BC;border-radius:10px;font-family:inherit;font-size:.95rem
}
.bo-input,.bo-select{width:100%;min-height:44px;padding:0 .9rem}
.bo-textarea{width:100%;padding:.7rem .9rem;min-height:90px;resize:vertical;line-height:1.5}
.bo-input-sm{min-height:38px;padding:0 .65rem;font-size:.9rem}
.bo-main select,.bo-modal select,.bo-select{-webkit-appearance:none;appearance:none;padding-right:2.2rem !important;cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235C5446' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right .7rem center}
.bo-main select option,.bo-modal select option{background:var(--surface);color:var(--text)}
.bo-main input:focus,.bo-main select:focus,.bo-main textarea:focus,.bo-modal input:focus,.bo-modal select:focus,.bo-modal textarea:focus,.bo-input:focus{outline:none;border-color:var(--or);box-shadow:0 0 0 3px var(--focus)}
.bo-main ::placeholder,.bo-modal ::placeholder,.bo-login-wrap ::placeholder{color:#8A8170}
.bo-main input[type=checkbox],.bo-main input[type=radio]{accent-color:var(--or);width:18px;height:18px}
.bo-input:-webkit-autofill,.bo-input:-webkit-autofill:focus{-webkit-box-shadow:0 0 0 1000px var(--surface) inset !important;-webkit-text-fill-color:var(--text) !important}
.required{color:var(--red-tx)}
.field-error{display:none;font-size:.85rem;color:var(--red-tx);margin-top:.3rem}
.field-error:not(:empty){display:block}

/* ── Historique ────────────────────────────────────────────────────── */
.bo-timeline{display:flex;flex-direction:column;gap:1rem}
.bo-tl-item{display:flex;gap:.9rem;align-items:flex-start}
.bo-tl-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0;margin-top:.4rem}
.bo-tl-gold{background:var(--or)}.bo-tl-green{background:var(--grn-tx)}
.bo-tl-item strong{display:block;font-size:.95rem;color:var(--text);font-weight:500}
.bo-tl-item small{font-size:.85rem;color:var(--text-2);display:block}

/* ── Fenêtres modales ──────────────────────────────────────────────── */
.bo-modal-overlay{position:fixed;inset:0;background:rgba(22,20,15,.55);z-index:400;display:flex;align-items:center;justify-content:center;backdrop-filter:blur(3px);padding:1rem}
.bo-modal{background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:1.75rem;max-width:480px;width:100%;color:var(--text);box-shadow:0 20px 50px rgba(0,0,0,.25)}
.bo-modal h3{font-size:1.6rem;font-weight:600;margin-bottom:.6rem}
.bo-modal p{font-size:.95rem;color:var(--text-2);line-height:1.6;margin-bottom:1.25rem}
.bo-modal-actions{display:flex;gap:.75rem;justify-content:flex-end;flex-wrap:wrap;margin-top:1.25rem}

/* ── Connexion ─────────────────────────────────────────────────────── */
html body.bo-login-body{background:var(--cadre);display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh;margin:0;padding:1rem;font-family:'Inter',system-ui,sans-serif}
.bo-login-wrap{width:100%;max-width:400px}
.bo-login-brand{text-align:center;margin-bottom:2rem}
.bo-login-logo{font-size:2.2rem;font-weight:300;letter-spacing:.04em;color:var(--cadre-or);margin-bottom:.35rem}
.bo-login-sub{font-size:.9rem;color:var(--cadre-tx2)}
.bo-login-form{background:var(--surface);border-radius:16px;padding:1.75rem;color:var(--text);
  --gold:var(--or-texte);--char:var(--surface);--ash:var(--border);--silver:var(--text-2);--fog:var(--text);--white:var(--text)}
.bo-login-form .bo-input{background:var(--surface);color:var(--text);border:1px solid #D9D0BC}
.bo-login-form .bo-input:focus{outline:none;border-color:var(--or);box-shadow:0 0 0 3px var(--focus)}
.bo-login-footer{text-align:center;margin-top:1.5rem;font-size:.9rem}
.bo-login-footer a{color:var(--cadre-or);text-decoration:none}
.bo-login-body .bo-flash{margin-bottom:1rem}

.bo-actions{white-space:nowrap}

/* ── Barre d'onglets mobile ────────────────────────────────────────── */
.bo-tabbar{display:none}

/* ── Planning hebdomadaire ─────────────────────────────────────────── */
.planning-toolbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:1.25rem;flex-wrap:wrap;gap:1rem}
.planning-nav{display:flex;align-items:center;gap:.6rem}
.planning-nav a{color:var(--text);text-decoration:none;font-size:.9rem;font-weight:600;border:1px solid var(--border);background:var(--surface);border-radius:10px;padding:.55rem 1rem}
.planning-nav a:hover{border-color:var(--or);color:var(--or-texte)}
.planning-range{font-size:1.15rem;font-weight:600;color:var(--text)}
.planning-grid{display:grid;grid-template-columns:60px repeat(7,1fr);border:1px solid var(--border);border-radius:var(--rayon);background:var(--surface);overflow-x:auto}
.planning-corner{border-bottom:1px solid var(--border);border-right:1px solid var(--border)}
.planning-day-header{padding:.6rem .4rem;text-align:center;border-bottom:1px solid var(--border);border-right:1px solid var(--border);font-size:.8rem;font-weight:600;color:var(--text-2);background:var(--surface-2)}
.planning-day-header.today{color:var(--or-texte);background:var(--gld-bg)}
.planning-day-header .day-num{display:block;font-size:1.2rem;font-weight:700;color:var(--text);margin-top:.1rem}
.planning-day-header.today .day-num{color:var(--or-texte)}
.planning-hour-label{padding:.25rem .4rem;font-size:.75rem;color:var(--text-2);text-align:right;border-right:1px solid var(--border);border-bottom:1px solid #F0EADD;white-space:nowrap}
.planning-cell{min-height:1.5rem;border-right:1px solid #F0EADD;border-bottom:1px solid #F0EADD}
.planning-cell:last-child{border-right:none}
.planning-event{background:var(--gld-bg);color:var(--gld-tx);border-left:3px solid var(--or);margin:1px 2px;font-size:.75rem;line-height:1.3;padding:.2rem .35rem;overflow:hidden;cursor:pointer;border-radius:4px;z-index:2;text-decoration:none;display:block}
.planning-event:hover{background:#EFE2B8}
.planning-event.retour{background:var(--grn-bg);color:var(--grn-tx);border-left-color:var(--grn-tx)}
.planning-event.retour:hover{background:#D5EEDD}
.planning-event strong{display:block;font-size:.78rem}
.planning-legend{display:flex;gap:1.5rem;margin-top:1rem;font-size:.85rem;color:var(--text-2);flex-wrap:wrap}
.planning-legend span{display:inline-flex;align-items:center;gap:.4rem}
.planning-legend i{width:12px;height:12px;display:inline-block;border-radius:3px}

/* ── Responsive ────────────────────────────────────────────────────── */
@media(max-width:1200px){
  .bo-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .bo-dash-cols{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:900px){
  html,body.bo-body{overflow-x:clip}
  body.bo-body{padding-bottom:calc(68px + env(safe-area-inset-bottom))}
  .bo-topbar{padding:0 1rem;height:56px}
  .bo-logo{font-size:1.3rem}
  .bo-logo span,.bo-user-info,.bo-logout-desktop{display:none}
  .bo-burger{display:flex}
  .bo-layout{grid-template-columns:minmax(0,1fr);min-height:0;background:var(--bg)}
  .bo-course-meta{gap:.25rem .9rem}
  .bo-sidebar{display:none}
  .bo-main{padding:1.25rem 1rem 2rem}
  .bo-page-title{font-size:1.85rem}
  .bo-page-title.bo-titre-ref{font-size:1.5rem}
  .bo-page-header{margin-bottom:1.25rem}
  .bo-detail-grid{grid-template-columns:minmax(0,1fr)}
  .bo-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important}
  .bo-agences-grid{grid-template-columns:minmax(0,1fr)}
  .bo-detail-field{flex-direction:column;gap:.1rem}
  .bo-detail-field label{min-width:0}
  .bo-course{grid-template-columns:56px minmax(0,1fr);padding:.9rem 1rem}
  .bo-course .bo-status{grid-column:2;justify-self:start}
  .bo-agence-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .bo-filters{padding:.6rem}
  .bo-filters select,.bo-filters input[type=date]{flex:1 1 140px}
  .bo-modal-actions .bo-btn{flex:1}
  /* Tableaux en cartes sur mobile */
  .bo-table-wrap:has(.bo-table-cartes){background:none;border:0;box-shadow:none;overflow:visible}
  .bo-table-cartes thead{display:none}
  .bo-table-cartes,.bo-table-cartes tbody{display:block}
  .bo-table-cartes tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:.5rem .75rem;background:var(--surface);border:1px solid var(--border);border-radius:var(--rayon);box-shadow:var(--ombre);padding:1rem;margin-bottom:.75rem}
  .bo-table-cartes td{display:block;padding:0;border:0 !important;min-width:0}
  .bo-table-cartes tbody tr:hover td{background:none}
  .bo-table-cartes td[data-label]::before{content:attr(data-label);display:block;font-size:.75rem;font-weight:600;color:var(--text-2);margin-bottom:.1rem}
  .bo-table-cartes .bo-carte-titre::before,.bo-table-cartes .bo-carte-ref::before,.bo-table-cartes .bo-carte-statut::before{display:none !important}
  .bo-table-cartes .bo-carte-titre{grid-column:1/-1;order:-2}
  .bo-table-cartes .bo-carte-ref{order:-1;align-self:center}
  .bo-table-cartes .bo-carte-statut{order:-1}
  .bo-filters select[name=statut]{display:none}
  .bo-filters input[type=date]{min-width:0;flex:1 1 120px}
  .bo-table-cartes .bo-carte-titre .bo-cell-main{font-size:1.05rem;font-weight:600}
  .bo-table-cartes .bo-carte-statut{justify-self:end;align-self:start}
  .bo-table-cartes .bo-carte-large{grid-column:1/-1}
  .bo-table-cartes .bo-actions .bo-btn{width:100%;min-height:44px}
  .bo-table-cartes .bo-carte-large .bo-btn{min-height:44px}
  .bo-table-cartes tr.bo-carte-vide{display:block}
  .bo-table-cartes td.bo-carte-large:has(.bo-btn){display:flex;flex-wrap:wrap;gap:.5rem;white-space:normal}
  .bo-table-cartes td.bo-carte-large .bo-btn{flex:1 1 40%}
  .bo-table-cartes td.bo-carte-titre .bo-cell-main{font-size:1.05rem;font-weight:600}
  .planning-grid{grid-template-columns:50px repeat(7,minmax(110px,1fr))}
  .bo-tabbar{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));position:fixed;left:0;right:0;bottom:0;z-index:250;background:var(--cadre);border-top:1px solid var(--cadre-bord);padding:4px 4px calc(6px + env(safe-area-inset-bottom))}
  .bo-tabbar a,.bo-tabbar button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:54px;font:inherit;font-size:.72rem;font-weight:600;color:var(--cadre-tx2);text-decoration:none;background:none;border:0;cursor:pointer;border-radius:10px}
  .bo-tabbar svg{width:22px;height:22px}
  .bo-tabbar .active{color:var(--cadre-or);background:var(--cadre-actif)}
}
@media(max-width:560px){
  .bo-kpi-grid{gap:.6rem}
  .bo-kpi{padding:.85rem .9rem}
  .bo-kpi-val{font-size:1.7rem}
  .bo-kpi-desc{display:none}
  .bo-page-actions{width:100%}
  .bo-page-actions .bo-btn{flex:1}
}

/* ── Relances automatiques (Administration › Relances) ─────────────── */
.rl-alerte p{margin-top:.4rem;color:var(--text-2)}
.rl-alerte-warn{border-left:4px solid var(--ora-tx)}
.rl-alerte code,.rl-note code{background:var(--surface-2);border:1px solid var(--border);border-radius:6px;padding:.05rem .35rem;font-size:.88em}
.rl-etat{display:flex;gap:.8rem;align-items:flex-start;background:var(--surface);border:1px solid var(--border);border-radius:var(--rayon);padding:.9rem 1.1rem;margin-bottom:1.5rem;box-shadow:var(--ombre)}
.rl-etat strong{display:block;font-size:.95rem;font-weight:600}
.rl-etat span{font-size:.9rem;color:var(--text-2)}
.rl-etat-point{flex:none;width:10px;height:10px;border-radius:50%;margin-top:.4rem;background:var(--grn-tx);box-shadow:0 0 0 4px var(--grn-bg)}
.rl-etat-jamais,.rl-etat-arrete{border-color:#F1D3B5;background:var(--ora-bg)}
.rl-etat-jamais .rl-etat-point,.rl-etat-arrete .rl-etat-point{background:var(--ora-tx);box-shadow:0 0 0 4px #F8DCC4}
.rl-etat-jamais span,.rl-etat-arrete span{color:#7A3A0A}
.rl-liste{display:flex;flex-direction:column;gap:.75rem}
.rl-regle{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:1rem;align-items:center;background:var(--surface);border:1px solid var(--border);border-radius:var(--rayon);padding:1rem 1.2rem;box-shadow:var(--ombre)}
.rl-regle.rl-inactive{background:var(--surface-2)}
.rl-regle.rl-inactive .rl-regle-titre a{color:var(--text-2)}
.rl-regle-titre{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap}
.rl-regle-titre a{font-size:1.02rem;font-weight:600;color:var(--text);text-decoration:none}
.rl-regle-titre a:hover{color:var(--or-texte)}
.rl-regle-titre .bo-badge{margin:0}
.rl-resume{font-size:.93rem;color:var(--text);margin-top:.3rem;line-height:1.5}
.rl-meta{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem .9rem;margin-top:.5rem;font-size:.85rem;color:var(--text-2)}
.rl-sujet{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:46ch}
.rl-regle-actions{display:flex;gap:.4rem;align-items:center}
.rl-switch{position:relative;width:48px;height:28px;border-radius:20px;border:1px solid #D9D0BC;background:#E9E3D6;cursor:pointer;padding:0;transition:background .15s,border-color .15s;display:block}
.rl-switch span{position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(31,27,20,.25);transition:left .15s}
.rl-switch.on{background:var(--or);border-color:var(--or)}
.rl-switch.on span{left:23px}
.rl-switch:focus-visible{outline:none;box-shadow:0 0 0 3px var(--focus)}
.rl-note{font-size:.88rem;color:var(--text-2);margin-top:1rem;line-height:1.55}
.rl-note-haut{margin:0 0 1rem}
.rl-apercu{margin-bottom:1.25rem}
.rl-apercu .bo-panel-head .bo-badge{margin:0;white-space:nowrap}
.rl-apercu .bo-table-cartes,.rl-apercu .bo-table-wrap{border-radius:0}
.rl-coupe{word-break:break-all}
/* Formulaire d'une règle */
.rl-form-cols{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:1.5rem;align-items:start}
.rl-form-main{display:flex;flex-direction:column;gap:1.25rem;min-width:0}
.rl-form-main .bo-card .bo-form-group:last-child{margin-bottom:0}
.rl-form-side{position:sticky;top:84px}
.rl-etape{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;background:var(--gld-bg);color:var(--or-texte);font-size:.85rem;font-weight:700;margin-right:.4rem}
.rl-ligne{display:flex;gap:.6rem}
.rl-ligne .rl-delai{width:110px;flex:none}
.rl-ligne .rl-unite{width:auto;flex:1;max-width:220px}
.rl-choix{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem;margin-bottom:1rem}
.rl-choix-3{grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:0}
.rl-choix-item{display:flex;gap:.6rem;align-items:flex-start;border:1px solid var(--border);border-radius:10px;padding:.8rem .9rem;cursor:pointer;background:var(--surface);transition:border-color .15s,background .15s}
.rl-choix-item:hover{border-color:#D9C88F}
.rl-choix-item:has(input:checked){border-color:var(--or);background:#FDF9EC;box-shadow:0 0 0 1px var(--or) inset}
.rl-choix-item input,.rl-case input{accent-color:var(--or);width:18px;height:18px;margin-top:.15rem;flex:none}
.rl-choix-item strong,.rl-case strong{display:block;font-size:.93rem;font-weight:600}
.rl-choix-item small,.rl-case small{display:block;font-size:.83rem;color:var(--text-2);margin-top:.15rem;line-height:1.4;word-break:break-word}
.rl-case{display:flex;gap:.6rem;align-items:flex-start;font-size:.93rem;cursor:pointer}
.rl-case-actif{margin:1rem 0;padding:.8rem .9rem;border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}
.rl-message{min-height:200px}
.rl-vars{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center}
.rl-vars-titre{width:100%;font-size:.85rem;font-weight:600;color:var(--text-2);margin-bottom:.1rem}
.rl-var{font:inherit;font-size:.82rem;font-weight:500;padding:.3rem .65rem;border-radius:20px;border:1px solid var(--border);background:var(--surface-2);color:var(--text);cursor:pointer;min-height:32px}
.rl-var:hover{border-color:var(--or);color:var(--or-texte)}
.rl-side-card .rl-resume{background:var(--surface-2);border:1px solid var(--border);border-radius:10px;padding:.8rem .9rem;margin:0}
.rl-side-actions{display:flex;flex-direction:column;gap:.5rem}
.rl-supprimer{margin-top:1.5rem}
@media(max-width:1100px){
  .rl-form-cols{grid-template-columns:minmax(0,1fr)}
  .rl-form-side{position:static}
}
@media(max-width:900px){
  .rl-regle{grid-template-columns:auto minmax(0,1fr);padding:1rem}
  .rl-regle-switch{align-self:start;padding-top:.1rem}
  .rl-regle-actions{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr}
  .rl-regle-actions form,.rl-regle-actions .bo-btn{width:100%}
  .rl-regle-actions .bo-btn{min-height:44px}
  .rl-regle-actions .bo-btn-ghost{border-color:var(--border)}
  .rl-sujet{max-width:100%;white-space:normal}
  .rl-choix,.rl-choix-3{grid-template-columns:minmax(0,1fr)}
  .rl-apercu .bo-table-cartes tr{border-radius:0;box-shadow:none;border-width:0 0 1px;margin:0}
  .rl-etat{margin-bottom:1rem}
}
