@font-face{font-family:"Montserrat";font-style:normal;font-display:swap;font-weight:100 900;src:url(vendor/montserrat-latin-wght-normal.woff2) format("woff2")}
:root{
  --navy:#2A2A57; --navy2:#1F1F45; --mag:#C70079; --mag-d:#A8006A; --teal:#00A9AA; --teal-l:#E3F6F6;
  --bg:#F4F4F9; --card:#FFFFFF; --line:#E3E3EE; --line2:#CFCFE0; --fg:#23234A; --fg2:#55557E; --muted:#8A8AAE;
  --ok:#0B9A6B; --warn:#D98200; --err:#D0105E; --r:14px;
  --shadow:0 1px 2px rgba(42,42,87,.06),0 6px 24px rgba(42,42,87,.06);
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{margin:0; height:100%}
body{font:500 15px/1.5 "Montserrat",system-ui,sans-serif; color:var(--fg); background:var(--bg); -webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit; color:inherit}
a{color:var(--mag)}
h1,h2,h3{margin:0; letter-spacing:-.01em}
h1{font-size:28px; font-weight:800}
h2{font-size:19px; font-weight:750}
h3{font-size:16px; font-weight:700}
p{margin:0}
.muted{color:var(--muted)}
.small{font-size:13px}

/* ---------- Connexion ---------- */
.login{min-height:100vh; display:grid; place-items:center; padding:24px; background:radial-gradient(900px 500px at 80% -10%, rgba(199,0,121,.18), transparent 60%), radial-gradient(800px 500px at -10% 110%, rgba(0,169,170,.18), transparent 60%), var(--navy)}
.login-card{width:min(420px,100%); background:#fff; border-radius:22px; padding:36px 32px; box-shadow:0 30px 80px rgba(0,0,0,.35); display:grid; gap:18px}
.login-card .logo{height:46px; width:auto}
.login-card h1{font-size:24px}

/* ---------- Structure ---------- */
.app{display:grid; grid-template-columns:270px 1fr; min-height:100vh}
.side{background:var(--navy); color:#fff; display:flex; flex-direction:column; position:sticky; top:0; height:100vh; overflow:auto}
.side .brand{padding:22px 22px 14px; display:grid; gap:4px}
.side .brand .logo{height:40px; width:auto}
.side .brand small{color:#A9A9D0; font-size:12px; letter-spacing:.08em; text-transform:uppercase; font-weight:600}
.logo .lm-m{fill:var(--mag)} .logo .lm-t{fill:var(--teal)} .logo .lm-n{fill:var(--navy)} .logo .lm-w{fill:var(--navy)}
.side .logo .lm-n, .side .logo .lm-w{fill:#fff}
.nav{padding:8px 12px 20px; display:grid; gap:2px}
.nav .grp{font-size:11px; letter-spacing:.14em; text-transform:uppercase; color:#8F8FC0; font-weight:700; padding:18px 12px 6px}
.nav a{display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:10px; color:#DCDCF0; text-decoration:none; font-weight:600; font-size:14.5px}
.nav a:hover{background:rgba(255,255,255,.07); color:#fff}
.nav a[aria-current]{background:rgba(255,255,255,.13); color:#fff; box-shadow:inset 3px 0 0 var(--mag)}
.nav a svg{width:19px; height:19px; flex:none; opacity:.9}
.nav .badge{margin-left:auto; background:var(--mag); color:#fff; font-size:11px; font-weight:800; border-radius:999px; padding:2px 8px}
.nav details summary{list-style:none; cursor:pointer}
.nav details summary::-webkit-details-marker{display:none}
.nav details summary a{pointer-events:none}
.nav details[open] summary .chev{transform:rotate(90deg)}
.nav .chev{margin-left:auto; transition:transform .2s; opacity:.6}
.nav .sub{display:grid; gap:1px; padding:2px 0 6px 30px}
.nav .sub a{font-size:13.5px; padding:7px 12px; font-weight:500}
.side .bas{margin-top:auto; padding:16px 22px 22px; border-top:1px solid rgba(255,255,255,.08); display:grid; gap:10px; font-size:13px; color:#B9B9DA}
.side .bas a{color:#fff; text-decoration:none; font-weight:600}

.main{min-width:0; padding:28px clamp(18px,3vw,44px) 90px}
.top{display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin-bottom:26px}
.top h1{flex:1; min-width:240px}
.crumb{font-size:13px; color:var(--muted); font-weight:600; margin-bottom:6px}
.crumb a{color:var(--muted); text-decoration:none}

/* ---------- Boutons ---------- */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; border:1px solid transparent; border-radius:11px; padding:11px 18px; font-weight:700; font-size:14px; cursor:pointer; text-decoration:none; white-space:nowrap; transition:background .15s, border-color .15s, transform .1s}
.btn:active{transform:translateY(1px)}
.btn svg{width:18px; height:18px}
.btn-main{background:var(--mag); color:#fff} .btn-main:hover{background:var(--mag-d)}
.btn-sec{background:#fff; border-color:var(--line2); color:var(--fg)} .btn-sec:hover{border-color:var(--navy)}
.btn-teal{background:var(--teal); color:#fff}
.btn-danger{background:#fff; border-color:#F2B8CF; color:var(--err)} .btn-danger:hover{background:#FFF0F6}
.btn-lg{padding:15px 22px; font-size:15px; border-radius:13px}
.btn[disabled]{opacity:.5; pointer-events:none}
.icon-btn{width:38px; height:38px; border-radius:10px; display:grid; place-items:center; border:0; cursor:pointer; background:rgba(255,255,255,.92); color:var(--fg); box-shadow:0 2px 10px rgba(0,0,0,.18)}
.icon-btn svg{width:19px; height:19px}
.icon-btn.del:hover{background:var(--err); color:#fff}
.icon-btn.edit:hover{background:var(--navy); color:#fff}

/* ---------- Cartes / blocs ---------- */
.card{background:var(--card); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow); padding:24px; margin-bottom:22px}
.card-head{display:flex; align-items:flex-start; gap:14px; margin-bottom:18px; flex-wrap:wrap}
.card-head > div{flex:1; min-width:220px; display:grid; gap:4px}
.card-head p{color:var(--fg2); font-size:14px}
.grid-pages{display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:16px}
.page-tile{background:#fff; border:1px solid var(--line); border-radius:var(--r); overflow:hidden; text-decoration:none; color:var(--fg); box-shadow:var(--shadow); display:grid; transition:transform .15s, box-shadow .15s}
.page-tile:hover{transform:translateY(-2px); box-shadow:0 10px 30px rgba(42,42,87,.12)}
.page-tile .th{aspect-ratio:16/10; background:var(--line) center/cover no-repeat}
.page-tile .tx{padding:14px 16px; display:grid; gap:2px}
.page-tile .tx b{font-size:15px}
.page-tile .tx span{font-size:12.5px; color:var(--muted)}
.stats{display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; margin-bottom:22px}
.stat{background:#fff; border:1px solid var(--line); border-radius:var(--r); padding:20px; box-shadow:var(--shadow); text-decoration:none; color:var(--fg)}
.stat b{display:block; font-size:34px; font-weight:800; line-height:1.1}
.stat span{color:var(--fg2); font-size:14px}
.stat.hot b{color:var(--mag)}

/* ---------- Grille de photos ---------- */
.photos{display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:18px}
.photos.grand{grid-template-columns:repeat(auto-fill,minmax(290px,1fr))}
.ph{position:relative; background:#fff; border-radius:14px; overflow:hidden; border:1px solid var(--line); box-shadow:var(--shadow); display:grid}
.ph .img{position:relative; aspect-ratio:4/3; background:var(--line) center/cover no-repeat; cursor:grab}
.ph .img:active{cursor:grabbing}
.ph .num{position:absolute; left:10px; top:10px; min-width:40px; height:40px; padding:0 10px; border-radius:12px; background:var(--mag); color:#fff; font-weight:800; font-size:18px; display:grid; place-items:center; box-shadow:0 4px 14px rgba(199,0,121,.4)}
.ph .acts{position:absolute; right:10px; top:10px; display:flex; gap:8px}
.ph .poignee{position:absolute; left:50%; bottom:10px; transform:translateX(-50%); background:rgba(23,23,58,.72); color:#fff; font-size:12px; font-weight:700; border-radius:999px; padding:5px 12px; opacity:0; transition:opacity .2s; pointer-events:none}
.ph:hover .poignee{opacity:1}
.ph .cap{padding:12px 14px; display:grid; gap:2px; min-height:62px}
.ph .cap b{font-size:14.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.ph .cap span{font-size:12.5px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.ph .etat{position:absolute; left:10px; bottom:10px; background:#fff; color:var(--warn); font-size:11px; font-weight:800; padding:3px 8px; border-radius:6px}
.ph.fantome{opacity:.35}
.ph.choisie{outline:3px solid var(--teal)}
.ph-ajout{border:2px dashed var(--line2); border-radius:14px; display:grid; place-items:center; text-align:center; gap:8px; padding:24px; min-height:240px; color:var(--fg2); cursor:pointer; background:#FBFBFE; transition:border-color .2s, background .2s}
.ph-ajout:hover, .ph-ajout.over{border-color:var(--mag); background:#FFF5FA; color:var(--mag)}
.ph-ajout svg{width:38px; height:38px}
.ph-ajout b{font-size:15px}
.vide{padding:30px; text-align:center; color:var(--muted); border:2px dashed var(--line); border-radius:14px}
.slots{display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:18px}
.slot{display:grid; gap:10px}
.slot .lab{font-weight:700; font-size:14px}
.slot .img{aspect-ratio:4/3; border-radius:14px; background:var(--line) center/cover no-repeat; border:1px solid var(--line); position:relative}
.slot .img .acts{position:absolute; right:10px; top:10px; display:flex; gap:8px}

/* ---------- Formulaires ---------- */
.form{display:grid; grid-template-columns:1fr 1fr; gap:16px 18px}
.form .full{grid-column:1/-1}
@media (max-width:760px){.form{grid-template-columns:1fr}}
.field{display:grid; gap:6px}
.field label{font-size:13px; font-weight:700; color:var(--fg2)}
.field .aide{font-size:12.5px; color:var(--muted)}
.inp{width:100%; border:1.5px solid var(--line2); border-radius:11px; padding:11px 13px; background:#fff; outline:none; font-weight:500}
.inp:focus{border-color:var(--teal); box-shadow:0 0 0 3px rgba(0,169,170,.15)}
textarea.inp{min-height:110px; resize:vertical; line-height:1.55}
.compteur{font-size:12px; color:var(--muted); text-align:right}
.compteur.trop{color:var(--err)}
.actions{display:flex; gap:10px; justify-content:flex-end; margin-top:18px; flex-wrap:wrap}
.switch{display:inline-flex; align-items:center; gap:10px; cursor:pointer; font-weight:600; font-size:14px}
.switch input{appearance:none; width:44px; height:26px; border-radius:999px; background:var(--line2); position:relative; cursor:pointer; transition:background .2s; margin:0}
.switch input::after{content:""; position:absolute; left:3px; top:3px; width:20px; height:20px; border-radius:50%; background:#fff; transition:left .2s; box-shadow:0 1px 3px rgba(0,0,0,.2)}
.switch input:checked{background:var(--teal)}
.switch input:checked::after{left:21px}
.chips{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:18px}
.chip{border:1.5px solid var(--line2); background:#fff; border-radius:999px; padding:8px 14px; font-weight:600; font-size:13.5px; cursor:pointer}
.chip[aria-pressed="true"]{background:var(--navy); color:#fff; border-color:var(--navy)}
.editeur-barre{display:flex; gap:4px; flex-wrap:wrap; border:1.5px solid var(--line2); border-bottom:0; border-radius:11px 11px 0 0; padding:6px; background:#FAFAFD}
.editeur-barre button{border:0; background:transparent; border-radius:8px; padding:6px 10px; font-weight:700; cursor:pointer}
.editeur-barre button:hover{background:var(--line)}
.editeur{border:1.5px solid var(--line2); border-radius:0 0 11px 11px; padding:14px 16px; min-height:320px; background:#fff; outline:none; line-height:1.7; font-size:15.5px}
.editeur:focus{border-color:var(--teal)}
.editeur h2{font-size:21px; margin:18px 0 8px} .editeur h3{font-size:18px; margin:14px 0 6px} .editeur p{margin:0 0 12px}

/* ---------- Listes ---------- */
.liste{display:grid; gap:10px}
.ligne{display:flex; align-items:center; gap:14px; background:#fff; border:1px solid var(--line); border-radius:12px; padding:14px 16px; text-decoration:none; color:var(--fg)}
.ligne:hover{border-color:var(--line2)}
.ligne .ico{width:44px; height:44px; border-radius:10px; background:var(--teal-l); color:var(--teal); display:grid; place-items:center; flex:none; font-weight:800; font-size:12px; background-size:cover; background-position:center}
.ligne .tx{flex:1; min-width:0; display:grid; gap:2px}
.ligne .tx b{overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.ligne .tx span{font-size:13px; color:var(--muted)}
.pastille{font-size:12px; font-weight:800; border-radius:999px; padding:4px 10px; background:var(--line); color:var(--fg2); white-space:nowrap}
.pastille.nouveau{background:#FFE3F0; color:var(--mag)}
.pastille.en_cours{background:#FFF1D6; color:#A86400}
.pastille.devis_envoye{background:#E1F0FF; color:#1D5FB0}
.pastille.gagne{background:#DDF6EC; color:var(--ok)}
.pastille.perdu{background:#EDEDF3; color:var(--muted)}
.pastille.brouillon{background:#FFF1D6; color:#A86400}

/* ---------- Fenêtres ---------- */
.voile{position:fixed; inset:0; background:rgba(23,23,58,.55); z-index:50; display:grid; place-items:center; padding:20px; backdrop-filter:blur(2px)}
.modale{background:#fff; border-radius:20px; width:min(760px,100%); max-height:calc(100vh - 40px); overflow:auto; box-shadow:0 30px 90px rgba(0,0,0,.35)}
.modale.large{width:min(1180px,100%)}
.modale-head{display:flex; align-items:center; gap:12px; padding:20px 24px; border-bottom:1px solid var(--line); position:sticky; top:0; background:#fff; z-index:2}
.modale-head h2{flex:1}
.modale-body{padding:22px 24px}
.modale-foot{display:flex; gap:10px; justify-content:flex-end; padding:16px 24px; border-top:1px solid var(--line); position:sticky; bottom:0; background:#fff}
.apercu-grand{width:100%; border-radius:14px; max-height:360px; object-fit:contain; background:#111}

/* ---------- Publication / notifications ---------- */
.pub{position:fixed; right:22px; bottom:22px; z-index:60; background:var(--navy); color:#fff; border-radius:14px; padding:12px 16px; display:flex; align-items:center; gap:12px; box-shadow:0 12px 34px rgba(0,0,0,.25); font-weight:600; font-size:14px}
.pub .rond{width:12px; height:12px; border-radius:50%; background:var(--warn); animation:pulse 1.2s infinite}
.pub.ok .rond{background:#2FD39A; animation:none}
.pub a{color:#fff}
@keyframes pulse{50%{opacity:.35}}
.toast{position:fixed; left:50%; top:22px; transform:translateX(-50%); z-index:70; background:var(--fg); color:#fff; padding:12px 18px; border-radius:12px; font-weight:700; font-size:14px; box-shadow:0 10px 30px rgba(0,0,0,.25)}
.toast.err{background:var(--err)}
.charge{display:grid; place-items:center; padding:60px; color:var(--muted)}
.qr{background:#fff; padding:12px; border:1px solid var(--line); border-radius:12px; width:max-content}
.qr img{display:block; width:220px; height:220px; image-rendering:pixelated}
.aide-box{background:var(--teal-l); border-radius:12px; padding:14px 16px; color:#0C5D5E; font-size:14px; display:flex; gap:10px}
.aide-box svg{width:20px; height:20px; flex:none; margin-top:1px}

/* ---------- Mobile ---------- */
.burger{display:none}
@media (max-width:900px){
  .app{grid-template-columns:1fr}
  .side{position:fixed; inset:0 auto 0 0; width:280px; z-index:40; transform:translateX(-100%); transition:transform .25s}
  .side.ouvert{transform:none; box-shadow:0 0 60px rgba(0,0,0,.4)}
  .burger{display:inline-grid; place-items:center; width:44px; height:44px; border-radius:12px; border:1px solid var(--line2); background:#fff; cursor:pointer}
  .main{padding-top:18px}
}
/* tailles d'icônes */
.page-tile svg{width:22px; height:22px; vertical-align:-5px; margin-right:6px; color:var(--mag)}
.ligne svg{width:20px; height:20px}
.ligne > svg{color:var(--muted); flex:none}
.ligne .ico svg{width:22px; height:22px}
.ph-ajout svg{width:38px; height:38px}
.top .burger{font-size:20px}
