/* =====================================================================
   ANITICAR — Interface Pro · feuille de style
   Reprend le design de la maquette validée.
   ===================================================================== */

:root{
  --navy:#001233;
  --navy-2:#0a1e44;
  --navy-3:#13294f;
  --blue:#1869E2;
  --blue-dark:#1255bd;
  --cyan:#3BE3D5;
  --grey-1:#DEDEE3;
  --grey-2:#EEEEEE;
  --bg:#F4F6FA;
  --white:#FFFFFF;
  --text:#001233;
  --text-soft:#5b6576;
  --text-faint:#8a93a3;
  --line:#E7E9F0;
  --green:#10b06b;
  --green-bg:#e4f6ee;
  --orange:#ef9d33;
  --orange-bg:#fdf0dd;
  --red:#e24a3d;
  --red-bg:#fce8e6;
}
*{box-sizing:border-box;margin:0;padding:0}
body{
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  background:var(--bg);color:var(--text);
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}

/* ---------- LAYOUT ---------- */
.app{display:flex;min-height:100vh}

/* ---------- SIDEBAR ---------- */
.sidebar{
  width:266px;flex-shrink:0;background:var(--navy);
  background:linear-gradient(180deg,#001233 0%,#021a3f 100%);
  color:#fff;display:flex;flex-direction:column;
  position:sticky;top:0;height:100vh;
}
.brand{
  padding:20px 24px 17px;display:flex;flex-direction:column;align-items:flex-start;
  gap:6px;border-bottom:1px solid rgba(255,255,255,.08);
}
.brand-logo{width:150px;height:auto;display:block}
.brand-sub{font-size:10px;letter-spacing:1.7px;color:#8fa6c9;
  text-transform:uppercase;font-weight:600}

.nav{flex:1;overflow-y:auto;padding:14px 12px}
.nav-group{margin-bottom:16px}
.nav-label{
  font-size:10px;letter-spacing:1.3px;text-transform:uppercase;
  color:#62759a;font-weight:700;padding:6px 12px 8px;
}
.nav-item{
  display:flex;align-items:center;gap:11px;padding:9px 12px;
  border-radius:9px;color:#b9c5da;font-size:13.5px;font-weight:500;
  cursor:pointer;margin-bottom:2px;transition:.15s;
}
.nav-item svg{width:18px;height:18px;flex-shrink:0;opacity:.85}
.nav-item:hover{background:rgba(255,255,255,.06);color:#fff}
.nav-item.active{
  background:linear-gradient(90deg,rgba(24,105,226,.28),rgba(24,105,226,.05));
  color:#fff;font-weight:600;
  box-shadow:inset 3px 0 0 var(--cyan);
}
.nav-item.active svg{opacity:1;color:var(--cyan)}
/* Parent avec menu déroulant : chevron à droite + rotation à l'ouverture */
.nav-item.has-children{user-select:none}
.nav-item .chevron{
  margin-left:auto;width:14px;height:14px;opacity:.7;
  transition:transform .2s ease;flex-shrink:0;
}
.nav-item.expanded .chevron{transform:rotate(90deg);opacity:1}

/* Sous-items (menus secondaires sous un nav-item parent) */
.nav-children{
  margin:0 0 0 21px;              /* aligne le trait sous l'icône du parent */
  padding-left:0;
  border-left:1px solid rgba(255,255,255,.08);
  max-height:0;overflow:hidden;
  transition:max-height .25s ease, margin-bottom .25s ease;
}
.nav-children.open{
  max-height:500px;               /* assez large pour 5-6 sous-items */
  margin-bottom:6px;
}
.nav-subitem{
  display:flex;align-items:center;gap:8px;
  padding:6px 12px 6px 18px;margin-bottom:1px;
  border-radius:0 9px 9px 0;
  color:#8ea0bd;font-size:12.5px;font-weight:500;
  text-decoration:none;cursor:pointer;transition:.15s;
  position:relative;
}
.nav-subitem::before{
  content:"";position:absolute;left:6px;top:50%;transform:translateY(-50%);
  width:5px;height:5px;border-radius:50%;background:#52617d;transition:.15s;
}
.nav-subitem:hover{background:rgba(255,255,255,.05);color:#fff}
.nav-subitem:hover::before{background:var(--cyan)}
.nav-subitem.active{
  background:rgba(24,105,226,.18);color:#fff;font-weight:600;
}
.nav-subitem.active::before{
  background:var(--cyan);box-shadow:0 0 8px var(--cyan);
}
.nav-badge{
  margin-left:auto;background:var(--blue);color:#fff;font-size:10px;
  font-weight:700;padding:2px 7px;border-radius:20px;
}

/* ===== Widget filtre par période (topbar, toutes les pages) ===== */
.periode-widget{position:relative}
.periode-btn{
  display:flex;align-items:center;gap:8px;
  padding:8px 12px;background:#fff;color:#001233;
  border:1px solid #e4e8f2;border-radius:10px;
  font-size:13px;font-weight:600;cursor:pointer;
  font-family:inherit;transition:.15s;
}
.periode-btn:hover{border-color:#1869E2;background:#f4f6fb}
.periode-btn > svg{flex:none;color:#1869E2}
.periode-chev{transition:transform .15s;opacity:.5}
.periode-widget.open .periode-chev{transform:rotate(180deg);opacity:1}
.periode-menu{
  position:absolute;top:calc(100% + 6px);right:0;z-index:200;
  background:#fff;border:1px solid #e4e8f2;border-radius:12px;
  box-shadow:0 12px 32px rgba(0,18,51,.14);padding:6px;
  min-width:230px;max-width:280px;
  display:none;
}
.periode-widget.open .periode-menu{display:block}
.periode-opt{
  display:block;padding:8px 12px;font-size:13px;color:#52617d;
  text-decoration:none;border-radius:8px;font-weight:500;
}
.periode-opt:hover{background:#f4f6fb;color:#001233}
.periode-opt.active{
  background:linear-gradient(90deg,rgba(24,105,226,.12),rgba(59,227,213,.06));
  color:#1869E2;font-weight:700;
}
.periode-divider{height:1px;background:#e4e8f2;margin:6px 4px}
.periode-custom{display:flex;flex-direction:column;gap:6px;padding:4px 8px 4px}
.periode-custom label{
  display:flex;align-items:center;gap:8px;
  font-size:12px;color:#8b97ae;font-weight:600;
}
.periode-custom input[type=date]{
  flex:1;font-size:12.5px;padding:6px 8px;
  border:1px solid #e4e8f2;border-radius:7px;
  color:#001233;font-family:inherit;
}
.periode-custom input[type=date]:focus{outline:none;border-color:#1869E2}
.periode-custom button{
  margin-top:4px;background:#1869E2;color:#fff;border:none;
  padding:7px;border-radius:7px;cursor:pointer;
  font-weight:600;font-size:12.5px;font-family:inherit;
  transition:.15s;
}
.periode-custom button:hover{background:#0f4cae}

/* Bandeau d'indication de période sous le titre (optionnel par page) */
.periode-banniere{
  display:inline-flex;align-items:center;gap:7px;
  background:rgba(24,105,226,.08);color:#1869E2;
  padding:4px 11px;border-radius:20px;
  font-size:12px;font-weight:600;margin-top:4px;
}
.periode-banniere svg{width:12px;height:12px}

.side-user{
  margin:12px;padding:12px;border-radius:11px;
  background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.08);
  display:flex;align-items:center;gap:10px;
}
.side-user .avatar{width:36px;height:36px;font-size:13px}
.side-user .su-name{font-size:13px;font-weight:600;color:#fff}
.side-user .su-role{font-size:11px;color:#8fa6c9;margin-top:2px}

/* ---------- MAIN ---------- */
.main{flex:1;min-width:0;display:flex;flex-direction:column}

.topbar{
  background:var(--white);border-bottom:1px solid var(--line);
  padding:16px 30px;display:flex;align-items:center;gap:20px;
  position:sticky;top:0;z-index:20;
}
.burger{display:none;background:none;border:none;cursor:pointer;color:var(--navy)}
.page-head h1{font-size:20px;font-weight:800;letter-spacing:-.2px}
.page-head p{font-size:13px;color:var(--text-soft);margin-top:2px}
.topbar-actions{margin-left:auto;display:flex;align-items:center;gap:14px}
.search{
  display:flex;align-items:center;gap:8px;background:var(--bg);
  border:1px solid var(--line);border-radius:9px;padding:8px 12px;
  width:250px;color:var(--text-faint);
}
.search input{border:none;background:none;outline:none;font-size:13px;
  font-family:inherit;color:var(--text);width:100%}
.icon-btn{
  width:38px;height:38px;border-radius:9px;border:1px solid var(--line);
  background:var(--white);display:flex;align-items:center;justify-content:center;
  cursor:pointer;color:var(--text-soft);position:relative;
}
.icon-btn:hover{background:var(--bg)}

.content{padding:26px 30px 40px;max-width:1180px;width:100%}

/* ---------- FLASH (messages d'information) ---------- */
.flash{
  border-radius:11px;padding:13px 16px;font-size:13px;font-weight:500;
  margin-bottom:20px;border:1px solid;
}
.flash-ok{background:var(--green-bg);color:#0a7d4b;border-color:#bfe6d2}
.flash-err{background:var(--red-bg);color:#b3261a;border-color:#f1c4bf}

/* ---------- STATS ---------- */
.stats{
  display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:24px;
}
.stat{
  background:var(--white);border:1px solid var(--line);border-radius:14px;
  padding:18px;display:flex;gap:14px;align-items:flex-start;
}
.stat-ico{
  width:42px;height:42px;border-radius:11px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
}
.stat-ico svg{width:21px;height:21px}
.stat .value{font-size:25px;font-weight:800;line-height:1;letter-spacing:-.5px}
.stat .label{font-size:12.5px;color:var(--text-soft);margin-top:6px;font-weight:500}
.ic-blue{background:#e7f0fd;color:var(--blue)}
.ic-navy{background:#e3e7ef;color:var(--navy)}
.ic-cyan{background:#dcf7f4;color:#149a8f}
.ic-green{background:var(--green-bg);color:var(--green)}

/* ---------- CARD / TABLE ---------- */
.card{
  background:var(--white);border:1px solid var(--line);border-radius:16px;
  overflow:hidden;
}
.card-head{
  padding:18px 22px;display:flex;align-items:center;gap:14px;
  border-bottom:1px solid var(--line);flex-wrap:wrap;
}
.card-head h2{font-size:15.5px;font-weight:700}
.card-head .count{
  background:var(--bg);color:var(--text-soft);font-size:12px;font-weight:600;
  padding:3px 10px;border-radius:20px;
}
.head-tools{margin-left:auto;display:flex;gap:10px;flex-wrap:wrap}

.btn{
  display:inline-flex;align-items:center;gap:8px;border:none;cursor:pointer;
  font-family:inherit;font-size:13.5px;font-weight:600;border-radius:9px;
  padding:9px 16px;transition:.15s;
}
.btn svg{width:17px;height:17px}
.btn-primary{background:var(--blue);color:#fff}
.btn-primary:hover{background:var(--blue-dark)}
.btn-ghost{background:var(--white);color:var(--text);border:1px solid var(--line)}
.btn-ghost:hover{background:var(--bg)}

table{width:100%;border-collapse:collapse}
thead th{
  text-align:left;font-size:11px;letter-spacing:.6px;text-transform:uppercase;
  color:var(--text-faint);font-weight:700;padding:13px 22px;
  background:#fafbfd;border-bottom:1px solid var(--line);
}
tbody td{padding:15px 22px;border-bottom:1px solid var(--line);font-size:13.5px;vertical-align:middle}
tbody tr:last-child td{border-bottom:none}
tbody tr:hover{background:#fafbfd}

.user-cell{display:flex;align-items:center;gap:12px}
.avatar{
  width:40px;height:40px;border-radius:50%;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  font-weight:700;color:#fff;font-size:14px;
}
.av-1{background:linear-gradient(135deg,#1869E2,#3BE3D5)}
.av-2{background:linear-gradient(135deg,#7b3ff2,#e2483d)}
.av-3{background:linear-gradient(135deg,#0f9d8f,#3BE3D5)}
.av-4{background:linear-gradient(135deg,#ef9d33,#e2483d)}
.av-5{background:linear-gradient(135deg,#5b6576,#8a93a3)}
.u-name{font-weight:600;font-size:13.5px}
.u-name .moi{color:var(--text-faint);font-weight:500;font-size:11.5px}
.u-mail{font-size:12px;color:var(--text-faint);margin-top:2px}

.badge{
  display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:600;
  padding:4px 10px;border-radius:20px;white-space:nowrap;
}
.badge .d{width:6px;height:6px;border-radius:50%}
.bg-admin{background:#e7eefb;color:var(--blue-dark)}
.bg-emp{background:#dcf7f4;color:#0c8378}
.bg-sous{background:#ede9fb;color:#6b46d6}
.bg-actif{background:var(--green-bg);color:#0a7d4b}
.bg-actif .d{background:var(--green)}
.bg-attente{background:var(--orange-bg);color:#b9701a}
.bg-attente .d{background:var(--orange)}
.bg-inactif{background:var(--grey-2);color:var(--text-soft)}
.bg-inactif .d{background:var(--text-faint)}
.bg-echec{background:var(--red-bg);color:#b3261a}
.bg-echec .d{background:var(--red)}

.modules-cell{font-size:13px}
.modules-cell .m-strong{font-weight:600}
.modules-cell .m-soft{color:var(--text-faint);font-size:12px;margin-top:2px}

.row-actions{display:flex;gap:6px;justify-content:flex-end}
.act{
  width:32px;height:32px;border-radius:8px;border:1px solid var(--line);
  background:var(--white);display:flex;align-items:center;justify-content:center;
  cursor:pointer;color:var(--text-soft);
}
.act svg{width:15px;height:15px}
.act:hover{background:var(--bg);color:var(--blue);border-color:#cdd3e0}
.act.danger:hover{color:var(--red)}

.table-foot{
  padding:14px 22px;display:flex;align-items:center;justify-content:space-between;
  font-size:12.5px;color:var(--text-soft);
}

/* ---------- TABLEAU DE BORD ---------- */
.card-body{padding:18px 22px}
.grille-2{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:22px}
.objectif-chiffre{font-size:30px;font-weight:800;letter-spacing:-.5px}
.objectif-chiffre small{font-size:16px;font-weight:600;color:var(--text-faint)}
.progress{height:14px;background:var(--grey-2);border-radius:20px;overflow:hidden;margin:12px 0 8px}
.progress span{display:block;height:100%;background:var(--blue)}
.progress span.vert{background:var(--green)}
.progress span.orange{background:var(--orange)}
.progress span.rouge{background:var(--red)}
.ligne{
  display:flex;justify-content:space-between;align-items:baseline;
  padding:11px 0;border-bottom:1px solid var(--line);
}
.ligne:last-child{border-bottom:none}
.ligne .lib{font-size:13px;color:var(--text-soft)}
.ligne .val{font-size:15px;font-weight:700}
@media(max-width:900px){ .grille-2{grid-template-columns:1fr} }

/* ---------- GRAPHIQUE EN BARRES ---------- */
.bar-chart{padding:2px 0}
.bar-row{display:flex;align-items:center;gap:12px;margin:9px 0}
.bar-row .b-label{
  width:160px;flex-shrink:0;font-size:12.5px;font-weight:500;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.bar-row .b-track{flex:1;height:20px;background:var(--grey-2);border-radius:6px;overflow:hidden}
.bar-row .b-fill{height:100%;border-radius:6px;background:var(--blue);min-width:3px}
.bar-row .b-fill.cyan{background:#149a8f}
.bar-row .b-val{width:34px;text-align:right;font-size:13px;font-weight:700}
@media(max-width:560px){ .bar-row .b-label{width:104px} }

/* ---------- MESSAGERIE INTERNE ---------- */
#msgWidget [hidden]{display:none !important}
.msg-bulle{
  position:fixed;right:24px;bottom:24px;z-index:70;
  width:56px;height:56px;border-radius:50%;border:none;cursor:pointer;
  background:var(--blue);color:#fff;display:flex;align-items:center;justify-content:center;
  box-shadow:0 8px 22px rgba(24,105,226,.45);transition:.15s;
}
.msg-bulle:hover{background:var(--blue-dark)}
.msg-bulle svg{width:24px;height:24px}
.msg-badge{
  position:absolute;top:-3px;right:-3px;min-width:20px;height:20px;padding:0 4px;
  background:var(--red);color:#fff;border-radius:20px;border:2px solid #fff;
  font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;
}
.msg-fenetre{
  position:fixed;right:24px;bottom:92px;z-index:71;
  width:340px;max-width:calc(100vw - 32px);height:460px;max-height:calc(100vh - 130px);
  background:#fff;border:1px solid var(--line);border-radius:16px;
  box-shadow:0 20px 50px rgba(0,18,51,.3);display:flex;flex-direction:column;overflow:hidden;
}
.msg-tete{
  background:var(--navy);color:#fff;padding:13px 14px;
  display:flex;align-items:center;gap:10px;flex-shrink:0;
}
.msg-tete span{font-weight:700;font-size:14px;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.msg-tete button{
  background:rgba(255,255,255,.12);border:none;color:#fff;cursor:pointer;flex-shrink:0;
  width:28px;height:28px;border-radius:7px;display:flex;align-items:center;justify-content:center;
}
.msg-tete button:hover{background:rgba(255,255,255,.22)}
.msg-tete button svg{width:15px;height:15px}
.msg-liste{flex:1;overflow-y:auto}
.msg-contact{
  display:flex;align-items:center;gap:11px;padding:11px 14px;cursor:pointer;
  border-bottom:1px solid var(--line);
}
.msg-contact:hover{background:var(--bg)}
.msg-av{
  width:38px;height:38px;border-radius:50%;flex-shrink:0;
  background:linear-gradient(135deg,var(--blue),var(--cyan));
  color:#fff;font-weight:700;font-size:13px;display:flex;align-items:center;justify-content:center;
}
.msg-contact-info{flex:1;min-width:0}
.msg-contact-nom{font-size:13.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.msg-contact-role{font-size:11.5px;color:var(--text-faint);margin-top:1px}
.msg-pastille{
  background:var(--red);color:#fff;font-size:11px;font-weight:700;
  min-width:18px;height:18px;border-radius:20px;padding:0 5px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
}
.msg-vide{padding:24px 16px;text-align:center;color:var(--text-faint);font-size:12.5px}
.msg-conv{flex:1;display:flex;flex-direction:column;min-height:0}
.msg-fil{flex:1;overflow-y:auto;padding:14px;background:var(--bg);display:flex;flex-direction:column;gap:8px}
.msg-bul{max-width:80%;padding:8px 11px;border-radius:12px;font-size:13px;line-height:1.4}
.msg-bul .msg-txt{white-space:pre-wrap;word-break:break-word}
.msg-bul .msg-pied{display:flex;align-items:center;justify-content:flex-end;gap:4px;margin-top:3px}
.msg-bul .msg-heure{font-size:10px;opacity:.65}
.msg-coche{display:inline-flex}
.msg-coche svg{width:14px;height:14px}
.msg-bul.moi .msg-coche{color:rgba(255,255,255,.6)}
.msg-bul.moi .msg-coche.lu{color:var(--cyan)}
.msg-bul.moi{align-self:flex-end;background:var(--blue);color:#fff;border-bottom-right-radius:3px}
.msg-bul.autre{align-self:flex-start;background:#fff;border:1px solid var(--line);border-bottom-left-radius:3px}
.msg-saisie{display:flex;gap:8px;padding:10px;border-top:1px solid var(--line);background:#fff;flex-shrink:0}
.msg-saisie input{
  flex:1;border:1px solid var(--line);border-radius:20px;padding:9px 14px;
  font-size:13px;font-family:inherit;outline:none;color:var(--text);
}
.msg-saisie input:focus{border-color:var(--blue)}
.msg-saisie button{
  width:38px;height:38px;border-radius:50%;border:none;background:var(--blue);color:#fff;
  cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;
}
.msg-saisie button:hover{background:var(--blue-dark)}
.msg-saisie button svg{width:16px;height:16px}
@media(max-width:560px){
  .msg-fenetre{right:12px;left:12px;width:auto;bottom:84px}
  .msg-bulle{right:16px;bottom:16px}
}

.legend{
  margin-top:18px;font-size:12px;color:var(--text-faint);
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
}
.legend .tag{
  background:#fff;border:1px solid var(--line);border-radius:6px;
  padding:3px 8px;font-weight:600;color:var(--text-soft);
}

/* ---------- MODAL ---------- */
.overlay{
  position:fixed;inset:0;background:rgba(0,18,51,.55);
  backdrop-filter:blur(2px);display:none;align-items:flex-start;
  justify-content:center;padding:40px 20px;z-index:100;overflow-y:auto;
}
.overlay.open{display:flex}
.modal{
  background:var(--white);border-radius:18px;width:100%;max-width:580px;
  box-shadow:0 30px 60px rgba(0,18,51,.3);animation:pop .18s ease;
}
@keyframes pop{from{transform:translateY(12px);opacity:0}to{transform:none;opacity:1}}
.modal-head{
  padding:20px 24px;border-bottom:1px solid var(--line);
  display:flex;align-items:flex-start;gap:14px;
}
.modal-head .m-ico{
  width:42px;height:42px;border-radius:11px;background:#e7f0fd;color:var(--blue);
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
}
.modal-head h3{font-size:16.5px;font-weight:800}
.modal-head p{font-size:12.5px;color:var(--text-soft);margin-top:3px}
.modal-close{
  margin-left:auto;background:none;border:none;cursor:pointer;
  color:var(--text-faint);width:30px;height:30px;border-radius:7px;
}
.modal-close:hover{background:var(--bg)}
.modal-body{padding:22px 24px;max-height:60vh;overflow-y:auto}
.modal-foot{
  padding:16px 24px;border-top:1px solid var(--line);
  display:flex;justify-content:flex-end;gap:10px;
}

.field{margin-bottom:18px}
.field label{display:block;font-size:12.5px;font-weight:600;margin-bottom:7px}
.field .req{color:var(--blue)}
.input{
  width:100%;border:1px solid var(--line);border-radius:9px;padding:10px 13px;
  font-size:13.5px;font-family:inherit;color:var(--text);outline:none;
}
.input:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(24,105,226,.12)}
.input:disabled{background:var(--bg);color:var(--text-faint)}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:14px}

.seg{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.seg label{
  border:1.5px solid var(--line);border-radius:10px;padding:11px 8px;
  text-align:center;cursor:pointer;font-size:12.5px;font-weight:600;
  color:var(--text-soft);transition:.15s;display:block;margin:0;
}
.seg input{display:none}
.seg label .seg-sub{display:block;font-size:10.5px;font-weight:500;
  color:var(--text-faint);margin-top:3px}
.seg input:checked + label{
  border-color:var(--blue);background:#f3f8fe;color:var(--blue-dark);
}
.seg input:checked + label .seg-sub{color:var(--blue)}

.perm-head{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:6px;
}
.perm-head .lbl{font-size:12.5px;font-weight:600}
.perm-note{font-size:11.5px;color:var(--text-faint)}
.perm-banner{
  display:none;background:#f3f8fe;border:1px solid #cfe0fa;border-radius:9px;
  padding:9px 12px;font-size:12px;color:var(--blue-dark);margin-bottom:10px;
  gap:8px;align-items:center;
}
.perm-banner.show{display:flex}
.perm-list{border:1px solid var(--line);border-radius:11px;overflow:hidden}
.perm-row{
  display:flex;align-items:center;gap:11px;padding:10px 13px;
  border-bottom:1px solid var(--line);
}
.perm-row:last-child{border-bottom:none}
.perm-row .p-ico{
  width:30px;height:30px;border-radius:8px;background:var(--bg);
  display:flex;align-items:center;justify-content:center;color:var(--text-soft);
  flex-shrink:0;
}
.perm-row .p-ico svg{width:16px;height:16px}
.perm-row .p-name{font-size:13px;font-weight:500}
.perm-row .p-mod{font-size:10.5px;color:var(--text-faint);margin-top:1px}
.perm-row .switch{margin-left:auto}

.switch{position:relative;display:inline-block;width:42px;height:23px;flex-shrink:0}
.switch input{opacity:0;width:0;height:0}
.track{
  position:absolute;inset:0;background:var(--grey-1);border-radius:20px;
  cursor:pointer;transition:.18s;
}
.track:before{
  content:"";position:absolute;width:17px;height:17px;left:3px;top:3px;
  background:#fff;border-radius:50%;transition:.18s;box-shadow:0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .track{background:var(--blue)}
.switch input:checked + .track:before{transform:translateX(19px)}
.switch input:disabled + .track{opacity:.55;cursor:not-allowed}

.danger-zone{
  display:flex;align-items:center;gap:14px;margin-top:20px;padding-top:16px;
  border-top:1px solid var(--line);
}
.danger-zone .dz-title{font-size:13px;font-weight:600;color:var(--red)}
.danger-zone .dz-note{font-size:11.5px;color:var(--text-faint);margin-top:3px;line-height:1.45}
.danger-zone .btn-danger{margin-left:auto;flex-shrink:0}
.btn-danger{background:#fff;color:var(--red);border:1px solid #f1c4bf}
.btn-danger:hover{background:var(--red);color:#fff;border-color:var(--red)}

#confirmOverlay{z-index:120}
.confirm-box{
  background:#fff;border-radius:16px;max-width:430px;width:100%;
  padding:26px 26px 22px;box-shadow:0 30px 60px rgba(0,18,51,.35);
  animation:pop .18s ease;text-align:center;
}
.confirm-ico{
  width:52px;height:52px;border-radius:50%;background:var(--red-bg);color:var(--red);
  display:flex;align-items:center;justify-content:center;margin:0 auto 14px;
}
.confirm-ico svg{width:26px;height:26px}
.confirm-box h3{font-size:17px;font-weight:800;margin-bottom:8px}
.confirm-box p{font-size:13px;color:var(--text-soft);line-height:1.5;margin-bottom:8px}
.confirm-box .confirm-hint{
  font-size:12px;color:var(--text-soft);background:var(--bg);
  border-radius:9px;padding:10px 12px;margin:2px 0 0;
}
.confirm-actions{display:flex;gap:10px;margin-top:18px}
.confirm-actions .btn{flex:1;justify-content:center}
.btn-danger-solid{background:var(--red);color:#fff;border:1px solid var(--red)}
.btn-danger-solid:hover{background:#c33529;border-color:#c33529}

/* ---------- ÉCRAN DE CONNEXION ---------- */
.login-body{
  min-height:100vh;display:flex;align-items:center;justify-content:center;
  padding:30px 16px;background:linear-gradient(180deg,#001233 0%,#021a3f 100%);
}
.login-card{
  background:#fff;border-radius:18px;width:100%;max-width:410px;
  padding:34px 34px 30px;box-shadow:0 30px 70px rgba(0,0,0,.45);text-align:center;
}
.login-logo{width:138px;height:auto;display:block;margin:0 auto 4px}
.login-sub{
  font-size:10px;letter-spacing:1.7px;color:var(--text-faint);
  text-transform:uppercase;font-weight:600;margin-bottom:22px;
}
.login-card h1{font-size:20px;font-weight:800;margin-bottom:4px}
.login-intro{font-size:13px;color:var(--text-soft);margin-bottom:18px}
.login-card form{text-align:left}
.login-label{display:block;font-size:12.5px;font-weight:600;margin:14px 0 6px}
.login-btn{width:100%;justify-content:center;margin-top:22px}
.login-erreur{
  background:var(--red-bg);color:#b3261a;font-size:12.5px;font-weight:500;
  border:1px solid #f1c4bf;border-radius:9px;padding:10px 12px;
  margin-bottom:8px;text-align:left;
}
.login-aide{
  font-size:11.5px;color:var(--text-faint);margin-top:16px;
  line-height:1.5;text-align:left;
}

/* ---------- RESPONSIVE ---------- */
@media(max-width:1080px){
  .stats{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:900px){
  .sidebar{position:fixed;left:0;top:0;z-index:90;transform:translateX(-100%);
    transition:.22s;box-shadow:0 0 40px rgba(0,0,0,.4)}
  .sidebar.show{transform:none}
  .burger{display:flex}
  .search{display:none}
  .content{padding:20px 16px 40px}
  .topbar{padding:14px 16px}
  .table-scroll{overflow-x:auto}
  table{min-width:760px}
}
@media(max-width:560px){
  .stats{grid-template-columns:1fr}
  .grid-2{grid-template-columns:1fr}
  .seg{grid-template-columns:1fr}
}
