:root{--navy:#092b5c;--blue:#1466d8;--ink:#172033;--muted:#667085;--line:#e6eaf0;--surface:#fff;--bg:#f5f7fb;--green:#067647}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.55 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}.shell{min-height:100vh;display:flex}.sidebar{width:252px;background:var(--navy);color:#d8e7ff;padding:26px 16px;display:flex;flex-direction:column;position:fixed;inset:0 auto 0 0}.brand{color:white;text-decoration:none;padding:0 10px 30px;display:flex;align-items:center;gap:12px;font-size:12px;letter-spacing:2px}.brand img{width:137px;max-height:38px;object-fit:contain;filter:brightness(0) invert(1)}nav{display:grid;gap:7px}nav a{padding:12px 14px;border-radius:10px;color:#c9daf4;text-decoration:none;font-weight:600;font-size:15px}nav a:hover{background:#17427e;color:white}.profile{margin-top:auto;padding:18px 12px;border-top:1px solid #315588}.profile b,.profile small{display:block}.profile small{opacity:.65;text-transform:capitalize}.profile a{display:inline-block;color:white;margin-top:12px;font-size:13px}main{margin-left:252px;width:calc(100% - 252px);padding:34px max(4vw,28px)}.topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:30px}.topbar h1{font-size:28px;line-height:1.2;margin:4px 0 0}.eyebrow{font-weight:800;color:var(--blue);font-size:11px;letter-spacing:1.3px}.menu{display:none}.button{border:0;border-radius:9px;padding:10px 15px;font-weight:700;text-decoration:none;cursor:pointer;display:inline-block}.primary{background:var(--blue);color:white}.secondary{background:#edf3ff;color:#174f9f}.danger{background:#fff0f0;color:#bd2929}.grid{display:grid;gap:18px}.stats{grid-template-columns:repeat(3,1fr);margin-bottom:25px}.card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:22px;box-shadow:0 3px 12px #102a4d08}.stat{font-size:31px;font-weight:800;margin:7px 0}.muted{color:var(--muted)}.section-head{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:28px 0 14px}.section-head h2{margin:0;font-size:18px}.table-wrap{overflow:auto}.table{width:100%;border-collapse:collapse}.table th{text-align:left;color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.5px}.table th,.table td{padding:13px 9px;border-bottom:1px solid var(--line)}.badge{background:#e8f6ef;color:var(--green);border-radius:999px;padding:4px 9px;font-size:12px;font-weight:700}.badge.off{background:#f1f2f4;color:#667085}.actions{display:flex;gap:8px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:17px}.wide{grid-column:1/-1}label{font-weight:700;font-size:14px;display:block;margin-bottom:6px}input,select,textarea{width:100%;border:1px solid #ccd4df;border-radius:8px;background:white;padding:11px 12px;font:inherit;color:var(--ink)}textarea{min-height:190px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:13px}.help{font-size:13px;color:var(--muted);margin-top:5px}.form-actions{margin-top:20px;display:flex;gap:9px}.alert{padding:13px 16px;border-radius:10px;margin:0 0 20px}.success{background:#eaf8f0;color:#096a42}.login{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#061e43,#1466d8)}.login-card{width:min(440px,calc(100% - 32px));background:white;border-radius:18px;padding:36px;box-shadow:0 20px 60px #00122a66}.login-card img{max-width:180px;max-height:54px;object-fit:contain;margin-bottom:24px}.login-card h1{margin:0 0 5px}.login-card form{margin-top:24px;display:grid;gap:15px}.login-card .button{width:100%;text-align:center}.preview{border:1px solid var(--line);border-radius:10px;width:100%;height:600px;background:white}.empty{padding:30px;text-align:center;color:var(--muted)}@media(max-width:780px){.sidebar{transform:translateX(-100%);transition:.2s;z-index:5;width:260px}.nav-open .sidebar{transform:none}.nav-open:after{content:"";position:fixed;inset:0;background:#0006;z-index:4}.nav-open .sidebar{z-index:6}main{margin-left:0;width:100%;padding:22px 16px}.menu{display:block;border:0;background:none;font-size:23px;margin-right:12px}.topbar{align-items:flex-start}.topbar .primary{font-size:0;padding:12px}.topbar .primary:first-letter{font-size:18px}.stats,.form-grid{grid-template-columns:1fr}.wide{grid-column:auto}.topbar h1{font-size:23px}.topbar>div{display:flex;flex:1;flex-direction:column}.section-head{align-items:flex-start;flex-direction:column}}
:root{--navy:#071c3d;--navy-2:#0c326a;--blue:#1673e6;--ink:#14213d;--muted:#62708a;--line:#e5eaf2;--surface:#fff;--bg:#f3f6fb}.sidebar{width:270px;background:radial-gradient(circle at 20% 4%,#1c5eaf 0,#0a3066 28%,#061a39 76%);padding:30px 18px;box-shadow:12px 0 32px #061a391c}.brand{height:92px;display:flex;justify-content:center;align-items:center;padding:0 0 29px}.brand img{width:184px;max-width:100%;height:58px;max-height:none;object-fit:contain;filter:none;background:#fff;border-radius:9px;padding:9px 14px;box-shadow:0 9px 24px #0013334a}nav{gap:8px}nav a{padding:13px 15px;border:1px solid transparent;transition:.18s ease}nav a:hover{background:#ffffff14;border-color:#ffffff18;transform:translateX(2px)}.profile{border-top-color:#ffffff1d;padding:20px 12px 5px}.profile a{opacity:.8}.profile a:hover{opacity:1}main{margin-left:270px;width:calc(100% - 270px)}.top-actions{display:flex;align-items:center;gap:10px}.theme-toggle{border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:10px;padding:9px 12px;font:inherit;font-size:13px;font-weight:700;cursor:pointer}.card{box-shadow:0 9px 26px #0b26460a}.editor-toolbar{display:flex;gap:6px;flex-wrap:wrap;padding:10px;border:1px solid var(--line);border-bottom:0;border-radius:9px 9px 0 0;background:#f8faff}.editor-toolbar button{border:1px solid var(--line);background:white;border-radius:6px;padding:5px 9px;cursor:pointer;font-weight:700}.visual-editor{min-height:330px;padding:18px;border:1px solid var(--line);border-radius:0 0 9px 9px;background:#fff;outline:none}.visual-editor:focus{border-color:var(--blue);box-shadow:0 0 0 3px #1673e621}.source-editor{display:none}.source-editor.is-visible{display:block}.field-row{display:grid;grid-template-columns:1.2fr 1fr .7fr auto;gap:9px;margin:9px 0}.custom-fields{padding:14px;background:#f8faff;border:1px solid var(--line);border-radius:9px}.custom-fields h3{margin:0 0 6px;font-size:15px}body.dark{--ink:#eef4ff;--muted:#a7b3c8;--line:#253653;--surface:#101d33;--bg:#091426}body.dark .sidebar{background:radial-gradient(circle at 20% 4%,#235aa0,#0b254b 28%,#050d1b 76%)}body.dark input,body.dark select,body.dark textarea,body.dark .visual-editor{background:#0d192d;color:var(--ink);border-color:#2a3d5d}body.dark .editor-toolbar,body.dark .custom-fields{background:#12213a}body.dark .editor-toolbar button{background:#1b2d49;color:var(--ink);border-color:#344866}body.dark .secondary{background:#17335c;color:#bcd6ff}body.dark .badge.off{background:#26344b;color:#cbd5e1}body.dark .theme-toggle{background:#172741;color:var(--ink);border-color:#334967}@media(max-width:780px){.top-actions{gap:6px}.theme-toggle span{display:none}.theme-toggle{padding:10px}.field-row{grid-template-columns:1fr}.brand img{width:165px}}
.nav-icon{width:19px;height:19px;vertical-align:-4px;margin-right:10px;opacity:.88}.profile{display:flex;gap:10px;align-items:flex-start}.profile-avatar{padding-top:2px}.avatar{width:38px;height:38px;border-radius:50%;object-fit:cover;display:inline-grid;place-items:center;border:2px solid #ffffff44}.avatar-initials{background:linear-gradient(135deg,#4da4ff,#735cff);color:#fff;font-weight:800}.profile b{padding-top:1px}.actions{align-items:center;flex-wrap:wrap}.actions form{margin:0}.actions .button{height:42px;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap}.user-line{display:flex;align-items:center;gap:10px}.user-line .avatar{border-color:var(--line)}.user-mini{display:flex;gap:9px;align-items:center;margin-top:10px}.user-mini .avatar{border-color:var(--line);width:30px;height:30px}.history-filter{display:flex;gap:9px;align-items:center;flex-wrap:wrap}.details{max-width:280px;white-space:normal;font-size:13px;color:var(--muted)}
.actions input[type="password"]{width:175px;height:42px;padding:8px 10px}.actions{min-width:410px}
.template-actions{min-width:180px}.template-actions>.actions{min-width:0;flex-wrap:nowrap}.icon-button{width:38px;height:38px;border:0;border-radius:9px;background:#173d76;color:#d9e9ff;display:inline-grid;place-items:center;text-decoration:none;font-size:20px;cursor:pointer}.icon-button svg{width:19px;height:19px}.icon-button:hover{background:#2461b5;color:#fff}.icon-button.danger{background:#4b2934;color:#ffdbe0}.icon-button.danger:hover{background:#a73b50;color:#fff}.switch{display:inline-flex;align-items:center;cursor:pointer;margin:0}.switch input{display:none}.switch span{width:42px;height:24px;border-radius:99px;background:#53627b;position:relative;transition:.2s}.switch span:after{content:"";position:absolute;width:18px;height:18px;border-radius:50%;left:3px;top:3px;background:#fff;transition:.2s;box-shadow:0 1px 4px #0005}.switch input:checked+span{background:#18a866}.switch input:checked+span:after{transform:translateX(18px)}body.dark .icon-button{background:#193c70;color:#cfe0ff}body.dark .icon-button.danger{background:#592c39;color:#ffdce2}
.editor-toolbar select{width:auto;min-width:125px;padding:6px 8px;border-radius:6px;font-size:13px}
/* La cellule Actions des utilisateurs reste une cellule de tableau, pas un conteneur flex. */
td.actions{display:table-cell;min-width:0;vertical-align:middle;white-space:nowrap}td.actions>form,td.actions>a{display:inline-flex;vertical-align:middle;margin:3px 2px}td.actions>form{align-items:center;gap:8px}td.actions .button{height:40px}td.actions>form>label.button{margin:0;line-height:1}td.actions input[type="password"]{height:40px;vertical-align:middle}td.actions>a.button{align-items:center}
.template-actions .icon-button.danger{background:#d92d3d;color:#fff;box-shadow:0 5px 13px #d92d3d33}.template-actions .icon-button.danger:hover{background:#b42332;color:#fff}
.template-actions .switch.icon-button{width:38px;height:38px;padding:0;background:#173d76;justify-content:center}.template-actions .switch.icon-button span{width:24px;height:14px;background:#6e7f9a}.template-actions .switch.icon-button span:after{width:10px;height:10px;left:2px;top:2px}.template-actions .switch.icon-button input:checked+span{background:#18a866}.template-actions .switch.icon-button input:checked+span:after{transform:translateX(10px)}body.dark .template-actions .switch.icon-button{background:#193c70}
.template-tools{display:flex;gap:10px;align-items:center}.template-tools input{width:280px;height:42px}.template-tools .button{white-space:nowrap}@media(max-width:780px){.template-tools{width:100%;flex-direction:column;align-items:stretch}.template-tools input{width:100%}.template-tools .button{text-align:center}}
.history-filter select,.history-filter input{width:280px;height:42px}@media(max-width:780px){.history-filter select,.history-filter input{width:100%}}

/* Mise en page mobile et tablettes : conserver le confort du tableau de bord sans écraser les données. */
.compose-icon{display:none}
@media(max-width:1100px){
  body{overflow-x:hidden}
  .sidebar{transform:translateX(-100%);transition:transform .22s ease;z-index:20;width:min(86vw,320px);box-shadow:12px 0 30px #06152d55}
  .nav-open .sidebar{transform:translateX(0)}
  .nav-open:after{display:none}
  main{margin-left:0;width:100%;padding:22px 18px}
  .topbar{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;margin-bottom:24px}
  .menu{display:block;border:0;background:transparent;color:var(--ink);font-size:24px;line-height:1;padding:8px;margin:0}
  .topbar>div:not(.top-actions){min-width:0}
  .topbar h1{font-size:25px;line-height:1.08;margin-top:3px;overflow-wrap:anywhere}
  .top-actions{display:flex!important;flex:0 0 auto!important;flex-direction:row!important;align-items:center;gap:8px}
  .top-actions .theme-toggle{width:43px;height:43px;padding:0;display:grid;place-items:center}
  .top-actions .theme-toggle span{display:none}
  .topbar .primary{width:43px;height:43px;padding:0;display:grid;place-items:center;font-size:inherit}
  .topbar .primary>span{display:none}
  .topbar .primary .compose-icon{display:block;width:20px;height:20px}
  .section-head{align-items:stretch;flex-direction:column;margin:22px 0 14px}
  .section-head .button{align-self:flex-start}
  .stats,.form-grid{grid-template-columns:1fr}
  .stats{gap:13px;margin-bottom:20px}
  .wide{grid-column:auto}
  .card{padding:17px;border-radius:12px}
  .table-wrap{margin-inline:-17px;padding-inline:17px;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .table{min-width:760px}
  .table th,.table td{padding:12px 9px}
  .history-filter{width:100%;display:grid;grid-template-columns:1fr;gap:8px}
  .history-filter label{margin:0}
  .history-filter select,.history-filter input{width:100%}
  .template-tools{width:100%;flex-direction:column;align-items:stretch}
  .template-tools input{width:100%}
  .template-tools .button{text-align:center}
  .form-actions{flex-wrap:wrap}
  .preview{height:520px}
}
@media(max-width:420px){
  main{padding:18px 13px}
  .topbar{gap:7px}
  .topbar h1{font-size:22px}
  .eyebrow{font-size:10px;letter-spacing:1px}
  .card{padding:14px}
  .table-wrap{margin-inline:-14px;padding-inline:14px}
  .top-actions .theme-toggle{display:none}
}
.history-mobile-list,.dashboard-mobile-list,.templates-mobile-list{display:none}@media(max-width:780px){.history-wrap,.templates-wrap{margin-inline:0;padding-inline:14px;overflow-x:hidden}.history-desktop-table,.dashboard-desktop-table,.templates-desktop-table{display:none}.history-mobile-list,.dashboard-mobile-list,.templates-mobile-list{display:grid;gap:8px;min-width:0}.history-mobile-card{min-width:0;width:100%;overflow:hidden;border:1px solid var(--line);border-radius:10px;padding:10px 11px;background:var(--surface);font-size:12px}.history-status{width:18px;height:18px;border-radius:50%;display:inline-grid;place-items:center;vertical-align:-3px;background:#dff5e8;color:#087443;font-size:11px;font-style:normal;font-weight:900}.history-status.failed{background:#fde3e6;color:#bd2938}.history-mobile-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px 9px;color:var(--muted);min-width:0}.history-mobile-grid b,.history-mobile-grid span{min-width:0}.history-mobile-grid b,.history-mobile-grid .history-mobile-template{font-size:13px;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.history-mobile-grid .history-mobile-template{text-align:right}.history-mobile-grid span:last-child{text-align:right;white-space:nowrap}.history-mobile-values{min-width:0;max-width:100%;margin-top:7px;padding-top:7px;border-top:1px solid var(--line);color:var(--muted);font-size:11px;line-height:1.45;overflow-wrap:anywhere;word-break:break-word}.template-mobile-card{border:1px solid var(--line);border-radius:10px;padding:12px;background:var(--surface);display:grid;gap:9px}.template-mobile-card>div:first-child{display:grid;gap:2px}.template-mobile-card b{font-size:14px}.template-mobile-card small{font-size:11px}.template-mobile-line{display:grid;grid-template-columns:110px minmax(0,1fr);gap:10px;font-size:12px;align-items:start}.template-mobile-line>span:first-child{color:var(--muted)}.template-mobile-line strong{font-weight:600;overflow-wrap:anywhere}.template-mobile-state{display:none}.template-mobile-actions{padding-top:9px;border-top:1px solid var(--line);min-width:0;flex-wrap:nowrap}.template-mobile-actions .switch.icon-button{width:38px;height:38px;padding:0;background:#173d76;justify-content:center}.template-mobile-actions .switch.icon-button span{width:24px;height:14px;background:#6e7f9a}.template-mobile-actions .switch.icon-button span:after{width:10px;height:10px;left:2px;top:2px}.template-mobile-actions .switch.icon-button input:checked+span{background:#18a866}.template-mobile-actions .switch.icon-button input:checked+span:after{transform:translateX(10px)}body.dark .template-mobile-actions .switch.icon-button{background:#193c70}}
.users-mobile-list{display:none}.users-layout{grid-template-columns:minmax(0,2fr) minmax(330px,1fr)}@media(max-width:780px){.users-layout{grid-template-columns:1fr}.users-wrap{margin-inline:0;padding-inline:14px;overflow-x:hidden}.users-desktop-table{display:none}.users-mobile-list{display:grid;gap:10px}.user-mobile-card{display:grid;gap:10px;padding:12px;border:1px solid var(--line);border-radius:11px;background:var(--surface)}.user-mobile-card .user-line{align-items:center}.user-mobile-card .user-line>span:nth-child(2){min-width:0;flex:1}.user-mobile-card .user-line b,.user-mobile-card .user-line small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-mobile-meta{display:flex;justify-content:space-between;gap:10px;padding-top:8px;border-top:1px solid var(--line);font-size:12px;color:var(--muted)}.user-mobile-actions{display:flex;flex-wrap:wrap;gap:7px;align-items:center}.user-mobile-actions form{margin:0}.user-mobile-actions .button{padding:8px 10px;font-size:12px}.user-mobile-actions details{width:100%;padding-top:2px}.user-mobile-actions summary{cursor:pointer;color:var(--blue);font-weight:700;font-size:12px}.user-mobile-actions details form{display:flex;gap:7px;margin-top:8px}.user-mobile-actions details input{min-width:0;height:38px;padding:8px}.user-mobile-actions details .button{white-space:nowrap}.user-mobile-icon-action .icon-button{width:38px;height:38px;padding:0}.user-mobile-icon-action .icon-button svg{width:18px;height:18px}.user-mobile-icon-action .icon-button.danger{background:#d92d3d;color:#fff}.user-mobile-toggle{margin-left:auto!important}.user-form-card{order:2}.user-form-card form{display:grid;gap:12px}.user-form-card .form-actions{margin-top:4px}}
.template-media{margin-top:18px}.template-media h2{margin:0 0 4px;font-size:18px}.template-image-upload{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:16px}.template-image-upload input[type="file"]{max-width:360px;padding:8px}.template-image-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(155px,1fr));gap:12px;margin-top:18px}.template-image-gallery article{display:grid;gap:8px;padding:8px;border:1px solid var(--line);border-radius:9px}.template-image-gallery img{width:100%;height:105px;object-fit:cover;border-radius:6px;background:#eef2f7}.template-image-gallery .button{width:100%;text-align:center;padding:8px 10px}.template-image-gallery form{margin:0}@media(max-width:780px){.template-image-upload{align-items:stretch}.template-image-upload input[type="file"]{max-width:none;width:100%}.template-image-upload .button{text-align:center}.template-image-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}}
.history-delete form{margin:0}.history-delete .icon-button{width:34px;height:34px}.history-delete .icon-button svg,.history-mobile-delete .icon-button svg{width:17px;height:17px}.history-mobile-delete{display:flex;justify-content:flex-end;margin:8px 0 0}.history-mobile-delete .icon-button{width:32px;height:32px;padding:0}
