/* ============================================================
   AIRMES SCHOOL — Styles partagés
   ============================================================ */
:root{
  --sidebar-width:280px;--header-height:70px;
  --primary-color:#4f46e5;--primary-light:#818cf8;--primary-dark:#3730a3;
  --bg-color:#f1f5f9;--card-shadow:0 1px 3px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.04);
  --sidebar-bg:#0f172a;--sidebar-text:#94a3b8;--sidebar-active:#4f46e5;--sidebar-hover:#1e293b;
}
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  background:var(--bg-color);color:#0f172a;font-size:14px;line-height:1.5;
  -webkit-font-smoothing:antialiased}
body.login-mode{overflow:auto;display:grid;place-items:center;background:#1e3a5f;min-height:100vh;padding:24px}
body.admin-mode{overflow:hidden;height:100vh}
body.form-mode{overflow:auto;background:#f0f4f9;padding:30px 16px 60px}
button{font-family:inherit;cursor:pointer;border:none;background:none;font-size:14px}
a{color:inherit;text-decoration:none}

/* ===== LOGIN ===== */
.login-card{background:#fff;border-radius:14px;padding:38px 34px 28px;width:100%;max-width:440px;
  box-shadow:0 30px 80px rgba(0,0,0,.4);margin:0 auto}
.login-logo{text-align:center;margin-bottom:26px}
.login-logo .mark{width:56px;height:56px;border-radius:14px;background:#0f172a;
  display:grid;place-items:center;margin:0 auto 14px;font-size:26px;color:#fff}
.login-logo h1{font-size:26px;font-weight:800;color:#0f172a;letter-spacing:-.5px}
.login-logo h1 span{color:#2563eb}
.login-logo p{color:#64748b;font-size:13px;margin-top:4px}
.login-form label{font-size:13px;font-weight:600;color:#334155;margin-bottom:6px;display:block}
.login-form input{padding:11px 14px;border:1px solid #cbd5e1;border-radius:9px;width:100%;
  outline:none;margin-bottom:16px;background:#fff;transition:.15s;font-family:inherit;font-size:14px}
.login-form input:focus{border-color:#4f46e5;box-shadow:0 0 0 3px rgba(79,70,229,.12)}
.login-form .btn-login{width:100%;display:flex;align-items:center;justify-content:center;
  padding:12px;font-size:14px;background:#0f172a;color:#fff;border-radius:9px;font-weight:600;
  border:none;cursor:pointer;transition:.15s}
.login-form .btn-login:hover{background:#1e293b}
.login-remember{display:flex;align-items:center;gap:8px;font-size:13px;color:#475569;margin-bottom:20px}
.login-remember input{width:auto;margin:0;padding:0}
.demo-section{margin-top:26px;padding-top:22px;border-top:1px solid #e2e8f0}
.demo-title{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:1.2px;
  color:#94a3b8;text-align:center;margin-bottom:14px}
.demo-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.demo-acc{background:#f8fafc;border:1px solid #e2e8f0;border-radius:9px;padding:9px 10px;
  cursor:pointer;text-align:center;transition:.15s}
.demo-acc:hover{background:#eff6ff;border-color:#bfdbfe;transform:translateY(-1px)}
.demo-acc .role{font-size:10px;font-weight:700;padding:2.5px 9px;border-radius:99px;
  display:inline-block;margin-bottom:5px;letter-spacing:.3px}
.demo-acc .role.sa{background:#dbeafe;color:#1e40af}
.demo-acc .role.se{background:#cffafe;color:#0e7490}
.demo-acc .role.en{background:#dcfce7;color:#166534}
.demo-acc .role.pa{background:#fef3c7;color:#92400e}
.demo-acc .role.el{background:#f3e8ff;color:#6b21a8}
.demo-acc .id{font-size:10.5px;color:#dc2626;font-family:'Courier New',monospace;
  word-break:break-all;line-height:1.3}

/* ===== ADMIN LAYOUT ===== */
.sidebar{position:fixed;left:0;top:0;width:var(--sidebar-width);height:100vh;
  background:var(--sidebar-bg);color:var(--sidebar-text);z-index:1000;
  transition:all .3s ease;overflow-y:auto;overflow-x:hidden}
.sidebar::-webkit-scrollbar{width:4px}
.sidebar::-webkit-scrollbar-thumb{background:var(--sidebar-active);border-radius:4px}
.sidebar-brand{padding:20px 24px;border-bottom:1px solid rgba(255,255,255,.05);
  display:flex;align-items:center;gap:12px}
.sidebar-brand .brand-icon{width:42px;height:42px;
  background:linear-gradient(135deg,#4f46e5,#818cf8);border-radius:12px;
  display:flex;align-items:center;justify-content:center;font-size:20px;color:#fff;flex-shrink:0}
.sidebar-brand .brand-text{font-size:20px;font-weight:800;color:#fff;letter-spacing:-.5px;line-height:1.1}
.sidebar-brand .brand-text span{color:var(--primary-light)}
.sidebar-brand .brand-sub{font-size:11px;color:var(--sidebar-text);font-weight:400;
  letter-spacing:1px;text-transform:uppercase}
.sidebar-nav{padding:16px 12px}
.sidebar-nav .nav-label{font-size:11px;font-weight:600;color:#475569;
  text-transform:uppercase;letter-spacing:.8px;padding:12px 12px 8px}
.sidebar-nav .nav-item{display:flex;align-items:center;padding:10px 16px;border-radius:10px;
  color:var(--sidebar-text);text-decoration:none;font-size:14px;font-weight:500;
  transition:all .2s ease;margin-bottom:2px;cursor:pointer;gap:12px}
.sidebar-nav .nav-item:hover{background:var(--sidebar-hover);color:#fff}
.sidebar-nav .nav-item.active{background:var(--sidebar-active);color:#fff;
  box-shadow:0 4px 12px rgba(79,70,229,.3)}
.sidebar-nav .nav-item i{width:20px;font-size:16px;text-align:center;flex-shrink:0}
.sidebar-nav .nav-item .badge{margin-left:auto;background:rgba(255,255,255,.1);color:#fff;
  font-size:11px;padding:2px 10px;border-radius:20px}
.sidebar-nav .nav-item .arrow{margin-left:auto;font-size:12px;transition:transform .2s ease}
.sidebar-nav .nav-item .arrow.open{transform:rotate(180deg)}
.sidebar-nav .sub-menu{padding-left:28px;max-height:0;overflow:hidden;transition:max-height .3s ease}
.sidebar-nav .sub-menu.open{max-height:500px}
.sidebar-nav .sub-menu .nav-item{font-size:13px;padding:8px 16px;font-weight:400}
.main-content{margin-left:var(--sidebar-width);height:100vh;display:flex;flex-direction:column}
.header{height:var(--header-height);background:#fff;border-bottom:1px solid #e2e8f0;
  padding:0 32px;display:flex;align-items:center;justify-content:space-between;
  flex-shrink:0;position:sticky;top:0;z-index:100}
.header-left{display:flex;align-items:center;gap:16px}
.header-left .toggle-sidebar{display:none;background:none;border:none;font-size:20px;
  color:#475569;cursor:pointer}
.header-left .page-title h4{font-weight:600;color:#0f172a;margin:0;font-size:20px}
.header-left .page-title span{font-size:13px;color:#94a3b8}
.header-right{display:flex;align-items:center;gap:20px}
.header-right .search-box{position:relative}
.header-right .search-box input{padding:8px 16px 8px 40px;border-radius:10px;
  border:2px solid #e2e8f0;background:#f8fafc;font-size:14px;width:240px;
  transition:all .3s ease;font-family:inherit;outline:none}
.header-right .search-box input:focus{border-color:var(--primary-color);background:#fff;width:280px}
.header-right .search-box i{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:#94a3b8}
.header-right .notification-btn,.header-right .message-btn,.header-right .help-modal-btn{
  position:relative;background:none;border:none;font-size:20px;color:#475569;cursor:pointer;
  padding:4px;border-radius:8px;transition:.2s;text-decoration:none}
.header-right .notification-btn:hover,.header-right .message-btn:hover,.header-right .help-modal-btn:hover{
  background:#f1f5f9;color:var(--primary-color)}
.header-right .notification-btn .dot{position:absolute;top:-2px;right:-2px;width:8px;height:8px;
  background:#ef4444;border-radius:50%;border:2px solid #fff}
.header-right .user-profile{display:flex;align-items:center;gap:10px;cursor:pointer;
  padding:6px 12px;border-radius:10px;transition:.2s}
.header-right .user-profile:hover{background:#f1f5f9}
.header-right .user-profile .avatar{width:36px;height:36px;border-radius:50%;
  background:linear-gradient(135deg,#4f46e5,#818cf8);display:flex;align-items:center;
  justify-content:center;color:#fff;font-weight:600;font-size:14px}
.header-right .user-profile .user-info{line-height:1.3}
.header-right .user-profile .user-info .name{font-size:14px;font-weight:600;color:#0f172a}
.header-right .user-profile .user-info .role{font-size:12px;color:#94a3b8}
.page-content{flex:1;padding:24px 32px;overflow-y:auto}
.page-content::-webkit-scrollbar{width:4px}
.page-content::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:4px}

/* ===== CARDS ===== */
.stat-card-modern{background:#fff;border-radius:16px;padding:20px 24px;
  box-shadow:var(--card-shadow);transition:.3s;display:flex;align-items:center;
  gap:16px;height:100%;border:1px solid rgba(0,0,0,.04)}
.stat-card-modern:hover{transform:translateY(-4px);
  box-shadow:0 8px 25px rgba(0,0,0,.08);border-color:transparent}
.stat-icon-wrapper{width:52px;height:52px;border-radius:14px;display:flex;align-items:center;
  justify-content:center;font-size:22px;flex-shrink:0}
.stat-content{flex:1;min-width:0}
.stat-value{display:block;font-size:28px;font-weight:700;color:#0f172a;line-height:1.2}
.stat-label{display:block;font-size:14px;color:#94a3b8;font-weight:500}
.stat-link{display:inline-block;font-size:12px;color:#4f46e5;text-decoration:none;
  font-weight:600;margin-top:2px;transition:.2s;cursor:pointer}
.stat-link:hover{color:#3730a3;text-decoration:underline}
.bg-primary-soft{background:#eef2ff}
.bg-success-soft{background:#dcfce7}
.bg-warning-soft{background:#fef3c7}
.bg-info-soft{background:#e0f2fe}
.card{border-radius:16px;overflow:hidden;border:1px solid rgba(0,0,0,.04) !important}
.card-header{padding:16px 24px}
.card-body{padding:20px 24px}

/* ===== PRE-INSCRIPTION ===== */
.form-container{max-width:820px;margin:0 auto;background:#fff;border-radius:12px;
  box-shadow:0 4px 24px rgba(15,23,42,.08);overflow:hidden}
.form-header{background:#2563eb;color:#fff;padding:26px 32px;text-align:center}
.form-header h2{font-size:22px;font-weight:800;margin:0 0 4px;
  display:flex;align-items:center;justify-content:center;gap:10px}
.form-header p{opacity:.92;font-size:13.5px;margin:0}
.form-body{padding:26px 32px 32px}
.form-info{background:#dbeafe;border-left:4px solid #2563eb;color:#1e40af;
  padding:12px 16px;border-radius:8px;font-size:13px;margin-bottom:22px;
  display:flex;gap:10px;align-items:flex-start}
.form-section-title{font-size:15px;font-weight:700;color:#2563eb;margin:22px 0 14px;
  display:flex;align-items:center;gap:8px}
.form-section-title:first-child{margin-top:0}
.form-label{font-size:12.5px;font-weight:600;color:#334155;margin-bottom:6px;display:block}
.form-label .req{color:#ef4444}
.form-control,.form-select{padding:10px 13px;border:1px solid #cbd5e1;border-radius:8px;
  background:#fff;width:100%;outline:none;transition:.15s;color:#0f172a;
  font-family:inherit;font-size:14px}
.form-control:focus,.form-select:focus{border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(37,99,235,.12)}
.form-check{display:flex;align-items:flex-start;gap:8px;font-size:12.5px;color:#475569;
  margin-bottom:10px}
.form-check input{margin-top:3px}
.btn-submit-form{width:100%;padding:14px;font-size:15px;background:#2563eb;color:#fff;
  border:none;border-radius:9px;font-weight:600;cursor:pointer;transition:.15s;
  display:flex;align-items:center;justify-content:center;gap:10px;font-family:inherit}
.btn-submit-form:hover{background:#1d4ed8}
.form-footer{margin-top:22px;padding-top:20px;border-top:1px solid #e2e8f0}
.form-success{text-align:center;padding:50px 32px;display:none}
.form-success.show{display:block}
.form-success .ico{width:74px;height:74px;border-radius:50%;background:#ecfdf5;
  color:#10b981;display:grid;place-items:center;font-size:36px;margin:0 auto 22px}
.form-success h2{font-size:22px;font-weight:800;margin-bottom:10px;color:#0f172a}
.form-success p{color:#64748b;max-width:440px;margin:0 auto 20px}
.form-success .ref{display:inline-block;padding:10px 22px;background:#eef2ff;
  color:#4f46e5;border-radius:9px;font-weight:800;letter-spacing:1px;font-size:16px}
.btn-secondary-custom{padding:10px 18px;border:1px solid #cbd5e1;background:#fff;
  border-radius:9px;cursor:pointer;font-family:inherit;font-size:14px;color:#334155}
.btn-primary-custom{padding:10px 18px;background:#4f46e5;color:#fff;border:none;
  border-radius:9px;cursor:pointer;font-family:inherit;font-size:14px;text-decoration:none;
  display:inline-block}

/* ===== HELP FLOATING ===== */
.help-floating{position:fixed;bottom:28px;right:28px;z-index:999}
.help-btn{background:#4f46e5;color:#fff;border:none;border-radius:50%;width:56px;height:56px;
  font-size:24px;cursor:pointer;box-shadow:0 4px 20px rgba(79,70,229,.4);
  transition:.2s;display:flex;align-items:center;justify-content:center}
.help-btn:hover{transform:scale(1.08);box-shadow:0 6px 28px rgba(79,70,229,.55)}

/* ===== TOAST ===== */
.toast-container{position:fixed;bottom:24px;right:24px;z-index:2000;display:flex;
  flex-direction:column;gap:10px}
.toast-msg{background:#0f172a;color:#fff;padding:13px 20px;border-radius:10px;
  font-size:13.5px;font-weight:500;box-shadow:0 10px 30px rgba(15,23,42,.25);
  animation:slideIn .25s;font-family:inherit}
.toast-msg.success{background:#065f46}
.toast-msg.error{background:#991b1b}
@keyframes slideIn{from{transform:translateX(30px);opacity:0}to{transform:translateX(0);opacity:1}}

/* ===== RESPONSIVE ===== */
@media(max-width:992px){
  .sidebar{transform:translateX(-100%)}
  .sidebar.open{transform:translateX(0)}
  .main-content{margin-left:0}
  .header-left .toggle-sidebar{display:block}
  .header-right .search-box input{width:160px}
  .header-right .search-box input:focus{width:200px}
}
@media(max-width:576px){
  .header{padding:0 16px}
  .page-content{padding:16px}
  .header-right .search-box input{width:120px}
  .header-right .user-profile .user-info{display:none}
  .demo-grid{grid-template-columns:1fr}
  .form-body{padding:20px}
}
.sidebar-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:999}
.sidebar-overlay.show{display:block}
/* ============================================================
   MESSAGERIE — thème sombre (scopé dans .msg-app)
   ============================================================ */
.msg-app{
  --m-bg:#0f172a;--m-bg2:#1e293b;--m-bg3:#334155;--m-hover:#293548;
  --m-active:#1e3a5f;--m-border:#334155;--m-border-l:#475569;
  --m-text:#e2e8f0;--m-muted:#94a3b8;--m-dim:#64748b;
  --m-primary:#6366f1;--m-primary-s:#818cf8;
  --m-green:#10b981;--m-green-t:#34d399;--m-red:#ef4444;--m-blue:#60a5fa;
  --m-r:14px;--m-rs:10px;
  display:flex;height:calc(100vh - 180px);min-height:600px;
  background:var(--m-bg);border-radius:var(--m-r);overflow:hidden;
  border:1px solid var(--m-border);box-shadow:0 20px 50px rgba(0,0,0,.25);
  color:var(--m-text);font-family:'Inter',sans-serif;
}
.msg-app *{box-sizing:border-box}

/* ---------- SIDEBAR ---------- */
.msg-side{width:360px;flex-shrink:0;background:var(--m-bg2);
  border-right:1px solid var(--m-border);display:flex;flex-direction:column;overflow:hidden}
.msg-filters{padding:1rem 1rem .75rem;display:flex;gap:.4rem;flex-wrap:wrap;
  border-bottom:1px solid var(--m-border)}
.msg-pill{padding:.4rem .85rem;border-radius:20px;background:rgba(255,255,255,.03);
  border:1px solid var(--m-border-l);color:var(--m-muted);font-size:.78rem;
  font-weight:500;text-decoration:none;display:inline-flex;align-items:center;
  gap:.35rem;transition:.2s;white-space:nowrap;cursor:pointer}
.msg-pill:hover{background:var(--m-hover);color:var(--m-text);border-color:var(--m-muted)}
.msg-pill.active{background:rgba(99,102,241,.18);border-color:var(--m-primary);
  color:var(--m-primary-s);font-weight:600}
.msg-pill .badge-count{background:var(--m-red);color:#fff;font-size:.65rem;
  font-weight:700;padding:.1rem .42rem;border-radius:10px;line-height:1.2}
.msg-search{padding:.75rem 1rem;border-bottom:1px solid var(--m-border)}
.msg-search input{width:100%;background:var(--m-bg3);border:1px solid transparent;
  color:var(--m-text);border-radius:var(--m-rs);padding:.55rem .9rem .55rem 2.4rem;
  font-size:.85rem;transition:.2s;outline:none;font-family:inherit;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.3-4.3'%3E%3C/path%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:.8rem center;background-size:14px}
.msg-search input:focus{border-color:var(--m-primary);background-color:var(--m-bg);
  box-shadow:0 0 0 3px rgba(99,102,241,.2)}
.msg-search input::placeholder{color:var(--m-dim)}

.msg-list{flex:1;overflow-y:auto;padding:.5rem}
.msg-list::-webkit-scrollbar{width:6px}
.msg-list::-webkit-scrollbar-thumb{background:var(--m-border-l);border-radius:4px}
.msg-conv{display:flex;align-items:flex-start;gap:.75rem;padding:.8rem;
  border-radius:var(--m-rs);cursor:pointer;margin-bottom:2px;
  border:1px solid transparent;transition:.15s}
.msg-conv:hover{background:var(--m-hover)}
.msg-conv.active{background:var(--m-active);border-color:rgba(99,102,241,.3)}
.msg-conv-av{width:42px;height:42px;border-radius:12px;display:flex;
  align-items:center;justify-content:center;color:#fff;font-size:.8rem;
  font-weight:700;flex-shrink:0;
  background:linear-gradient(135deg,var(--m-primary),var(--m-primary-s))}
.msg-conv-body{flex:1;min-width:0}
.msg-conv-top{display:flex;justify-content:space-between;align-items:baseline;
  gap:.5rem;margin-bottom:.2rem}
.msg-conv-name{color:var(--m-text);font-weight:600;font-size:.85rem;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.msg-conv-date{color:var(--m-dim);font-size:.68rem;flex-shrink:0;font-weight:500}
.msg-conv-subject{color:var(--m-text);font-size:.8rem;font-weight:500;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:.15rem}
.msg-conv-prev{color:var(--m-muted);font-size:.75rem;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis}
.msg-conv.unread .msg-conv-name,
.msg-conv.unread .msg-conv-subject{color:#fff}
.msg-conv.unread .msg-conv-prev{color:var(--m-text)}
.msg-dot{width:8px;height:8px;border-radius:50%;background:var(--m-blue);
  flex-shrink:0;margin-top:18px;box-shadow:0 0 8px rgba(96,165,250,.6)}

/* ---------- MAIN ---------- */
.msg-main{flex:1;background:var(--m-bg);display:flex;flex-direction:column;
  overflow:hidden;min-width:0}
.msg-empty{flex:1;display:flex;flex-direction:column;align-items:center;
  justify-content:center;padding:2rem;text-align:center}
.msg-empty .ico{width:88px;height:88px;display:flex;align-items:center;
  justify-content:center;color:var(--m-dim);font-size:2.5rem;margin-bottom:1.25rem;
  border:2px solid var(--m-border);border-radius:20px;background:var(--m-bg2);opacity:.7}
.msg-empty h4{color:var(--m-text);font-size:1.05rem;font-weight:500;margin-bottom:.4rem}
.msg-empty p{color:var(--m-muted);font-size:.85rem;margin:0}

.msg-head{padding:1.25rem 1.75rem;border-bottom:1px solid var(--m-border);
  display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;
  flex-wrap:wrap;background:var(--m-bg2)}
.msg-head-info{display:flex;align-items:center;gap:.9rem;min-width:0;flex:1}
.msg-head-av{width:46px;height:46px;border-radius:14px;
  background:linear-gradient(135deg,var(--m-primary),var(--m-primary-s));
  display:flex;align-items:center;justify-content:center;color:#fff;
  font-weight:700;font-size:.95rem;flex-shrink:0}
.msg-head-info h3{color:#fff;font-size:1rem;font-weight:600;margin:0 0 .15rem 0}
.msg-head-info .meta{color:var(--m-muted);font-size:.78rem;display:flex;
  align-items:center;gap:.5rem;flex-wrap:wrap}
.msg-head-info .meta .sep{color:var(--m-dim)}
.msg-head-info .meta .lu{color:var(--m-green-t)}
.msg-head-info .meta .nonlu{color:#fbbf24}
.msg-head-actions{display:flex;gap:.4rem;flex-shrink:0}
.msg-act-btn{width:36px;height:36px;border-radius:10px;
  border:1px solid var(--m-border-l);background:transparent;color:var(--m-muted);
  display:inline-flex;align-items:center;justify-content:center;cursor:pointer;
  transition:.2s;font-size:.85rem;text-decoration:none}
.msg-act-btn:hover{background:var(--m-hover);color:var(--m-text)}
.msg-act-btn.danger:hover{background:rgba(239,68,68,.15);color:var(--m-red);
  border-color:var(--m-red)}

.msg-body{flex:1;overflow-y:auto;padding:2rem 1.75rem;color:var(--m-text);
  font-size:.92rem;line-height:1.8}
.msg-body::-webkit-scrollbar{width:6px}
.msg-body::-webkit-scrollbar-thumb{background:var(--m-border-l);border-radius:4px}
.msg-body .subject{color:#fff;font-size:1.15rem;font-weight:600;margin:0 0 1.25rem 0;
  padding-bottom:1rem;border-bottom:1px solid var(--m-border)}
.msg-body .content{white-space:pre-wrap;color:#cbd5e1}

.msg-reply{padding:1rem 1.75rem;border-top:1px solid var(--m-border);
  background:var(--m-bg2);display:flex;gap:.5rem;align-items:flex-end}
.msg-reply textarea{flex:1;background:var(--m-bg3);border:1px solid transparent;
  color:var(--m-text);border-radius:var(--m-rs);padding:.65rem .9rem;font-size:.85rem;
  resize:none;min-height:42px;max-height:120px;outline:none;font-family:inherit;
  transition:.2s}
.msg-reply textarea:focus{border-color:var(--m-primary);background:var(--m-bg);
  box-shadow:0 0 0 3px rgba(99,102,241,.2)}
.msg-reply textarea::placeholder{color:var(--m-dim)}
.msg-send-btn{width:42px;height:42px;border-radius:var(--m-rs);border:none;
  background:var(--m-primary);color:#fff;display:inline-flex;align-items:center;
  justify-content:center;cursor:pointer;transition:.2s;flex-shrink:0}
.msg-send-btn:hover{background:var(--m-primary-s);transform:translateY(-1px);
  box-shadow:0 4px 12px rgba(99,102,241,.4)}

/* ---------- COMPOSE ---------- */
.msg-compose{display:flex;height:calc(100vh - 180px);min-height:620px;
  background:var(--m-bg);border-radius:var(--m-r);overflow:hidden;
  border:1px solid var(--m-border);box-shadow:0 20px 50px rgba(0,0,0,.25);
  color:var(--m-text);font-family:'Inter',sans-serif}
.msg-compose-side{width:400px;flex-shrink:0;background:var(--m-bg2);
  border-right:1px solid var(--m-border);display:flex;flex-direction:column;
  overflow:hidden}
.msg-cs-head{padding:1.25rem 1.25rem .75rem;border-bottom:1px solid var(--m-border);
  display:flex;align-items:center;justify-content:space-between;gap:.5rem}
.msg-cs-head h3{color:#fff;font-size:.95rem;font-weight:600;margin:0;
  display:flex;align-items:center;gap:.5rem}
.msg-cs-head h3 i{color:var(--m-primary-s)}
.msg-selected{background:rgba(99,102,241,.18);color:var(--m-primary-s);
  border:1px solid rgba(99,102,241,.3);font-size:.7rem;font-weight:700;
  padding:.25rem .6rem;border-radius:20px;white-space:nowrap}
.msg-cs-filters{padding:1rem;display:flex;gap:.5rem;flex-wrap:wrap;
  border-bottom:1px solid var(--m-border)}
.msg-cs-filters select{flex:1;min-width:130px;background:var(--m-bg3);
  border:1px solid transparent;color:var(--m-text);border-radius:var(--m-rs);
  padding:.5rem .75rem;font-size:.8rem;outline:none;font-family:inherit}
.msg-cs-search{padding:.75rem 1rem;border-bottom:1px solid var(--m-border)}
.msg-cs-search input{width:100%;background:var(--m-bg3);border:1px solid transparent;
  color:var(--m-text);border-radius:var(--m-rs);padding:.55rem .9rem .55rem 2.4rem;
  font-size:.85rem;outline:none;font-family:inherit;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.3-4.3'%3E%3C/path%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:.8rem center;background-size:14px}
.msg-cs-search input:focus{border-color:var(--m-primary);background-color:var(--m-bg);
  box-shadow:0 0 0 3px rgba(99,102,241,.2)}
.msg-bulk{padding:.5rem 1rem;display:flex;gap:.4rem;flex-wrap:wrap;
  border-bottom:1px solid var(--m-border)}
.msg-bulk-btn{padding:.3rem .7rem;border-radius:20px;background:transparent;
  border:1px solid var(--m-border-l);color:var(--m-muted);font-size:.72rem;
  font-weight:500;cursor:pointer;transition:.2s;display:inline-flex;
  align-items:center;gap:.3rem;font-family:inherit}
.msg-bulk-btn:hover{background:var(--m-hover);color:var(--m-text);
  border-color:var(--m-muted)}

.msg-dest-list{flex:1;overflow-y:auto;padding:.5rem}
.msg-dest-list::-webkit-scrollbar{width:6px}
.msg-dest-list::-webkit-scrollbar-thumb{background:var(--m-border-l);border-radius:4px}
.msg-dest{position:relative;display:flex;align-items:center;gap:.75rem;
  padding:.65rem .75rem;border-radius:var(--m-rs);cursor:pointer;
  transition:.15s;margin-bottom:2px;border:1px solid transparent;user-select:none}
.msg-dest:hover{background:var(--m-hover)}
.msg-dest.checked{background:var(--m-active);border-color:rgba(99,102,241,.3)}
.msg-dest input{position:absolute;opacity:0;pointer-events:none;width:0;height:0}
.msg-dest-check{width:20px;height:20px;border-radius:6px;
  border:2px solid var(--m-border-l);background:var(--m-bg3);display:flex;
  align-items:center;justify-content:center;flex-shrink:0;transition:.15s;
  color:transparent;font-size:.7rem}
.msg-dest.checked .msg-dest-check{background:var(--m-primary);
  border-color:var(--m-primary);color:#fff}
.msg-dest-av{width:38px;height:38px;border-radius:10px;display:flex;
  align-items:center;justify-content:center;color:#fff;font-size:.75rem;
  font-weight:700;flex-shrink:0;
  background:linear-gradient(135deg,var(--m-primary),var(--m-primary-s))}
.msg-dest-info{flex:1;min-width:0}
.msg-dest-name{color:var(--m-text);font-size:.85rem;font-weight:600;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:.1rem}
.msg-dest-meta{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap}
.msg-dest-type{color:var(--m-muted);font-size:.7rem;background:rgba(255,255,255,.05);
  padding:.1rem .5rem;border-radius:20px;font-weight:500}
.msg-dest-email{color:var(--m-dim);font-size:.7rem;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis}
.msg-dest-empty{padding:2rem 1rem;text-align:center;color:var(--m-muted)}
.msg-dest-empty i{font-size:2rem;color:var(--m-dim);opacity:.5;display:block;
  margin-bottom:.75rem}

.msg-compose-main{flex:1;background:var(--m-bg);display:flex;flex-direction:column;
  overflow:hidden;min-width:0}
.msg-cm-head{padding:1.25rem 1.75rem;border-bottom:1px solid var(--m-border);
  background:var(--m-bg2)}
.msg-cm-head h3{color:#fff;font-size:1.05rem;font-weight:600;margin:0 0 .15rem 0;
  display:flex;align-items:center;gap:.5rem}
.msg-cm-head h3 i{color:var(--m-primary-s)}
.msg-cm-head p{color:var(--m-muted);font-size:.78rem;margin:0}
.msg-form-body{flex:1;overflow-y:auto;padding:1.75rem;display:flex;
  flex-direction:column;gap:1.25rem}
.msg-form-body::-webkit-scrollbar{width:6px}
.msg-form-body::-webkit-scrollbar-thumb{background:var(--m-border-l);border-radius:4px}
.msg-field label{color:var(--m-text);font-size:.8rem;font-weight:600;
  text-transform:uppercase;letter-spacing:.04em;display:block;margin-bottom:.5rem}
.msg-field label i{color:var(--m-primary-s);margin-right:.35rem}
.msg-field input,.msg-field textarea{width:100%;background:var(--m-bg2);
  border:1px solid var(--m-border);color:var(--m-text);border-radius:var(--m-rs);
  padding:.75rem 1rem;font-size:.9rem;outline:none;font-family:inherit;transition:.2s}
.msg-field input:focus,.msg-field textarea:focus{background:var(--m-bg3);
  border-color:var(--m-primary);box-shadow:0 0 0 3px rgba(99,102,241,.2)}
.msg-field textarea{resize:vertical;min-height:200px;line-height:1.7}
.msg-count{text-align:right;color:var(--m-dim);font-size:.7rem;margin-top:.35rem}
.msg-compose-actions{padding:1.25rem 1.75rem;border-top:1px solid var(--m-border);
  background:var(--m-bg2);display:flex;justify-content:flex-end;gap:.75rem;
  flex-wrap:wrap}
.msg-btn-send{background:var(--m-primary);border:none;color:#fff;
  padding:.75rem 1.5rem;border-radius:var(--m-rs);font-size:.9rem;font-weight:600;
  display:inline-flex;align-items:center;gap:.5rem;cursor:pointer;
  transition:.2s;font-family:inherit}
.msg-btn-send:hover{background:var(--m-primary-s);transform:translateY(-1px);
  box-shadow:0 8px 20px rgba(99,102,241,.4)}
.msg-btn-cancel{background:transparent;border:1px solid var(--m-border-l);
  color:var(--m-muted);padding:.75rem 1.25rem;border-radius:var(--m-rs);
  font-size:.9rem;font-weight:500;display:inline-flex;align-items:center;
  gap:.5rem;cursor:pointer;transition:.2s;font-family:inherit}
.msg-btn-cancel:hover{background:var(--m-hover);color:var(--m-text);
  border-color:var(--m-muted)}
.msg-warn{margin:0 1.75rem 1rem;padding:.65rem 1rem;border-radius:var(--m-rs);
  background:rgba(251,191,36,.1);border:1px solid rgba(251,191,36,.3);
  color:#fbbf24;font-size:.8rem;display:none;align-items:center;gap:.5rem}
.msg-warn.show{display:flex}

@media(max-width:992px){
  .msg-app,.msg-compose{flex-direction:column;height:auto;min-height:500px}
  .msg-side,.msg-compose-side{width:100%;max-height:420px;border-right:none;
    border-bottom:1px solid var(--m-border)}
  .msg-main,.msg-compose-main{min-height:400px}
}

/* ============================================================
   ÉTABLISSEMENTS — grille de cartes
   ============================================================ */
.etab-toolbar{display:flex;align-items:center;justify-content:space-between;
  gap:16px;flex-wrap:wrap;margin-bottom:20px}
.etab-stats-list{display:flex;gap:22px;align-items:center;flex-wrap:wrap;
  font-size:13.5px;color:#64748b}
.etab-stats-list .item{display:inline-flex;align-items:center;gap:6px}
.etab-stats-list .item i{color:#94a3b8;font-size:14px}
.etab-stats-list .item strong{color:#0f172a;font-weight:700}
.etab-stats-list .item .badge-group{background:#eef2ff;color:#4f46e5;
  padding:2px 10px;border-radius:6px;font-weight:600;font-size:12.5px}

.etab-filter-bar{display:flex;gap:12px;margin-bottom:22px;flex-wrap:wrap}
.etab-filter-bar .search{flex:1;min-width:260px;position:relative}
.etab-filter-bar .search i{position:absolute;left:14px;top:50%;
  transform:translateY(-50%);color:#94a3b8;font-size:13px}
.etab-filter-bar .search input{width:100%;padding:10px 14px 10px 38px;
  border:1px solid #e2e8f0;background:#fff;border-radius:9px;
  outline:none;font-size:14px;color:#0f172a;transition:.15s}
.etab-filter-bar .search input:focus{border-color:#4f46e5;
  box-shadow:0 0 0 3px rgba(79,70,229,.12)}
.etab-filter-bar select{padding:10px 14px;border:1px solid #e2e8f0;
  background:#fff;border-radius:9px;outline:none;font-size:14px;
  color:#0f172a;min-width:180px;font-weight:500}
.etab-filter-bar select:focus{border-color:#4f46e5;
  box-shadow:0 0 0 3px rgba(79,70,229,.12)}

.etab-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(360px,1fr));
  gap:20px}
.etab-card{background:#fff;border-radius:16px;
  box-shadow:0 1px 3px rgba(15,23,42,.06),0 1px 2px rgba(15,23,42,.04);
  border:1px solid rgba(15,23,42,.04);transition:.25s;overflow:hidden;
  display:flex;flex-direction:column}
.etab-card:hover{transform:translateY(-4px);
  box-shadow:0 12px 32px rgba(15,23,42,.1);border-color:#c7d2fe}

.etab-head{padding:18px 20px 14px;display:flex;align-items:flex-start;
  justify-content:space-between;gap:12px}
.etab-head-left{display:flex;align-items:flex-start;gap:13px;min-width:0;flex:1}
.etab-ico{width:52px;height:52px;border-radius:13px;background:#eef2ff;
  color:#4f46e5;display:grid;place-items:center;font-size:22px;flex-shrink:0}
.etab-title{min-width:0;flex:1}
.etab-title h3{font-size:15.5px;font-weight:700;color:#0f172a;
  margin-bottom:6px;line-height:1.25;word-break:break-word}
.etab-meta{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.etab-menu{flex-shrink:0;position:relative}
.etab-menu-btn{width:32px;height:32px;border-radius:8px;
  display:grid;place-items:center;color:#94a3b8;transition:.15s;
  cursor:pointer;background:none;border:none}
.etab-menu-btn:hover{background:#f1f5f9;color:#475569}
.etab-dropdown{position:absolute;top:36px;right:0;background:#fff;
  border:1px solid #e2e8f0;border-radius:10px;
  box-shadow:0 12px 32px rgba(15,23,42,.12);min-width:210px;
  padding:6px;z-index:50;display:none}
.etab-dropdown.open{display:block}
.etab-dropdown a{display:flex;align-items:center;gap:10px;padding:9px 12px;
  border-radius:7px;font-size:13.5px;color:#334155;cursor:pointer;
  transition:.12s;font-weight:500;text-decoration:none}
.etab-dropdown a:hover{background:#f8fafc;color:#0f172a}
.etab-dropdown a i{width:16px;text-align:center;font-size:13px}
.etab-dropdown .sep{height:1px;background:#f1f5f9;margin:5px 0}
.etab-dropdown a.danger{color:#dc2626}
.etab-dropdown a.danger:hover{background:#fef2f2}

.niveau-tag{display:inline-flex;align-items:center;gap:4px;
  padding:3px 10px;border-radius:99px;font-size:11px;font-weight:600;
  border:1px solid transparent;white-space:nowrap}
.niveau-tag.maternelle{background:#fef3c7;color:#92400e;border-color:#fcd34d}
.niveau-tag.primaire{background:#d1fae5;color:#065f46;border-color:#6ee7b7}
.niveau-tag.college{background:#dbeafe;color:#1e40af;border-color:#93c5fd}
.niveau-tag.lycee{background:#fce7f3;color:#9d174d;border-color:#f9a8d4}
.niveau-tag.general{background:#f1f5f9;color:#475569;border-color:#cbd5e1}

.etab-loc{display:inline-flex;align-items:center;gap:4px;
  font-size:12px;color:#64748b}
.etab-loc i{font-size:11px;color:#94a3b8}

.etab-body{padding:0 20px 18px;display:flex;flex-direction:column;gap:16px}
.etab-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;padding-top:6px}
.etab-stat{text-align:center}
.etab-stat .ico{width:40px;height:40px;border-radius:10px;margin:0 auto 8px;
  display:grid;place-items:center;font-size:16px}
.etab-stat .ico.blue{background:#dbeafe;color:#2563eb}
.etab-stat .ico.green{background:#d1fae5;color:#059669}
.etab-stat .ico.yellow{background:#fef3c7;color:#d97706}
.etab-stat .num{font-size:20px;font-weight:800;color:#0f172a;line-height:1}
.etab-stat .num.blue{color:#2563eb}
.etab-stat .num.green{color:#059669}
.etab-stat .num.yellow{color:#d97706}
.etab-stat .lbl{font-size:10.5px;color:#94a3b8;text-transform:uppercase;
  letter-spacing:.5px;font-weight:600;margin-top:4px}

.etab-progress .row-info{display:flex;justify-content:space-between;
  font-size:12px;color:#64748b;margin-bottom:6px}
.etab-progress .row-info strong{color:#0f172a;font-weight:600}
.etab-progress .bar{height:5px;background:#e2e8f0;border-radius:99px;overflow:hidden}
.etab-progress .bar .fill{height:100%;border-radius:99px;transition:width .6s ease}
.fill.green{background:linear-gradient(90deg,#10b981,#059669)}
.fill.orange{background:linear-gradient(90deg,#f59e0b,#d97706)}
.fill.red{background:linear-gradient(90deg,#ef4444,#dc2626)}

.etab-contact{display:flex;justify-content:space-between;
  font-size:12px;color:#64748b;gap:10px;padding-top:14px;
  border-top:1px solid #f1f5f9}
.etab-contact .item{display:inline-flex;align-items:center;gap:6px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.etab-contact .item i{color:#94a3b8;font-size:12px;flex-shrink:0}

.etab-foot{display:flex;justify-content:space-between;align-items:center;
  padding:12px 20px;background:#fafbfc;border-top:1px solid #f1f5f9;
  font-size:12px;color:#94a3b8}
.etab-foot .date{display:inline-flex;align-items:center;gap:6px}
.etab-foot .badge-actif{display:inline-flex;align-items:center;gap:5px;
  background:#ecfdf5;color:#047857;padding:4px 11px;border-radius:99px;
  font-size:11.5px;font-weight:600}

/* Niveaux checkboxes (formulaire) */
.niveau-group{border:1px solid #e2e8f0;border-radius:11px;
  padding:14px;margin-bottom:12px;transition:.15s}
.niveau-group:hover{border-color:#c7d2fe}
.niveau-group.maternelle{border-left:4px solid #f59e0b}
.niveau-group.primaire{border-left:4px solid #10b981}
.niveau-group.college{border-left:4px solid #3b82f6}
.niveau-group.lycee{border-left:4px solid #ec4899}
.niveau-group-head{display:flex;align-items:center;justify-content:space-between;
  margin-bottom:12px;gap:10px}
.niveau-group-title{font-weight:700;font-size:14px;
  display:flex;align-items:center;gap:8px}
.niveau-group-title .badge-count{background:#f1f5f9;color:#475569;
  font-size:11px;padding:2px 8px;border-radius:6px;font-weight:600}
.niveau-group-cb{display:flex;align-items:center;gap:6px;
  font-size:12px;color:#64748b;cursor:pointer;font-weight:500}
.niveau-cbs{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.niveau-cb{display:flex;align-items:center;gap:7px;cursor:pointer;
  font-size:13px;color:#334155;padding:6px 8px;border-radius:7px;transition:.12s}
.niveau-cb:hover{background:#f8fafc}
.niveau-cb input{cursor:pointer}
.niveau-cb .code{background:#f1f5f9;color:#475569;font-size:10.5px;
  font-weight:700;padding:2px 6px;border-radius:4px;letter-spacing:.3px}

@media(max-width:768px){
  .etab-grid{grid-template-columns:1fr}
  .niveau-cbs{grid-template-columns:1fr}
  .etab-contact{flex-direction:column;gap:6px}
}