:root{--navy:#071e42;--blue:#17468b;--red:#ef171b;--bg:#f3f6fb;--text:#182337;--muted:#6b7890;--border:#dfe6f0;--white:#fff;--shadow:0 14px 35px rgba(16,43,84,.11)}
*{box-sizing:border-box}
body{margin:0;font-family:Inter,"Segoe UI",Arial,sans-serif;color:var(--text);background:var(--bg);line-height:1.5}
a{text-decoration:none;color:inherit}button,input,select,textarea{font:inherit}img{max-width:100%;display:block}
.admin-layout{min-height:100vh;display:grid;grid-template-columns:270px 1fr}
.sidebar{position:sticky;top:0;height:100vh;background:var(--navy);color:#fff;padding:1.3rem;display:flex;flex-direction:column;z-index:20}
.admin-brand{background:#fff;border-radius:13px;padding:.5rem;margin-bottom:1.5rem}.admin-brand img{width:100%;height:auto}
.sidebar nav{display:grid;gap:.35rem}.sidebar nav a{display:flex;align-items:center;gap:.8rem;color:#cbd8ee;padding:.9rem 1rem;border-radius:12px;font-weight:750}.sidebar nav a:hover,.sidebar nav a.active{background:#173b72;color:#fff}.sidebar nav span{width:24px;text-align:center}
.sidebar-footer{margin-top:auto;border-top:1px solid rgba(255,255,255,.15);padding-top:1rem;display:grid;gap:.35rem}.sidebar-footer a{color:#cbd8ee;padding:.65rem 1rem;border-radius:10px}.sidebar-footer a:hover{background:rgba(255,255,255,.08);color:#fff}
.admin-main{min-width:0;display:flex;flex-direction:column;min-height:100vh}
.admin-topbar{height:82px;background:#fff;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 2rem;position:sticky;top:0;z-index:10}.admin-topbar>div:first-of-type{display:grid}.admin-topbar small{color:var(--muted)}.admin-topbar strong{font-size:1.2rem}.sidebar-toggle{display:none;background:none;border:0;font-size:1.7rem;color:var(--blue);cursor:pointer}.admin-user{display:flex;align-items:center;gap:.8rem}.admin-user span{font-weight:700}.admin-user b{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:var(--blue);color:#fff}
.admin-content{padding:2rem;flex:1}.admin-footer{text-align:center;color:var(--muted);padding:1rem 2rem 1.5rem}
.admin-alert{padding:1rem;border-radius:12px;margin-bottom:1rem}.admin-alert.success{background:#e9f8ee;color:#176b36;border:1px solid #bce5ca}.admin-alert.error{background:#fff0f0;color:#9f1d23;border:1px solid #f4c6c8}
.dashboard-cards{display:grid;grid-template-columns:repeat(4,1fr);gap:1.2rem;margin-bottom:1.5rem}.metric-card{background:#fff;border-radius:18px;box-shadow:var(--shadow);padding:1.4rem;border-top:4px solid var(--blue)}.metric-card:nth-child(2){border-color:var(--red)}.metric-card:nth-child(3){border-color:#f2b800}.metric-card:nth-child(4){border-color:#1b9b5f}.metric-card span{display:block;color:var(--muted);font-weight:700}.metric-card strong{display:block;font-size:2.4rem;color:var(--navy);margin:.35rem 0}.metric-card a{color:var(--blue);font-weight:800}
.panel{background:#fff;border-radius:20px;box-shadow:var(--shadow);padding:1.5rem}.panel+.panel{margin-top:1.5rem}.panel-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1.2rem}.panel-head h2{margin:0;color:var(--navy)}.panel-head p{margin:.25rem 0 0;color:var(--muted)}
.admin-btn{display:inline-flex;align-items:center;justify-content:center;background:var(--blue);color:#fff;border:0;border-radius:10px;padding:.75rem 1rem;font-weight:800;cursor:pointer;white-space:nowrap}.admin-btn:hover{background:#0f3978}.admin-btn.secondary{background:#eaf1fb;color:var(--blue)}.admin-btn.full{width:100%}
.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;min-width:760px}th,td{text-align:left;padding:.9rem .75rem;border-bottom:1px solid #edf1f6;vertical-align:middle}th{font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);background:#f8fafd}td strong{display:block}td small{display:block;color:var(--muted);margin-top:.15rem}.table-thumb{width:70px;height:52px;object-fit:cover;border-radius:9px}.table-link,.danger-link{background:none;border:0;padding:0;font-weight:800;cursor:pointer}.table-link{color:var(--blue)}.danger-link{color:#bd1f2d}.table-actions{display:flex;align-items:center;gap:.9rem}.table-actions form{margin:0}
.status{display:inline-block;padding:.3rem .65rem;border-radius:999px;font-size:.78rem;font-weight:850;background:#edf1f6;color:#526078}.status.nouvelle,.status.nouveau{background:#fff2d5;color:#8a5b00}.status.contactee,.status.lu{background:#e8f0ff;color:#194d9c}.status.confirmee,.status.traite{background:#e8f8ee;color:#176b36}.status.en-attente{background:#f0edff;color:#6043a7}.status.annulee{background:#fff0f0;color:#9f1d23}
.empty-state{text-align:center;padding:3rem 1rem;color:var(--muted)}
.filters{display:grid;grid-template-columns:2fr 1fr 1.5fr auto auto;gap:.75rem;margin-bottom:1.2rem;background:#f8fafd;padding:1rem;border-radius:14px}.compact-filters{grid-template-columns:1fr auto auto;max-width:520px}.filters input,.filters select{width:100%;border:1px solid var(--border);border-radius:10px;padding:.75rem;background:#fff}
.pagination{display:flex;gap:.4rem;flex-wrap:wrap;margin-top:1.2rem}.pagination a{width:38px;height:38px;display:grid;place-items:center;border-radius:9px;background:#edf2f8;color:var(--blue);font-weight:800}.pagination a.active{background:var(--blue);color:#fff}
.form-panel{max-width:950px}.admin-form{display:grid;gap:1rem}.admin-form.compact{gap:.9rem}.field{display:grid;gap:.4rem}.field label{font-weight:800;color:#263c60}.field input,.field select,.field textarea{width:100%;border:1px solid var(--border);border-radius:11px;padding:.85rem;background:#fff}.field textarea{resize:vertical}.field input:focus,.field select:focus,.field textarea:focus{outline:3px solid rgba(23,70,139,.12);border-color:var(--blue)}.field small,.muted{color:var(--muted)}.inline-checks{display:flex;gap:1.5rem;flex-wrap:wrap}.inline-checks label{font-weight:750}.form-actions{display:flex;gap:.8rem}.current-image{display:flex;align-items:center;gap:1rem;margin-top:.7rem}.current-image img{width:160px;height:105px;object-fit:cover;border-radius:12px}.current-image input,.inline-checks input{width:auto}.two-columns{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.admin-form hr{border:0;border-top:1px solid var(--border);width:100%}
.detail-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(300px,.8fr);gap:1.5rem;align-items:start}.detail-grid .panel{margin:0}.info-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.info-grid>div{padding:1rem;background:#f8fafd;border-radius:12px}.info-grid .wide{grid-column:1/-1}.info-grid span{display:block;color:var(--muted);font-size:.82rem;text-transform:uppercase;font-weight:800;letter-spacing:.04em}.info-grid strong,.info-grid p{margin:.25rem 0 0}.whatsapp-btn{display:block;text-align:center;background:#1ea952;color:#fff;border-radius:10px;padding:.8rem 1rem;font-weight:850;margin-top:1rem}
.login-page{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,var(--navy),var(--blue));padding:1.5rem}.login-card{width:min(460px,100%);background:#fff;border-radius:22px;box-shadow:0 25px 60px rgba(0,0,0,.25);padding:2rem}.login-card>img{max-width:330px;margin:0 auto 1.3rem}.login-kicker{text-align:center;color:var(--red);font-weight:900;text-transform:uppercase;letter-spacing:.08em;margin:0}.login-card h1{text-align:center;color:var(--navy);margin:.3rem 0 1.5rem}.login-card form{display:grid;gap:.65rem}.login-card label{font-weight:800}.login-card input{width:100%;border:1px solid var(--border);border-radius:10px;padding:.85rem;margin-bottom:.35rem}.login-links{display:flex;justify-content:space-between;margin-top:1rem;color:var(--blue);font-weight:750}
@media(max-width:1100px){.dashboard-cards{grid-template-columns:1fr 1fr}.filters{grid-template-columns:1fr 1fr}.filters input{grid-column:1/-1}.detail-grid{grid-template-columns:1fr}}
@media(max-width:800px){.admin-layout{grid-template-columns:1fr}.sidebar{position:fixed;left:-290px;width:270px;transition:.25s}.sidebar.open{left:0}.sidebar-toggle{display:block}.admin-topbar{padding:0 1rem}.admin-user span{display:none}.admin-content{padding:1rem}.panel-head{align-items:flex-start;flex-direction:column}.dashboard-cards{grid-template-columns:1fr}.filters,.compact-filters,.two-columns,.info-grid{grid-template-columns:1fr}.filters input{grid-column:auto}.info-grid .wide{grid-column:auto}.current-image{align-items:flex-start;flex-direction:column}}

/* LA CONCEM v4 : étudiants */
.dashboard-cards{grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}.metric-card:nth-child(3){border-color:#1b9b5f}.metric-card:nth-child(4){border-color:#f2b800}.metric-card:nth-child(5){border-color:#7a58c7}
.student-filters{grid-template-columns:2fr 1.4fr 1fr auto auto}.student-table-photo{width:58px;height:58px;object-fit:cover;border-radius:50%;border:3px solid #edf2f8}.panel-actions,.student-profile-actions{display:flex;gap:.65rem;flex-wrap:wrap}.candidate-summary{display:grid;grid-template-columns:170px 1fr;gap:1.3rem;align-items:start}.candidate-photo{width:170px;height:210px;object-fit:cover;border-radius:16px;background:#eaf1fb}.remove-photo{display:flex!important;align-items:center;gap:.5rem;margin-top:.45rem;font-weight:650!important;color:var(--muted)!important}.remove-photo input{width:auto!important}
.student-profile{padding:0;overflow:hidden}.student-profile-head{display:grid;grid-template-columns:220px 1fr;gap:1.8rem;align-items:center;background:linear-gradient(135deg,var(--navy),var(--blue));color:#fff;padding:2rem}.student-profile-photo{width:220px;height:270px;object-fit:cover;border-radius:18px;border:5px solid rgba(255,255,255,.22);background:#fff}.student-profile-head h1{margin:.25rem 0;font-size:clamp(1.8rem,3vw,2.8rem);line-height:1.1}.student-profile-head p{color:#dce8ff}.student-kicker{text-transform:uppercase;letter-spacing:.08em;font-size:.78rem;font-weight:850;color:#ffd25b}.student-profile-actions .secondary{background:#fff;color:var(--blue)}.student-profile-actions .print-btn{background:#ef171b}.student-sheet-grid{display:grid;grid-template-columns:1fr 1fr;gap:1.3rem;padding:1.6rem}.student-sheet-grid section{background:#f8fafd;border:1px solid var(--border);border-radius:16px;padding:1.25rem}.student-sheet-grid h2{margin:0 0 1rem;color:var(--navy);font-size:1.25rem}
@media(max-width:1100px){.student-filters{grid-template-columns:1fr 1fr}.student-filters input{grid-column:1/-1}}@media(max-width:800px){.candidate-summary,.student-profile-head,.student-sheet-grid{grid-template-columns:1fr}.candidate-photo{width:150px;height:185px}.student-profile-photo{width:170px;height:210px}.student-filters{grid-template-columns:1fr}.student-filters input{grid-column:auto}}@media print{.sidebar,.admin-topbar,.admin-footer,.student-profile-actions{display:none!important}.admin-layout{display:block}.admin-content{padding:0}.student-profile{box-shadow:none}.student-profile-head{background:#fff;color:#111;padding:1rem;border-bottom:2px solid #17468b}.student-profile-head p{color:#333}.student-kicker{color:#17468b}.student-sheet-grid{padding:1rem;gap:.7rem}.student-sheet-grid section{break-inside:avoid}.student-profile-photo{width:150px;height:185px;border:2px solid #ccc}}


/* LA CONCEM v5 : fiches étudiants plus compactes */
.candidate-summary{
  grid-template-columns:112px minmax(0,1fr);
  gap:1.1rem;
  padding:1rem;
  border:1px solid var(--border);
  border-radius:16px;
  background:linear-gradient(135deg,#f9fbfe,#f1f6fc);
}
.candidate-photo{
  width:108px;
  height:130px;
  border-radius:14px;
  border:4px solid #fff;
  box-shadow:0 8px 20px rgba(16,43,84,.14);
}
.student-table-photo{width:46px;height:46px;border-width:2px}
.student-profile{
  border:1px solid var(--border);
  border-radius:22px;
  box-shadow:0 18px 42px rgba(16,43,84,.12);
}
.student-profile-head{
  position:relative;
  grid-template-columns:128px minmax(0,1fr);
  gap:1.35rem;
  padding:1.35rem 1.55rem;
  background:linear-gradient(120deg,#071e42 0%,#17468b 72%,#235da7 100%);
  overflow:hidden;
}
.student-profile-head::after{
  content:"";
  position:absolute;
  width:260px;
  height:260px;
  right:-100px;
  top:-145px;
  border-radius:50%;
  background:rgba(255,255,255,.08);
  pointer-events:none;
}
.student-profile-head>img,.student-profile-head>div{position:relative;z-index:1}
.student-profile-photo{
  width:122px;
  height:146px;
  border-radius:15px;
  border:4px solid rgba(255,255,255,.75);
  box-shadow:0 10px 24px rgba(0,0,0,.2);
}
.student-profile-head h1{font-size:clamp(1.65rem,2.5vw,2.25rem);margin:.18rem 0 .35rem}
.student-profile-head p{margin:.25rem 0 .8rem;font-size:.94rem}
.student-kicker{font-size:.72rem}
.student-profile-actions{gap:.5rem}
.student-profile-actions .admin-btn{padding:.62rem .85rem;font-size:.88rem}
.student-sheet-grid{gap:1rem;padding:1.25rem}
.student-sheet-grid section{padding:1.05rem;border-radius:14px;box-shadow:0 5px 16px rgba(16,43,84,.04)}
.student-sheet-grid h2{font-size:1.1rem;margin-bottom:.8rem}
.student-sheet-grid .info-grid{gap:.75rem}
.student-sheet-grid .info-grid>div{padding:.82rem}

@media(max-width:800px){
  .candidate-summary{grid-template-columns:92px minmax(0,1fr);padding:.8rem}
  .candidate-photo{width:88px;height:108px}
  .student-profile-head{grid-template-columns:96px minmax(0,1fr);gap:1rem;padding:1.1rem}
  .student-profile-photo{width:92px;height:112px}
  .student-profile-head h1{font-size:1.55rem}
  .student-profile-actions{margin-top:.7rem}
}
@media(max-width:560px){
  .candidate-summary,.student-profile-head{grid-template-columns:1fr;text-align:center}
  .candidate-photo,.student-profile-photo{margin:auto}
  .student-profile-actions{justify-content:center}
  .student-sheet-grid{grid-template-columns:1fr;padding:.9rem}
}
@media print{
  .student-profile-photo{width:105px;height:125px}
  .student-profile-head{grid-template-columns:112px 1fr;padding:.8rem}
}

/* LA CONCEM v6 : aperçu d'image et progression des téléversements */
.field input[type="file"]{
  padding:.58rem;
  border-style:dashed;
  border-color:#9cb2d1;
  background:#f8fbff;
}
.field input[type="file"]::file-selector-button{
  border:0;
  border-radius:8px;
  padding:.62rem .78rem;
  margin-right:.7rem;
  background:var(--blue);
  color:#fff;
  font-weight:800;
  cursor:pointer;
}
.image-upload-widget{margin-top:.3rem}
.image-upload-preview{
  display:flex;
  align-items:center;
  gap:.75rem;
  padding:.65rem;
  border:1px solid var(--border);
  border-radius:12px;
  background:#f8fafd;
}
.image-upload-preview[hidden],.upload-progress[hidden],.image-upload-error[hidden]{display:none!important}
.image-upload-preview img{
  width:88px;
  height:68px;
  object-fit:cover;
  border-radius:9px;
  background:#e8eef7;
  box-shadow:0 5px 14px rgba(16,43,84,.1);
}
.image-upload-meta{min-width:0;display:grid;gap:.15rem}
.image-upload-name{overflow-wrap:anywhere;color:var(--navy);font-size:.88rem}
.image-upload-size{font-size:.78rem;color:var(--muted)}
.image-upload-clear{
  justify-self:start;
  margin-top:.2rem;
  border:0;
  background:transparent;
  color:#b21f2d;
  font-weight:800;
  padding:0;
  cursor:pointer;
}
.image-upload-error{margin:.35rem 0 0;color:#a41825;font-weight:750;font-size:.84rem}
.upload-progress{
  margin-top:.6rem;
  padding:.85rem;
  border:1px solid #cadcf3;
  border-radius:12px;
  background:#f4f8ff;
}
.upload-progress-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;color:var(--navy);margin-bottom:.45rem;font-size:.9rem}
.upload-progress-percent{font-weight:900;color:var(--blue)}
.upload-progress-track{height:9px;border-radius:999px;overflow:hidden;background:#dbe6f4}
.upload-progress-bar{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--blue),#2f77c7);transition:width .18s ease}
.upload-progress-text{display:block;margin-top:.4rem;color:var(--muted)}
.upload-progress.upload-progress-error{border-color:#efb7bc;background:#fff5f5}
.upload-progress.upload-progress-error .upload-progress-text{color:#a41825;font-weight:750}
.admin-btn:disabled,button:disabled,input[type="submit"]:disabled{opacity:.62;cursor:wait}
@media(max-width:560px){.image-upload-preview{align-items:flex-start}.image-upload-preview img{width:74px;height:62px}}


/* LA CONCEM v7 : statut et carte étudiant */
.student-head-line{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}
.student-state{display:inline-flex;align-items:center;justify-content:center;padding:.28rem .72rem;border-radius:999px;font-size:.75rem;font-weight:900;text-transform:uppercase;letter-spacing:.04em}
.student-state.active{background:#e8f8ee;color:#176b36}.student-state.inactive{background:#fff0f0;color:#9f1d23}
.card-btn{background:#ef171b}.card-btn:hover{background:#c91116}
.student-status-panel{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.25rem;border-bottom:1px solid var(--border);background:#f7faff}
.student-status-panel>div{display:grid;gap:.15rem}.student-status-panel>div span{color:var(--muted);font-size:.88rem}
.student-status-form{display:flex;align-items:center;gap:.65rem}.student-status-form select{min-width:130px;border:1px solid var(--border);border-radius:10px;padding:.7rem;background:#fff}
.student-filters-v7{grid-template-columns:2fr 1.35fr .8fr .8fr auto auto}

.student-card-page{min-height:100vh;background:#eaf0f8;padding:2rem;font-family:Inter,"Segoe UI",Arial,sans-serif}
.card-toolbar{display:flex;justify-content:center;gap:.8rem;flex-wrap:wrap;margin-bottom:1.5rem}
.student-card-stage{display:grid;justify-items:center;gap:1rem}
.student-id-card{width:856px;height:540px;background:#fff;border-radius:28px;box-shadow:0 25px 65px rgba(7,30,66,.22);overflow:hidden;position:relative;border:1px solid #d8e1ed}
.student-card-top{height:98px;display:flex;align-items:center;justify-content:space-between;padding:15px 28px;background:linear-gradient(115deg,#071e42,#17468b);color:#fff;font-size:24px;font-weight:950;letter-spacing:.08em}
.student-card-top img{width:280px;height:68px;object-fit:contain;background:#fff;border-radius:9px;padding:5px}
.student-card-body{height:382px;display:grid;grid-template-columns:180px 1fr 150px;gap:22px;align-items:center;padding:24px 28px;background:linear-gradient(145deg,#fff,#f5f9ff)}
.student-card-photo{width:175px;height:225px;object-fit:cover;border-radius:18px;border:5px solid #fff;box-shadow:0 12px 28px rgba(7,30,66,.18);background:#eaf1fb}
.student-card-info small{display:block;text-transform:uppercase;letter-spacing:.08em;color:#6b7890;font-weight:850;font-size:12px}.student-card-info h1{margin:4px 0 18px;color:#071e42;font-size:28px;line-height:1.08}
.student-card-data{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px}.student-card-data>div{display:grid;gap:2px}.student-card-data .wide{grid-column:1/-1}.student-card-data span{font-size:11px;text-transform:uppercase;color:#6b7890;font-weight:850}.student-card-data strong{font-size:15px;color:#182337}.student-card-status.active{color:#176b36}.student-card-status.inactive{color:#9f1d23}
.student-card-qr{display:grid;justify-items:center;gap:7px}.student-card-qr>div{width:142px;height:142px;background:#fff;padding:5px;border:1px solid #dce6f3;border-radius:10px}.student-card-qr img,.student-card-qr canvas{width:132px!important;height:132px!important}.student-card-qr small{font-size:11px;color:#6b7890;font-weight:800;text-transform:uppercase}
.student-card-bottom{height:60px;display:flex;align-items:center;justify-content:space-between;padding:0 28px;background:#ef171b;color:#fff;font-size:13px}.student-card-bottom strong{font-size:17px}
.card-help{margin:0;color:#5d6c83;text-align:center}
@media(max-width:950px){.student-card-page{padding:1rem}.student-id-card{transform-origin:top center;transform:scale(.78);margin-bottom:-115px}.student-filters-v7{grid-template-columns:1fr 1fr}.student-filters-v7 input{grid-column:1/-1}}
@media(max-width:700px){.student-status-panel{align-items:flex-start;flex-direction:column}.student-status-form{width:100%;flex-wrap:wrap}.student-status-form select{flex:1}.student-id-card{transform:scale(.5);margin-bottom:-265px}.card-help{font-size:.85rem}.student-filters-v7{grid-template-columns:1fr}.student-filters-v7 input{grid-column:auto}}
@media print{
  @page{size:85.6mm 54mm;margin:0}
  body.student-card-page{background:#fff;padding:0;margin:0}
  .card-toolbar,.card-help{display:none!important}
  .student-card-stage{display:block}
  .student-id-card{width:85.6mm;height:54mm;border-radius:0;box-shadow:none;border:0;transform:none!important;margin:0!important}
  .student-card-top{height:9.8mm;padding:1.5mm 2.8mm;font-size:2.4mm}.student-card-top img{width:28mm;height:6.8mm;border-radius:.9mm;padding:.5mm}
  .student-card-body{height:38.2mm;grid-template-columns:18mm 1fr 15mm;gap:2.2mm;padding:2.4mm 2.8mm}.student-card-photo{width:17.5mm;height:22.5mm;border-radius:1.8mm;border-width:.5mm}.student-card-info small{font-size:1.2mm}.student-card-info h1{font-size:2.8mm;margin:.4mm 0 1.8mm}.student-card-data{gap:1mm 1.6mm}.student-card-data span{font-size:1.1mm}.student-card-data strong{font-size:1.5mm}.student-card-qr>div{width:14.2mm;height:14.2mm;padding:.5mm;border-radius:1mm}.student-card-qr img,.student-card-qr canvas{width:13.2mm!important;height:13.2mm!important}.student-card-qr small{font-size:1.1mm}.student-card-bottom{height:6mm;padding:0 2.8mm;font-size:1.3mm}.student-card-bottom strong{font-size:1.7mm}
}
