/* =====================================================================
   Youzful Admin : thème unique
   Toutes les couleurs sont dans :root ci-dessous. Les 5 couleurs de la
   charte sont des VALEURS APPROCHÉES (Figma) : à corriger ici uniquement.
   ===================================================================== */
:root{
  /* --- Charte Youzful (à ajuster) --- */
  --yz-navy:   #1F2433;   /* fond sombre : sidebar */
  --yz-blue:   #1A2FA0;   /* primaire : liens, boutons */
  --yz-green:  #8BC98A;   /* succès : accepté, payé */
  --yz-orange: #F4A259;   /* attention : en cours, non payé */
  --yz-sky:    #4FB3E8;   /* info / accent */
  --yz-gradient: linear-gradient(135deg, var(--yz-blue) 0%, var(--yz-green) 55%, var(--yz-orange) 100%);

  /* --- Dérivées (texte lisible sur fond clair) --- */
  --yz-blue-dark:   #14237A;
  --yz-blue-soft:   #E8EBF8;
  --yz-green-ink:   #2F6B2E;
  --yz-green-soft:  #EAF5EA;
  --yz-orange-ink:  #9A4F0C;
  --yz-orange-soft: #FEF1E4;
  --yz-sky-ink:     #17638F;
  --yz-sky-soft:    #E6F4FC;
  --yz-red:         #D64545;
  --yz-red-soft:    #FBEAEA;

  /* --- Couleur des badges par service --- */
  --yz-srv-babysitter: var(--yz-sky);
  --yz-srv-guide:      var(--yz-blue);
  --yz-srv-resto:      var(--yz-orange);
  --yz-srv-activite:   var(--yz-green);
  --yz-srv-transfert:  #7A6FD0;

  /* --- Neutres --- */
  --yz-bg:       #F5F6FA;
  --yz-surface:  #FFFFFF;
  --yz-border:   #E6E8EF;
  --yz-stripe:   #FAFBFD;
  --yz-hover:    #F1F3FA;
  --yz-text:     #1F2433;
  --yz-muted:    #6B7185;
  --yz-faint:    #A7ACBB;
  --yz-side-text:   #AEB4C6;
  --yz-side-title:  #6E7590;
  --yz-side-hover:  rgba(255,255,255,.06);
  --yz-side-active: rgba(79,179,232,.16);

  /* --- Formes --- */
  --yz-radius: 12px;
  --yz-radius-sm: 8px;
  --yz-shadow: 0 1px 2px rgba(31,36,51,.04), 0 4px 16px rgba(31,36,51,.06);
  --yz-shadow-lg: 0 12px 40px rgba(31,36,51,.18);
  --yz-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  /* --- Layout --- */
  --yz-side-w: 260px;
  --yz-side-w-mini: 76px;
  --yz-top-h: 64px;
}

/* ---------- Base ---------- */
html{ height:100%; }
body.yz-body{
  margin:0; min-height:100%; max-width:none; padding:0;
  background:var(--yz-bg); color:var(--yz-text);
  font-family:var(--yz-font); font-size:14px; line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
a{ color:var(--yz-blue); }
a:hover{ color:var(--yz-blue-dark); }
h1,h2,h3,h4,h5,h6{ color:var(--yz-text); font-weight:700; letter-spacing:-.01em; }
label{ font-size:13px; font-weight:600; color:var(--yz-text); margin:6px 0 6px; }
div label.required:after, label.required:after{ content:" *"; color:var(--yz-red); }
.yz-empty{ color:var(--yz-faint); }
.yz-nowrap{ white-space:nowrap; }
.yz-num{ font-variant-numeric:tabular-nums; white-space:nowrap; }
.center{ text-align:center; margin-top:15px; }
::-webkit-scrollbar{ width:8px; height:8px; }
::-webkit-scrollbar-thumb{ background:#C9CDD8; border-radius:8px; }
::-webkit-scrollbar-track{ background:transparent; }

/* ---------- Sidebar ---------- */
.yz-sidebar{
  position:fixed; top:0; left:0; bottom:0; z-index:1036;
  width:var(--yz-side-w); background:var(--yz-navy); color:var(--yz-side-text);
  display:flex; flex-direction:column; transition:width .2s ease, transform .25s ease;
}
.yz-brand{ display:flex; align-items:center; gap:10px; height:var(--yz-top-h); padding:0 20px; flex:0 0 auto; text-decoration:none !important; }
.yz-brand-y{ width:30px; height:30px; flex:0 0 auto; }
.yz-brand-text{ height:26px; width:auto; filter:brightness(0) invert(1); } /* lettrage bleu foncé rendu blanc sur le navy */
/* Secours si une image du logo ne charge pas : texte blanc lisible sur le navy */
.yz-brand, .yz-brand:hover{ color:#fff !important; }
.yz-brand-fallback{ display:none; color:#fff; font-size:20px; font-weight:700; letter-spacing:-.01em; white-space:nowrap; }
.yz-brand-mini{ display:none; width:30px; height:30px; border-radius:8px; background:var(--yz-gradient); color:#fff; font-weight:700; font-size:16px; align-items:center; justify-content:center; }
.yz-brand.is-text-missing .yz-brand-text{ display:none; }
.yz-brand.is-text-missing .yz-brand-fallback{ display:inline; }
.yz-brand.is-y-missing .yz-brand-y{ display:none; }
.yz-nav{ flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:8px 12px 24px; }
.yz-nav::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.14); }
.yz-nav-title{
  display:block; margin:18px 12px 6px; font-size:11px; font-weight:600;
  letter-spacing:.08em; text-transform:uppercase; color:var(--yz-side-title); white-space:nowrap;
}
.yz-nav ul{ list-style:none; margin:0; padding:0; }
.yz-nav-link{
  display:flex; align-items:center; gap:12px; padding:9px 12px; margin:1px 0;
  border-radius:10px; color:var(--yz-side-text) !important; font-weight:500; font-size:13.5px;
  text-decoration:none !important; white-space:nowrap; cursor:pointer; transition:background .15s, color .15s;
}
.yz-nav-link i.yz-ico{ width:20px; text-align:center; font-size:15px; flex:0 0 auto; opacity:.9; }
.yz-nav-link .yz-label{ flex:1 1 auto; overflow:hidden; text-overflow:ellipsis; }
.yz-nav-link:hover{ background:var(--yz-side-hover); color:#fff !important; }
.yz-nav-link.is-active{ background:var(--yz-side-active); color:#fff !important; box-shadow:inset 3px 0 0 var(--yz-sky); }
.yz-nav-link.is-active i.yz-ico{ color:var(--yz-sky); opacity:1; }
.yz-caret{ font-size:11px; transition:transform .2s; }
.yz-dropdown.is-open .yz-caret{ transform:rotate(90deg); }
.yz-sub{ display:none; padding:2px 0 6px 32px !important; }
.yz-dropdown.is-open .yz-sub{ display:block; }
.yz-sub .yz-nav-link{ padding:7px 12px; font-size:13px; }
.yz-sub .yz-nav-link i.yz-ico{ font-size:12px; }
.yz-badge{
  flex:0 0 auto; min-width:20px; height:20px; padding:0 6px; border-radius:10px;
  background:var(--yz-orange); color:var(--yz-navy); font-size:11px; font-weight:700;
  display:inline-flex; align-items:center; justify-content:center;
}
.yz-side-foot{ flex:0 0 auto; padding:12px; border-top:1px solid rgba(255,255,255,.07); }

/* Sidebar repliée (desktop uniquement) */
@media (min-width:992px){
  body.yz-collapsed .yz-sidebar{ width:var(--yz-side-w-mini); }
  body.yz-collapsed .yz-brand{ justify-content:center; padding:0; }
  body.yz-collapsed .yz-brand.is-y-missing .yz-brand-mini{ display:inline-flex; }
  body.yz-collapsed .yz-brand-text,
  body.yz-collapsed .yz-brand .yz-brand-fallback,
  body.yz-collapsed .yz-nav-link .yz-label,
  body.yz-collapsed .yz-caret{ display:none; }
  body.yz-collapsed .yz-nav-title{ height:1px; margin:12px 10px; padding:0; font-size:0; overflow:hidden; background:rgba(255,255,255,.08); }
  body.yz-collapsed .yz-nav-link{ justify-content:center; padding:10px 0; position:relative; }
  body.yz-collapsed .yz-nav-link .yz-badge{ position:absolute; top:2px; right:6px; min-width:16px; height:16px; font-size:10px; padding:0 4px; }
  body.yz-collapsed .yz-sub{ padding-left:0 !important; }
  body.yz-collapsed .yz-topbar{ left:var(--yz-side-w-mini); }
  body.yz-collapsed main.page-content{ margin-left:var(--yz-side-w-mini); }
}

/* ---------- Topbar ---------- */
.yz-topbar{
  position:fixed; top:0; right:0; left:var(--yz-side-w); z-index:1030; height:var(--yz-top-h);
  display:flex; align-items:center; gap:14px; padding:0 28px;
  background:rgba(255,255,255,.92); backdrop-filter:saturate(1.4) blur(8px);
  border-bottom:1px solid var(--yz-border); transition:left .2s ease;
}
.yz-icon-btn{
  width:38px; height:38px; border-radius:10px; border:1px solid var(--yz-border); background:#fff;
  color:var(--yz-text); display:inline-flex; align-items:center; justify-content:center; cursor:pointer; flex:0 0 auto;
}
.yz-icon-btn:hover{ background:var(--yz-hover); }
.yz-burger{ display:none; }
.yz-page-title{ margin:0; font-size:18px; font-weight:700; flex:1 1 auto; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.yz-user{ display:flex; align-items:center; gap:10px; flex:0 0 auto; }
.yz-avatar{
  width:36px; height:36px; border-radius:50%; background:var(--yz-blue-soft); color:var(--yz-blue);
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px;
}
.yz-user-meta{ line-height:1.2; }
.yz-user-name{ font-weight:600; font-size:13.5px; }
.yz-user-status{ font-size:12px; color:var(--yz-muted); display:flex; align-items:center; gap:5px; }
.yz-user-status:before{ content:""; width:7px; height:7px; border-radius:50%; background:var(--yz-green); }
.yz-logout{ color:var(--yz-muted) !important; }
.yz-logout:hover{ color:var(--yz-red) !important; border-color:var(--yz-red-soft); background:var(--yz-red-soft); }

/* ---------- Zone de contenu ---------- */
main.page-content{
  display:block; margin-left:var(--yz-side-w); padding:calc(var(--yz-top-h) + 28px) 28px 40px;
  min-height:100vh; transition:margin-left .2s ease;
}
main.page-content > .row, main.page-content > form > .row{ margin-left:0; margin-right:0; }
.yz-overlay{ display:none; }

/* ---------- Cartes / sections ---------- */
.yz-card, .back-cont{
  background:var(--yz-surface); border:1px solid var(--yz-border); border-radius:var(--yz-radius);
  box-shadow:var(--yz-shadow); padding:22px; margin:0 0 24px !important;
}
.back-cont.row{ margin-left:0 !important; margin-right:0 !important; padding:22px 8px; }
.yz-card-head{ display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-bottom:16px; }
.yz-card-title, .title-form h3, .yz-card-head h3{ font-size:16px; font-weight:700; margin:0; }
.title-form{ border-bottom:0; margin:0 0 16px !important; padding-bottom:0; }
.yz-card-flush{ padding:0; overflow:hidden; }
.yz-card-flush > .yz-card-head{ padding:18px 22px 0; }
.yz-section-title{ font-size:13px; font-weight:600; color:var(--yz-muted); text-transform:uppercase; letter-spacing:.06em; margin:8px 0 12px; }

/* ---------- KPI ---------- */
.yz-kpis{ display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:20px; margin-bottom:28px; }
.yz-kpi{
  position:relative; background:var(--yz-surface); border:1px solid var(--yz-border); border-radius:var(--yz-radius);
  box-shadow:var(--yz-shadow); padding:20px; display:flex; flex-direction:column; gap:14px; overflow:hidden;
}
.yz-kpi-ico{ width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:18px; }
.yz-kpi-value{ font-size:24px; font-weight:700; line-height:1.15; font-variant-numeric:tabular-nums; white-space:nowrap; }
.yz-kpi-value small{ font-size:13px; font-weight:600; color:var(--yz-muted); margin-left:2px; }
.yz-kpi-label{ font-size:13px; color:var(--yz-muted); font-weight:500; }
.yz-kpi--main:before{ content:""; position:absolute; left:0; top:0; right:0; height:4px; background:var(--yz-gradient); }
a.yz-kpi-link{ color:var(--yz-text) !important; text-decoration:none !important; transition:border-color .15s, box-shadow .15s, transform .1s; }
a.yz-kpi-link:hover{ transform:translateY(-1px); border-color:#D5D9E6; }
a.yz-kpi-link.active{ border-color:var(--yz-blue); box-shadow:0 0 0 3px rgba(26,47,160,.12), var(--yz-shadow); }
.yz-tone-blue   { background:var(--yz-blue-soft);   color:var(--yz-blue); }
.yz-tone-green  { background:var(--yz-green-soft);  color:var(--yz-green-ink); }
.yz-tone-orange { background:var(--yz-orange-soft); color:var(--yz-orange-ink); }
.yz-tone-sky    { background:var(--yz-sky-soft);    color:var(--yz-sky-ink); }
.yz-tone-violet { background:#EFEDFB; color:#51479E; }
.yz-tone-grad   { background:var(--yz-gradient); color:#fff; }

/* ---------- Fiches (client / prestataire) ---------- */
.yz-info-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:14px; }
.yz-info{ display:flex; flex-direction:column; gap:3px; padding:12px 14px; border-radius:10px; background:var(--yz-stripe); border:1px solid var(--yz-border); min-width:0; }
.yz-info > span{ font-size:11.5px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--yz-muted); }
.yz-info > strong{ font-size:14px; font-weight:600; overflow-wrap:anywhere; }
.yz-info--total{ background:var(--yz-blue-soft); border-color:transparent; }
.yz-info--total > strong{ color:var(--yz-blue); font-size:16px; }
.yz-card > .yz-info--total, form > .yz-info--total{ max-width:320px; margin:0 0 24px; }
.yz-kpis-3{ grid-template-columns:repeat(3, minmax(0,1fr)); }
.presta-count-row{ display:flex; flex-wrap:wrap; gap:10px; padding:0 22px 16px; }
.presta-count-card{
  flex:1 1 140px; display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px; cursor:pointer;
  background:#fff; border:1px solid var(--yz-border); font:inherit; color:var(--yz-text); text-align:left;
}
.presta-count-card:hover{ background:var(--yz-hover); }
.presta-count-card.active{ border-color:var(--yz-blue); box-shadow:0 0 0 3px rgba(26,47,160,.12); }
.presta-count-label{ flex:1 1 auto; font-size:13px; font-weight:600; }
.presta-count-value{ font-size:18px; font-weight:700; font-variant-numeric:tabular-nums; }
.yz-pill-btn{ cursor:pointer; font-family:inherit; }
.yz-pill-btn:hover{ filter:brightness(.96); box-shadow:inset 0 0 0 1px currentColor; }

/* ---------- Détail d'une prestation ---------- */
.fiche-card{ background:var(--yz-surface); border:1px solid var(--yz-border); border-radius:var(--yz-radius); box-shadow:var(--yz-shadow); padding:20px 22px; margin-bottom:20px; }
.fiche-card h4{ font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.06em; color:var(--yz-muted); margin:0 0 14px; display:flex; align-items:center; gap:8px; }
.fiche-card h4 i{ color:var(--yz-blue); }
.fiche-header{ display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:16px; }
.fiche-header-titre{ display:flex; align-items:center; gap:14px; }
.fiche-icone{ width:46px; height:46px; min-width:46px; border-radius:12px; background:var(--yz-blue-soft); color:var(--yz-blue); display:flex; align-items:center; justify-content:center; font-size:18px; }
.fiche-header-titre h3{ margin:0; font-size:19px; }
.fiche-header-titre .fiche-service{ font-size:12px; color:var(--yz-muted); font-weight:600; }
.fiche-header-badges{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.chrono-badge{ font-size:12px; font-weight:700; color:var(--yz-green-ink); white-space:nowrap; font-variant-numeric:tabular-nums; }
.chrono-badge.chrono-fini{ color:var(--yz-red); }
.detail-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:12px; }
.detail-item{ background:var(--yz-stripe); border:1px solid var(--yz-border); border-radius:10px; padding:10px 14px; min-width:0; }
.detail-item b{ display:block; font-size:11.5px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--yz-muted); margin-bottom:3px; }
.detail-item span{ font-size:14px; color:var(--yz-text); overflow-wrap:anywhere; }
.extension-box{ margin-top:14px; padding:14px 16px; border-radius:10px; background:var(--yz-orange-soft); border:1px solid transparent; }
.extension-box.pas-extension{ background:var(--yz-stripe); border-color:var(--yz-border); color:var(--yz-muted); font-size:13px; }
.extension-box b{ display:block; font-size:11.5px; text-transform:uppercase; letter-spacing:.05em; color:var(--yz-orange-ink); margin-bottom:6px; }
.extension-ligne{ display:flex; justify-content:space-between; font-size:14px; padding:3px 0; }
.facture-ligne{ display:flex; justify-content:space-between; align-items:center; padding:9px 0; border-bottom:1px solid var(--yz-border); font-size:14px; }
.facture-ligne:last-of-type{ border-bottom:0; }
.facture-ligne.total{ font-weight:700; font-size:16px; padding-top:12px; margin-top:4px; border-top:2px solid var(--yz-text); }
.facture-extra{ color:var(--yz-orange-ink); }

/* ---------- Page d'erreur ---------- */
.yz-card.yz-error{ max-width:520px; margin:40px auto !important; text-align:center; }
.yz-error-code{ font-size:56px; font-weight:700; line-height:1; background:var(--yz-gradient); -webkit-background-clip:text; background-clip:text; color:transparent; }
.yz-error h3{ margin:14px 0 6px; }
.yz-error p{ color:var(--yz-muted); }

/* ---------- Tableaux ---------- */
.yz-table-wrap{ overflow:auto; max-height:calc(100vh - 230px); -webkit-overflow-scrolling:touch; }
.table{ color:var(--yz-text); margin-bottom:0; font-size:13px; }
.table th, .table td{ vertical-align:middle !important; border-top:1px solid var(--yz-border); padding:10px 9px; }
.table th:first-child, .table td:first-child{ padding-left:18px; }
.table th:last-child, .table td:last-child{ padding-right:18px; }
.table td{ white-space:nowrap; }
.table td.yz-wrap, .table td .yz-wrap{ white-space:normal; min-width:140px; max-width:300px; }
.table thead th, .table tr:first-child > th{
  position:sticky; top:0; z-index:2; background:#F8F9FC; color:var(--yz-muted);
  font-size:11.5px; font-weight:600; letter-spacing:.05em; text-transform:uppercase;
  border-top:0; border-bottom:1px solid var(--yz-border); white-space:nowrap;
}
.table tbody tr:nth-child(even) > td{ background:var(--yz-stripe); }
.table tbody tr:hover > td{ background:var(--yz-hover); }
.table td.yz-num, .table td .yz-num{ text-align:right; }
.table th.yz-num{ text-align:right; }
.table-borderless td, .table-borderless th{ border:0; }
.yz-actions{ white-space:nowrap; text-align:right; }
.yz-actions a, .yz-actions button{ margin-left:4px; }
.yz-icon-action{
  display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:8px;
  color:var(--yz-muted) !important; background:transparent; border:1px solid var(--yz-border); text-decoration:none !important;
}
.yz-icon-action:hover{ background:var(--yz-blue-soft); color:var(--yz-blue) !important; border-color:transparent; }
.yz-inline-form{ display:inline-block; margin:0; }
button.yz-icon-action{ cursor:pointer; padding:0; font:inherit; }
.yz-icon-action.is-danger:hover{ background:var(--yz-red-soft); color:var(--yz-red) !important; }
.yz-link-btn, .action-voir{
  display:inline-flex; align-items:center; gap:6px; padding:5px 12px; border-radius:20px; border:1px solid var(--yz-border);
  color:var(--yz-text) !important; font-weight:600; font-size:12.5px; text-decoration:none !important; white-space:nowrap; background:#fff;
}
.yz-link-btn:hover, .action-voir:hover{ background:var(--yz-blue); border-color:var(--yz-blue); color:#fff !important; }
.yz-table-empty, .presta-empty{ text-align:center; color:var(--yz-faint); padding:56px 20px !important; }
.yz-table-empty i, .presta-empty i{ display:block; font-size:28px; margin-bottom:10px; color:var(--yz-faint); }

/* ---------- Badges / pills ---------- */
.yz-pill, .badge-pill{
  display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:999px;
  font-size:12px; font-weight:600; line-height:1.3; white-space:nowrap; border:0;
}
.yz-pill i{ font-size:10px; }
.yz-pill .yz-dot{ width:6px; height:6px; border-radius:50%; background:currentColor; }
.yz-pill--success, .paiement-oui, .statut-termine{ background:var(--yz-green-soft); color:var(--yz-green-ink); }
.yz-pill--warning, .paiement-non, .statut-attente{ background:var(--yz-orange-soft); color:var(--yz-orange-ink); }
.yz-pill--info, .statut-accepte{ background:var(--yz-sky-soft); color:var(--yz-sky-ink); }
.yz-pill--primary, .statut-encours{ background:var(--yz-blue-soft); color:var(--yz-blue); }
.yz-pill--violet, .statut-livraison{ background:#EFEDFB; color:#51479E; }
.yz-pill--muted, .paiement-attente{ background:#F0F1F5; color:var(--yz-muted); }
.yz-pill--danger{ background:var(--yz-red-soft); color:var(--yz-red); }
.yz-srv{ background:#F0F1F5; color:var(--yz-text); }
.yz-srv:before{ content:""; width:8px; height:8px; border-radius:50%; background:var(--yz-faint); }
.yz-srv--babysitter:before{ background:var(--yz-srv-babysitter); }
.yz-srv--guide:before{ background:var(--yz-srv-guide); }
.yz-srv--resto:before{ background:var(--yz-srv-resto); }
.yz-srv--activite:before{ background:var(--yz-srv-activite); }
.yz-srv--transfert:before{ background:var(--yz-srv-transfert); }
.yz-srv-ico{
  width:30px; height:30px; min-width:30px; border-radius:9px; display:inline-flex; align-items:center; justify-content:center;
  font-size:13px; color:#fff; background:var(--yz-faint);
}
.yz-srv-ico--babysitter{ background:var(--yz-srv-babysitter); }
.yz-srv-ico--guide{ background:var(--yz-srv-guide); }
.yz-srv-ico--resto{ background:var(--yz-srv-resto); }
.yz-srv-ico--activite{ background:var(--yz-srv-activite); }
.yz-srv-ico--transfert{ background:var(--yz-srv-transfert); }
.badge{ font-weight:600; border-radius:999px; padding:.35em .7em; }
.badge-success{ background:var(--yz-green-soft); color:var(--yz-green-ink); }
.badge-warning{ background:var(--yz-orange-soft); color:var(--yz-orange-ink); }
.badge-danger{ background:var(--yz-red-soft); color:var(--yz-red); }
.badge-info{ background:var(--yz-sky-soft); color:var(--yz-sky-ink); }
.badge-primary{ background:var(--yz-blue-soft); color:var(--yz-blue); }
.badge-secondary{ background:#F0F1F5; color:var(--yz-muted); }
/* Anciennes cellules colorées (.B/.G/.R) encore utilisées en texte de synthèse */
.B{ background:var(--yz-sky-soft); color:var(--yz-sky-ink); font-weight:600; border-radius:var(--yz-radius-sm); }
.G{ background:var(--yz-orange-soft); color:var(--yz-orange-ink); font-weight:600; border-radius:var(--yz-radius-sm); }
.R{ background:var(--yz-green-soft); color:var(--yz-green-ink); font-weight:600; border-radius:var(--yz-radius-sm); }

/* Prestations : cellule service, mission en cours, compte à rebours */
.yz-srv-cell{ display:flex; align-items:center; gap:8px; font-weight:600; }
.table tbody tr.ligne-en-cours > td{ background:#F2F8F2; }
.dot-live{ display:inline-block; width:7px; height:7px; border-radius:50%; background:currentColor; animation:yz-pulse 1.4s infinite; }
@keyframes yz-pulse{ 0%{ box-shadow:0 0 0 0 rgba(26,47,160,.45); } 70%{ box-shadow:0 0 0 6px rgba(26,47,160,0); } 100%{ box-shadow:0 0 0 0 rgba(26,47,160,0); } }
.chrono{ display:block; margin-top:6px; font-size:11.5px; font-weight:700; color:var(--yz-green-ink); font-variant-numeric:tabular-nums; white-space:nowrap; }
.chrono.chrono-fini{ color:var(--yz-red); }

/* ---------- Messages ---------- */
.sens-links{ display:inline-flex; align-items:center; gap:4px; background:#F0F1F5; border-radius:10px; padding:3px; }
.sens-links a{ display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:8px; font-size:13px; font-weight:600; color:var(--yz-muted) !important; text-decoration:none !important; }
.sens-links a i{ font-size:11px; }
.sens-links a:hover{ color:var(--yz-text) !important; }
.sens-links a.filtre-actif{ background:#fff; color:var(--yz-text) !important; box-shadow:0 1px 2px rgba(31,36,51,.1); }
.filtre-separateur{ display:none; }
.table tbody tr.ligne-non-lue > td{ background:#FFF8EF; }
.sujet-cell{ font-weight:600; }
.expediteur-row{ display:flex; align-items:center; gap:10px; }
.avatar-initiales{ width:34px; height:34px; min-width:34px; border-radius:50%; background:var(--yz-blue-soft); color:var(--yz-blue); font-size:12px; font-weight:700; display:flex; align-items:center; justify-content:center; text-transform:uppercase; }
.avatar-initiales--clair{ background:rgba(255,255,255,.14); color:#fff; }
.expediteur-nom{ font-weight:600; line-height:1.2; }
.expediteur-service{ font-size:12px; color:var(--yz-muted); line-height:1.2; }
.statut-nouveau{ background:var(--yz-orange-soft); color:var(--yz-orange-ink); }
.statut-lu{ background:var(--yz-sky-soft); color:var(--yz-sky-ink); }
.statut-traite{ background:var(--yz-green-soft); color:var(--yz-green-ink); }
.type-client{ background:var(--yz-blue-soft); color:var(--yz-blue); }
.type-prestataire{ background:#EFEDFB; color:#51479E; }
.sens-envoye{ background:var(--yz-blue-soft); color:var(--yz-blue); }
.sens-recu{ background:var(--yz-green-soft); color:var(--yz-green-ink); }
.lecture-mini{ display:flex; align-items:center; gap:4px; font-size:11px; font-weight:600; margin-top:5px; }
.lecture-mini.vu{ color:var(--yz-sky-ink); }
.lecture-mini.non-vu{ color:var(--yz-faint); }
#detailMessage .modal-header{ background:var(--yz-navy); color:#fff; border-bottom:0; }
#detailMessage .modal-header .close{ color:#fff; opacity:.7; text-shadow:none; }
.modal-title-row{ display:flex; align-items:center; gap:12px; }
.modal-title-texte .modal-sens{ display:block; font-size:11px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--yz-sky); margin-bottom:2px; }
.modal-title-texte h5{ margin:0; font-size:16px; color:#fff; }
#detailMessage .modal-body{ background:#FAFBFD; }
.meta-ligne{ display:flex; flex-wrap:wrap; gap:6px 22px; font-size:13px; color:var(--yz-muted); margin-bottom:18px; }
.meta-ligne strong{ color:var(--yz-text); }
.bulle-texte{ white-space:pre-wrap; display:block; }
.bulle-message{ max-width:85%; border-radius:14px; padding:14px 16px; line-height:1.5; font-size:14px; margin-bottom:16px; }
.bulle-recu{ background:#fff; border:1px solid var(--yz-border); border-top-left-radius:4px; margin-right:auto; }
.bulle-envoye{ background:var(--yz-blue); color:#fff; border-top-right-radius:4px; margin-left:auto; }
.bulle-label{ display:block; font-size:10.5px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; margin-bottom:6px; opacity:.7; }
.statut-lecture{ display:flex; align-items:center; gap:5px; font-size:11px; font-weight:600; margin-top:10px; }
.statut-lecture.non-vu{ opacity:.7; }
.statut-lecture.vu{ color:#CDEBFF; }

/* ---------- Filtres ---------- */
.yz-filters{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin:0; }
.yz-select, .filter-bar{
  position:relative; display:inline-flex; align-items:center; gap:8px; margin:0;
  height:38px; padding:0 34px 0 12px; border:1px solid var(--yz-border); border-radius:10px; background:#fff;
  font-size:13px; font-weight:500; color:var(--yz-text); cursor:pointer; box-shadow:none;
}
.yz-select:after, .filter-bar:after{
  content:"\f078"; font-family:"Font Awesome 5 Free"; font-weight:900; font-size:10px; color:var(--yz-muted);
  position:absolute; right:12px; top:50%; transform:translateY(-50%); pointer-events:none;
}
.yz-select:hover, .filter-bar:hover, .yz-select:focus-within, .filter-bar:focus-within{ border-color:var(--yz-blue); }
.yz-select i, .filter-bar i{ color:var(--yz-muted); font-size:12px; }
.yz-select select, .filter-bar select{
  appearance:none; -webkit-appearance:none; -moz-appearance:none; border:0; outline:0; background:transparent;
  font:inherit; color:inherit; cursor:pointer; padding:0; margin:0; height:100%;
}

/* ---------- Pagination ---------- */
.pagination-bar, .yz-pagination{ display:flex; justify-content:flex-end; align-items:center; gap:8px; padding:14px 18px; border-top:1px solid var(--yz-border); margin:0; }
.pagination-btn{
  display:inline-flex; align-items:center; gap:6px; height:36px; padding:0 14px; border-radius:10px;
  border:1px solid var(--yz-border); background:#fff; color:var(--yz-text) !important; font-size:13px; font-weight:600;
  text-decoration:none !important; box-shadow:none;
}
.pagination-btn i{ font-size:11px; color:inherit; }
.pagination-btn:hover{ background:var(--yz-blue); border-color:var(--yz-blue); color:#fff !important; }
.yz-page-info{ margin-right:auto; color:var(--yz-muted); font-size:13px; }

/* ---------- Formulaires ---------- */
.form-control, .custom-select, select.form-control, textarea.form-control{
  height:auto; min-height:40px; padding:8px 12px; border:1px solid var(--yz-border); border-radius:10px;
  font-size:14px; color:var(--yz-text); background-color:#fff; box-shadow:none;
}
textarea.form-control{ min-height:90px; }
.form-control:focus, .custom-select:focus{ border-color:var(--yz-blue); box-shadow:0 0 0 3px rgba(26,47,160,.12); }
.form-control::placeholder{ color:var(--yz-faint); }
.form-control-file{ font-size:13px; }
.form-group{ margin-bottom:14px; }
.yz-form-grid{ display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:14px 16px; align-items:end; }
.yz-form-grid .yz-span-all{ grid-column:1 / -1; }
.yz-form-grid .yz-span-2{ grid-column:span 2; }
.yz-help{ display:block; margin-top:5px; font-size:12px; color:var(--yz-muted); }
.yz-form-actions{ display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; margin-top:6px; }
input[type=checkbox], input[type=radio]{ accent-color:var(--yz-blue); }

/* ---------- Pages de paramétrage ---------- */
.back-cont.yz-params{ max-width:none; width:100%; }
.yz-params > .col-lg-12{ padding-left:14px; padding-right:14px; }
.yz-params .title-form{ padding-bottom:4px; }
.yz-params .title-form h3{ font-size:16px; }
.yz-form-table{ display:block; background:var(--yz-stripe); border:1px solid var(--yz-border); border-radius:var(--yz-radius); padding:16px; }
.yz-form-table > tbody{ display:block; }
.yz-form-table tr{ display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:12px 14px; }
.yz-form-table tr + tr{ margin-top:12px; }
.yz-form-table th, .yz-form-table td,
.yz-form-table tr:first-child > th{
  display:block; position:static; padding:0 !important; border:0 !important; background:none !important;
  text-transform:none; letter-spacing:0; font-size:13px; font-weight:600; color:var(--yz-text);
  white-space:normal; min-width:0 !important; max-width:none !important;
}
.yz-form-table th[colspan]{ grid-column:1 / -1; }
.yz-form-table th .form-control, .yz-form-table th select, .yz-form-table th textarea{ margin-top:6px; font-weight:400; }
.yz-form-table td{ grid-column:1 / -1; text-align:right !important; }
.yz-form-table tbody tr:nth-child(even) > td, .yz-form-table tbody tr:hover > td{ background:none; }
.yz-params .yz-table-wrap{ border:1px solid var(--yz-border); border-radius:var(--yz-radius); }
.yz-params .table-striped tbody tr:nth-of-type(odd){ background:transparent; }
.yz-params .table img{ border-radius:8px; object-fit:cover; }
.modal-body > label, .modal-body > .form-control{ display:block; }
.modal-body > .form-control{ margin-bottom:12px; }

/* ---------- Boutons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px; border-radius:10px; font-weight:600; font-size:13.5px;
  padding:8px 16px; border:1px solid transparent; box-shadow:none !important; transition:background .15s, border-color .15s, color .15s;
}
.btn-sm{ padding:5px 10px; font-size:12.5px; border-radius:8px; }
.btn-primary, .btn.valid, .valid{ background:var(--yz-blue) !important; border-color:var(--yz-blue) !important; color:#fff !important; }
.btn-primary:hover, .btn.valid:hover{ background:var(--yz-blue-dark) !important; border-color:var(--yz-blue-dark) !important; }
.btn-secondary, .btn.btn_close, .btn_close{ background:#fff !important; border-color:var(--yz-border) !important; color:var(--yz-text) !important; }
.btn-secondary:hover, .btn_close:hover{ background:var(--yz-hover) !important; }
.btn-success{ background:var(--yz-green-ink); border-color:var(--yz-green-ink); color:#fff; }
.btn-danger{ background:var(--yz-red); border-color:var(--yz-red); color:#fff; }
.btn-warning{ background:var(--yz-orange); border-color:var(--yz-orange); color:var(--yz-navy); }
.btn-info{ background:var(--yz-sky); border-color:var(--yz-sky); color:#fff; }
.btn-light{ background:#fff; border-color:var(--yz-border); color:var(--yz-text); }
.btn-dark{ background:var(--yz-navy); border-color:var(--yz-navy); color:#fff; }
.btn-outline-primary{ color:var(--yz-blue); border-color:var(--yz-blue); background:#fff; }
.btn-outline-primary:hover{ background:var(--yz-blue); color:#fff; }
.btn-outline-danger{ color:var(--yz-red); border-color:var(--yz-red-soft); background:#fff; }
.btn-outline-danger:hover{ background:var(--yz-red); color:#fff; }
.btn-link{ color:var(--yz-blue); }

/* ---------- Modales ---------- */
.modal-backdrop.show{ opacity:.45; background:var(--yz-navy); }
.modal-content{ border:0; border-radius:16px; box-shadow:var(--yz-shadow-lg); overflow:hidden; }
.modal-header{ padding:18px 22px; border-bottom:1px solid var(--yz-border); align-items:center; }
.modal-title{ font-size:16px; font-weight:700; }
.modal-header .close{ margin:-8px -8px -8px auto; padding:8px; opacity:.5; font-weight:400; }
.modal-body{ padding:20px 22px; }
.modal-footer{ padding:14px 22px; border-top:1px solid var(--yz-border); background:#FAFBFD; gap:8px; }
.modal-footer > *{ margin:0; }

/* ---------- Messages flash ---------- */
.alert{ border:0; border-radius:var(--yz-radius); padding:12px 16px; font-size:13.5px; display:flex; gap:10px; align-items:center; }
.alert-success{ background:var(--yz-green-soft); color:var(--yz-green-ink); }
.alert-danger{ background:var(--yz-red-soft); color:var(--yz-red); }
.alert-warning{ background:var(--yz-orange-soft); color:var(--yz-orange-ink); }
.alert-info, .alert-primary{ background:var(--yz-sky-soft); color:var(--yz-sky-ink); }
.alert .close{ margin-left:auto; }

/* ---------- jQuery UI (datepicker) ---------- */
.ui-widget{ font-family:var(--yz-font) !important; }
.ui-widget.ui-widget-content{ border:1px solid var(--yz-border); border-radius:var(--yz-radius); box-shadow:var(--yz-shadow-lg); padding:8px; }
.ui-widget-header{ border:0; background:transparent; color:var(--yz-text); font-weight:700; }
.ui-state-default, .ui-widget-content .ui-state-default{ border:0; background:transparent; color:var(--yz-text); text-align:center; border-radius:6px; }
.ui-state-hover, .ui-widget-content .ui-state-default:hover{ background:var(--yz-hover); }
.ui-state-highlight, .ui-widget-content .ui-state-highlight{ background:var(--yz-blue-soft); color:var(--yz-blue); }
.ui-state-active, .ui-widget-content .ui-state-active{ background:var(--yz-blue) !important; color:#fff !important; }

/* ---------- Bandeau d'alerte urgente (urgent-alert.js) ---------- */
body.urgent-alert-open .yz-sidebar{ top:44px; }
body.urgent-alert-open .yz-topbar{ top:44px; }
body.urgent-alert-open main.page-content{ padding-top:calc(var(--yz-top-h) + 72px); }
body.urgent-alert-open .page-wrapper{ margin-top:0 !important; }

/* ---------- Connexion ---------- */
body.yz-login{
  min-height:100vh; margin:0; display:flex; align-items:center; justify-content:center; padding:24px 16px;
  font-family:var(--yz-font); color:var(--yz-text);
  background:radial-gradient(1200px 600px at 110% -10%, rgba(79,179,232,.20), transparent 60%),
             radial-gradient(900px 500px at -10% 110%, rgba(139,201,138,.16), transparent 60%), var(--yz-navy);
}
.yz-login-card{ width:100%; max-width:420px; background:#fff; border-radius:20px; box-shadow:0 24px 60px rgba(0,0,0,.35); padding:36px 32px 28px; }
.yz-login-logo{ display:block; height:52px; width:auto; margin:0 auto 22px; }
.yz-login-logo-fallback{ display:none; text-align:center; font-size:30px; font-weight:700; color:var(--yz-blue); margin:0 auto 18px; }
.yz-login-card h1{ font-size:20px; text-align:center; margin:0 0 4px; }
.yz-login-sub{ text-align:center; color:var(--yz-muted); font-size:13.5px; margin-bottom:24px; }
.yz-input-ico{ position:relative; margin-bottom:14px; }
.yz-input-ico i{ position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--yz-faint); font-size:14px; }
.yz-input-ico .form-control{ padding-left:40px; height:46px; }
.yz-login-btn{ width:100%; height:46px; margin-top:6px; font-size:15px; }
.yz-login-foot{ text-align:center; margin-top:22px; color:rgba(255,255,255,.55); font-size:12px; }
.yz-login-foot a{ color:rgba(255,255,255,.75); }

/* ---------- Responsive ---------- */
@media (max-width:1199.98px){ .yz-kpis{ grid-template-columns:repeat(2, minmax(0,1fr)); } .yz-kpis-3{ grid-template-columns:1fr; } }
@media (max-width:991.98px){
  .yz-sidebar{ transform:translateX(-100%); box-shadow:var(--yz-shadow-lg); }
  body.yz-nav-open .yz-sidebar{ transform:none; }
  body.yz-nav-open .yz-overlay{ display:block; position:fixed; inset:0; z-index:1035; background:rgba(31,36,51,.5); }
  .yz-topbar{ left:0; padding:0 16px; }
  main.page-content{ margin-left:0; padding:calc(var(--yz-top-h) + 20px) 16px 32px; }
  .yz-burger{ display:inline-flex; }
  .yz-collapse-btn{ display:none; }
  .yz-user-meta{ display:none; }
}
@media (max-width:575.98px){
  .yz-kpis{ grid-template-columns:1fr; gap:12px; }
  .yz-kpi{ flex-direction:row; align-items:center; padding:14px 16px; }
  .yz-kpi-value{ font-size:20px; }
  .yz-card, .back-cont{ padding:16px; }
  .yz-card.yz-card-flush{ padding:0; }
  .yz-card-flush > .yz-card-head{ padding:16px 16px 0; }
  .yz-page-title{ font-size:16px; }
  .yz-table-wrap{ max-height:none; }
  .yz-form-grid .yz-span-2{ grid-column:1 / -1; }
  .yz-form-grid{ grid-template-columns:1fr; }
}
