/* =========================================================
   Vivro — Clean CSS (2025-09)
   - Minimal variables
   - Single-source header behavior (no 3-line wrap)
   - Requirements: left title / right badge+link
   - History: one mobile implementation (no overlap)
   ========================================================= */

/* ---------- Theme ---------- */
:root{
  --text:#0e1322;
  --muted:#6b7280;
  --bg:#fff;
  --card:#ffffffcc;
  --line:#eaecef;

  --brand:#e11d48;
  --brand-600:#dc2626;
  --brand-500:#ef4444;

  --green:#2e7d32;  --green-200:#d6f2db;
  --amber:#a85b07;  --amber-200:#fdecc8;
  --red:#b02a37;    --red-200:#f7d8db;
  --grey:#6b7280;

  --ring:rgba(225,29,72,.16);
  --shadow-1:0 6px 16px rgba(10,10,10,.06);
  --shadow-2:0 14px 28px rgba(10,10,10,.12);

  --radius-lg:18px; --radius-md:14px; --radius-sm:10px;
  --ease:cubic-bezier(.2,.7,.2,1);
  --drawer-w: 320px;
  /* runtime-populated by nav-utils based on header height */
  --header-h: 60px;
  /* iOS safe area */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Base ---------- */
*{ box-sizing:border-box }
html,body{ margin:0; padding:0 }
html{ hyphens:auto }
/* Smooth scrolling for anchor jumps; disabled with reduced motion */
html{ scroll-behavior:smooth }
body{
  color:var(--text);
  background:var(--bg);
  font-family:ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height:1.45;
}
h1,h2,h3{ margin:0; color:color-mix(in lab,var(--text) 92%, white) }
h1{ font-weight:650; font-size:clamp(1.2rem, 2.4vw, 1.6rem); line-height:1.25 }
h2{ font-weight:600; font-size:clamp(1.1rem, 2.1vw, 1.35rem); line-height:1.3 }
h3{ font-weight:600; font-size:clamp(1rem, 1.8vw, 1.2rem);  line-height:1.35 }
a{ color:inherit; text-decoration:none }
strong,b{ font-weight:600 }

.container{ width:min(1100px,92%); margin:0 auto }

/* ---------- Header (single row, no wrapping) ---------- */
.site-header{
  position:sticky; top:0; z-index:50;
  background:#fff; border-bottom:1px solid var(--line);
  backdrop-filter:blur(10px);
}
.header-inner{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px; gap:16px;
  flex-wrap: nowrap; /* prevent header items from dropping to a new line */
}
.brand{ display:flex; align-items:center; gap:10px; text-decoration:none; color:inherit; font-weight:700 }
.brand .logo{ height:28px; width:auto }
.brand-name{ font-weight:800; letter-spacing:.2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.nav-inline{
  display:none !important; /* hide desktop tabs entirely per request */
  align-items:center; gap:12px;
  flex-wrap:nowrap;                  /* keep one row */
  overflow-x:auto;                   /* gentle scroll if cramped */
  overflow-y:visible;                /* allow dropdowns to extend below */
  -ms-overflow-style:none; scrollbar-width:none;
}
.nav-inline::-webkit-scrollbar{ display:none }
.nav-inline a{
  display:inline-flex; align-items:center; line-height:1;
  padding:.5rem .75rem; border-radius:999px;
  white-space:nowrap; hyphens:none; word-break:keep-all; overflow-wrap:normal;
  border:1px solid var(--line); background:#fff;
}
.nav-inline a:hover{ background:#f6f7f8 }
.nav-inline a[aria-current="page"]{
  color:#fff; border-color:transparent;
  background:linear-gradient(180deg,var(--brand-500),var(--brand-600));
  box-shadow:0 10px 18px rgba(0,0,0,.1);
}

/* Drawer is primary nav; burger shows only on small screens */
@media (max-width: 1057px) {
  .menu-toggle { display: inline-flex !important; }
}

/* Force collapse when JS detects overflow: body.nav-collapsed toggled by nav-utils */
body.nav-collapsed .nav-inline{ display:none !important; }
body.nav-collapsed .menu-toggle{ display:inline-flex !important; }

/* Optional login button style */
.btn.btn-primary,
.nav-inline .btn.btn-primary{
  background:linear-gradient(180deg,var(--brand-500),var(--brand-600));
  color:#fff; font-weight:700; border:none;
  border-radius:999px; padding:.7rem 1.1rem;
  box-shadow:0 12px 22px rgba(239,68,68,.25);
}

/* ---------- Page Layout & Cards ---------- */
.page{ max-width:960px; margin:24px auto; padding:0 20px }
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-1);
  padding:22px 20px; margin:20px 0;
  backdrop-filter:saturate(110%) blur(6px);
  transition:transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}
.card:hover{ transform:translateY(-2px); box-shadow:var(--shadow-2); border-color:#e1e4e8 }

/* --- Sticky subheader (keeps context visible while scrolling) --- */
.sticky-sub,
.sticky-subheader{
  position: sticky;
  top: calc(var(--header-h, 60px) + 8px);
  z-index: 6;
}

/* --- Floating actions (shown on selection) --- */
.floating-actions{
  position: sticky;
  bottom: calc(10px + var(--safe-bottom));
  z-index: 7;
}

/* Elevation hint when elements are stuck */
.sticky-sub,
.sticky-subheader,
.floating-actions{
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
}

/* On mobile, disable sticky headers to save vertical space */
@media (max-width: 760px){
  .sticky-sub,
  .sticky-subheader{
    position: static;
    top: auto;
    z-index: auto;
    box-shadow: none;
  }
  /* Ensure detail panel isn't sticky on mobile */
  .detail-panel{ position: static; top: auto; }
}

/* Page progress bar (nav-utils) */
#pageProgress{
  position:fixed; left:0; top:0; height:3px; width:100%;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-600));
  transform: scaleX(0); transform-origin: left;
  opacity: 0; z-index: 2000;
  transition: transform .35s var(--ease), opacity .35s var(--ease);
}
#pageProgress.show{ transform: scaleX(.55); opacity: 1 }
#pageProgress.show.done{ transform: scaleX(1); opacity: 0; transition: transform .25s ease, opacity .45s ease .15s }

/* Mobile admin cards — selected accent using :has (safe fallback) */
.admin-card{
  background:#fff; border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow-1); padding:12px; margin:12px 0;
  transition: box-shadow .18s var(--ease), transform .18s var(--ease);
}
.admin-card:hover{ transform: translateY(-1px); box-shadow: var(--shadow-2); }
.admin-card:has(input[type="radio"]:checked){
  /* remove selector shadow/accent; keep only a subtle background */
  background:#fff7f8;
}

/* --- Clickable selectable table rows --- */
.table-admin tbody tr{ cursor: pointer; transition: background .15s var(--ease) }
.table-admin tbody tr:hover{ box-shadow: none }
.table-admin tbody tr.selected td{
  background: #fff7f8; /* subtle brand tint; remove red accent shadow */
}
.table-admin tbody tr:hover td{ background: #fafbff }

/* ---------- Forms / Inputs ---------- */
.form-row{ display:grid; grid-template-columns:180px 1fr; gap:12px; align-items:center; margin:14px 0 }
@media (max-width:760px){ .form-row{ grid-template-columns:1fr } }
.field-label{ font-weight:600 }
.text-input{
  width:100%; appearance:none; border:1px solid #e6e8eb; border-radius:12px;
  padding:12px 14px; font-size:16px; background:#fff;
  transition:border-color .2s, box-shadow .2s;
}
.text-input:focus{ outline:none; border-color:#d6d8dc; box-shadow:0 0 0 4px var(--ring) }
.hidden{ display:none !important }

/* Inline field error highlight (used for consent) */
.field-error{ border:1px solid rgba(239,68,68,.35); border-radius:12px; padding:8px; box-shadow:0 0 0 4px rgba(239,68,68,.08); }
.field-error label{ color:#b91c1c; }

/* ---------- Uploader ---------- */
.uploader-row{ display:flex; gap:12px; flex-wrap:wrap; align-items:flex-start }
.pill{
  appearance:none; border:1px solid #e6e8eb; border-radius:12px; background:#fff;
  padding:12px; font-size:15px; transition:border-color .2s, background .2s
}
.pill-lg{ min-width:160px; height:46px }
.drop{
  flex:1 1 420px; min-width:260px; min-height:120px;
  display:grid; place-items:center; text-align:center;
  background:#fff; border:2px dashed #e6e7e9; border-radius:16px; padding:16px;
  transition:border-color .2s, background .2s, box-shadow .2s
}
.drop:hover{ border-color:#d54a53; background:#fff }
.drop.dragover{ border-color:#d54a53; background:#fff5f6 }
.drop-note{ color:var(--muted); font-size:13px }

/* ---------- Buttons ---------- */
.btn{
  border:1px solid #e6e8eb; background:#fff; border-radius:12px;
  padding:10px 14px; cursor:pointer;
  transition:transform .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
  touch-action: manipulation; /* faster taps on mobile */
}
.btn:hover{ background:#f7f8f9; transform:translateY(-1px) }
.btn:focus-visible{ outline:none; box-shadow:0 0 0 4px var(--ring) }
.btn-link{ border:none; background:none; color:#374151; padding:10px 12px; cursor:pointer }
.btn-link.danger{ color:var(--red) }
/* Pressed/active state (chips and buttons) */
.badge[aria-pressed="true"], .badge.active,
.btn[aria-pressed="true"], .btn.active{
  color:#fff; border-color:transparent;
  background:linear-gradient(180deg, var(--brand-500), var(--brand-600));
  box-shadow:var(--shadow-1);
}

/* ---------- Tabs (shared) ---------- */
.tabs{
  display:flex; gap:14px; flex-wrap:wrap;
  margin:16px auto 22px; padding:0;
}
.tabs .tab{
  display:inline-flex; align-items:center; gap:.5ch;
  padding:.65rem 1.1rem;
  border:1px solid var(--line); background:#fff; color:var(--text);
  border-radius:999px; box-shadow:var(--shadow-1);
  transition:transform .18s var(--ease), background .18s var(--ease), color .18s, border-color .18s;
}
.tabs .tab:hover{ transform:translateY(-1px) }
.tabs .tab.active{
  color:#fff; border-color:transparent;
  background:linear-gradient(180deg,var(--brand-500),var(--brand-600));
  box-shadow:var(--shadow-2);
}
.page > .tabs{ max-width:960px }

/* ---------- Requirements (Pièces requises) ---------- */
/* Structure: 
   <li class="req-row">
     <div class="req-label">…</div>
     <span class="badge …">À fournir</span>
     <a class="btn-link">Ajouter un fichier</a>
   </li>
*/
.req-row{
  display:grid; grid-template-columns: minmax(220px, 1fr) auto auto;
  grid-template-areas: "title badge action";
  align-items:center; gap:12px;
  padding:12px; background:#fafafa; border:1px solid #f0f1f2; border-radius:12px;
  margin:8px 0;
}
.req-row > div:first-child{ min-width: 220px; }
.req-row .right{ display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.req-label{ grid-area:title; text-align:left; line-height:1.35; hyphens:none; word-break:normal; overflow-wrap:anywhere }
.req-row .badge{ grid-area:badge; justify-self:end; white-space:nowrap }
.req-row .btn-link{ grid-area:action; justify-self:end; display:inline-flex; align-items:center; gap:.4ch; white-space:nowrap; font-weight:600 }

/* badges */
.badge{
  display:inline-flex; align-items:center; gap:6px;
  border-radius:999px; padding:6px 10px; border:1px solid #e8e8e8; background:#fff;
}
.b-grey{ color:#374151; background:#f6f7f8; border-color:#ececec }
.b-amber{ color:#8b5e00; background:var(--amber-200); border-color:#f2d8a5 }
.b-green{ color:var(--green); background:var(--green-200); border-color:#cdebd3 }
.b-red{   color:var(--red);   background:var(--red-200);   border-color:#efc7cb }

/* ---------- Tables ---------- */
.table{ width:100%; border-collapse:separate; border-spacing:0 8px }
.table thead th{ background:#fafafa; color:var(--muted); font-weight:600 }
.table th,.table td{ padding:10px 12px; background:#fff; border:1px solid #f0f0f0 }
.table tbody tr{ box-shadow:var(--shadow-1) }
.table th:first-child,.table td:first-child{ border-top-left-radius:10px; border-bottom-left-radius:10px }
.table th:last-child,.table td:last-child{ border-top-right-radius:10px; border-bottom-right-radius:10px }
#historyTable th:last-child{ white-space:nowrap; width:120px }
#historyTable td:last-child{ white-space:nowrap }

/* Sticky table headers inside .table-wrap containers */
.table-wrap{ position:relative; overflow:auto; }
.table-admin thead th{ position:sticky; top:0; z-index:1; background:#fafafa; }

/* Zebra rows for admin/case tables (subtle) */
.table-admin tbody tr:nth-child(odd) td{ background:#fcfcfd; }
.table-admin tbody tr:hover td{ background:#f7f8fb; }
/* Allow action cell content to wrap to avoid sticking out on mobile */
.missing-card .table-admin td:last-child{ white-space:normal; }
.missing-card .table-admin td:last-child .badge-action{ max-width:100%; white-space:normal; overflow-wrap:anywhere; }

/* Avoid repeating the column header on the second table (admin files) */
body[data-page="case"] #tableAdminWrap thead,
body[data-page="admin-case"] #tableAdminWrap thead{ display:none; }

/* Requirements dragover highlight (upload/case) */
.req-row.dragover{ border-color:#d54a53; box-shadow:0 0 0 3px rgba(239,68,68,.12); }

/* Simple progress bar */
.progress{ display:flex; align-items:center; gap:10px }
.progress-track{ flex:1 1 auto; height:10px; background:#f1f2f4; border-radius:999px; overflow:hidden; border:1px solid #e5e7eb }
.progress-fill{ height:100%; background:linear-gradient(90deg,var(--green), #4caf50); width:0%; transition: width .35s var(--ease) }
.progress-label{ white-space:nowrap; font-size:12px; color:var(--muted); font-weight:600 }

/* Skeleton loader */
.skeleton{ background:#f4f5f7; border:1px solid #e6e8eb; border-radius:12px; }
.shimmer{ position:relative; overflow:hidden }
.shimmer::after{
  content:""; position:absolute; inset:0; transform:translateX(-100%);
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.55) 50%, rgba(255,255,255,0) 100%);
  animation: shimmer 1.6s infinite;
}
@keyframes shimmer{ 100%{ transform:translateX(100%); } }

/* ---------- History (single mobile implementation) ---------- */
@media (max-width: 720px){
  .history table{ border:0; width:100% }
  .history thead{ display:none !important }
  .history tbody, .history tr, .history td{ display:block !important; width:100% !important }

  .history tr{
    background:#fff; border:1px solid var(--line);
    border-radius:12px; box-shadow:var(--shadow-1);
    padding:12px; margin:12px 0;

/* Override: keep filter chips readable on white background (wins over later .chip rule) */
body[data-page="case"] label.chip,
body[data-page="admin-case"] label.chip{
  color:#374151 !important;
  background:#fff !important;
  border-color: var(--line) !important;
}
  }

  .history td{
    position:relative; padding:8px 12px 8px 116px; 
    font-size:13px; word-break:break-word; hyphens:auto;
  }
  .history td::before{
    content: attr(data-label);               /* use data-label if present */
    position:absolute; left:12px; top:8px; width:92px;
    font-weight:600; color:var(--muted); white-space:nowrap;
  }
  /* Fallbacks if data-label is missing */
  .history td:nth-child(1)::before{ content:"Nom" }
  .history td:nth-child(2)::before{ content:"Catégorie" }
  .history td:nth-child(3)::before{ content:"Envoyé le" }
  .history td:nth-child(4)::before{ content:"Statut" }
  .history td:nth-child(3){ white-space:nowrap } /* keep date tidy */
}

/* ---------- Utilities ---------- */
.submit-row{ display:flex; justify-content:flex-end; margin-top:12px }
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0 }

/* small utility: single-line ellipsis */
.ellipsis{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.ellipsis-2{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; -webkit-box-orient:vertical; line-clamp:2; overflow:hidden }

/* contact links in header */
.contact-link{ display:inline-flex; align-items:center; gap:8px; color:inherit }
.contact-link .contact-text{ font-weight:600 }
.contact-link:hover{ text-decoration:underline }
.contact-icon{ width:18px; height:18px; display:inline-block; opacity:.85 }

/* case header specific tweaks */
.case-header .muted.small{ text-align:right; padding-right:6px }
.case-header #caseProgram, .case-header #caseEmail{ align-self:center }

/* prevent emails from splitting mid-token and wrap gracefully */
.case-header #caseEmail, .case-header #caseEmail .contact-text{ white-space:normal; word-break:break-word; overflow-wrap:anywhere; hyphens:none }

/* cap the candidate badge so it doesn't expand the row */
.badge.b-grey, .badge.b-user, .chip { max-width: 220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }

/* Filters chips */
label.chip{ display:inline-flex; align-items:center; gap:8px; padding:8px 12px; border:1px solid var(--line); border-radius:999px; background:#fff; font-weight:600; cursor:pointer; color:#374151 }
label.chip input{ accent-color: var(--brand-600); }

/* Detail panel */
.detail-panel{ position:sticky; top: calc(var(--header-h, 60px) + 88px); }
.detail-panel .preview{ display:grid; place-items:center; background:#fff; border:1px solid #ececec; border-radius:12px; overflow:hidden; }
.detail-panel .preview img{ max-width:100%; height:auto; display:block }
.detail-panel .preview iframe{ width:100%; height:360px; border:0 }
/* Compact status in admin tables to avoid overlap */
.table-admin td .badge{ max-width: calc(100% - 8px); display:inline-block; vertical-align:middle; overflow:hidden; text-overflow:ellipsis; }
.table-admin td .badge.b-amber{ padding:6px 8px; font-weight:600; }
/* Prevent overlap: allow wrapping in cells, but clip overflow so badge can't spill into next column */
.table-admin td{ overflow:hidden; white-space:normal; }
.table-admin td .badge + *{ margin-left:8px; }

/* Extra-narrow screens: make badges even more compact inside tables */
@media (max-width: 480px){
  .table-admin td .badge{ max-width: calc(100% - 6px); }
}

/* Desktop tables for Case/Admin-Case: give 'Statut' column a bit more space */
body[data-page="admin" ] .table-admin colgroup col:nth-child(5),
body[data-page="soumis"] .table-admin colgroup col:nth-child(4){ width: 24ch !important; }
@media (max-width: 640px){
  body[data-page="soumis"] .table-admin colgroup col:nth-child(4){ width: 20ch !important; }
}
/* Soumis: allow the Statut cell to wrap its contents (badge + button) */
body[data-page="soumis"] .table-admin td:nth-child(4),
body[data-page="soumis"] .table-admin th:nth-child(4){
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
/* Keep the badge on its own line and the link next to/under it */
body[data-page="soumis"] .table-admin td:nth-child(4){
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
body[data-page="soumis"] .table-admin td:nth-child(4) .badge{ flex: 0 0 auto; }
body[data-page="soumis"] .table-admin td:nth-child(4) .btn-missing{ flex: 0 0 auto; }
@media (max-width: 700px){
  /* On mobile, stack the link under the badge for clarity */
  body[data-page="soumis"] .table-admin td:nth-child(4){
    flex-direction: column; align-items: flex-start;
  }
  body[data-page="soumis"] .table-admin td:nth-child(4) .btn-missing{
    padding-left: 0; margin-left: 0;
  }
}

/* ===== Soumis — Desktop-only breathing room ===== */
@media (min-width: 901px){
  /* Increase vertical spacing between rows and padding inside cells */
  body[data-page="soumis"] .table-admin{ border-collapse: separate; border-spacing: 0 12px; }
  body[data-page="soumis"] .table-admin th,
  body[data-page="soumis"] .table-admin td{ padding: 14px 16px; }
  body[data-page="soumis"] .table-admin tbody tr td{ line-height: 1.45; }

  /* Widen ID column (2) on desktop so fewer ellipses */
  body[data-page="soumis"] .table-admin colgroup col:nth-child(2){ width: 14ch !important; }
  body[data-page="soumis"] #casesTable th:nth-child(2),
  body[data-page="soumis"] #casesTable td:nth-child(2){
    width: 12ch !important; min-width: 12ch; white-space: nowrap;
  }

  /* Give the Statut column more width on desktop to avoid crowding */
  body[data-page="soumis"] .table-admin colgroup col:nth-child(4){ width: 30ch !important; }
  body[data-page="soumis"] #casesTable th:nth-child(4),
  body[data-page="soumis"] #casesTable td:nth-child(4){ width: 30ch !important; }

  /* Make the status cell read comfortably: stack badge + link even on desktop */
  body[data-page="soumis"] .table-admin td:nth-child(4){ flex-direction: column; align-items: flex-start; gap: 6px; }
  body[data-page="soumis"] .table-admin td:nth-child(4) .badge{ padding: 7px 12px; white-space: nowrap; }
  body[data-page="soumis"] .table-admin td:nth-child(4) .btn-missing{ color:#374151; font-weight:600; }

  /* Slightly larger program text for readability */
  body[data-page="soumis"] .table-admin td:nth-child(3){ font-size: 15px; }
}

/* Admin: allow the Statut cell (5th col) to wrap badge + link and avoid overlap */
body[data-page="admin"] .table-admin td:nth-child(5),
body[data-page="admin"] .table-admin th:nth-child(5){
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
body[data-page="admin"] .table-admin td:nth-child(5){
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
}
body[data-page="admin"] .table-admin td:nth-child(5) .badge{ flex: 0 0 auto; }
body[data-page="admin"] .table-admin td:nth-child(5) .btn-missing{ flex: 0 0 auto; }
@media (max-width: 700px){
  /* On small screens, stack the link under the badge */
  body[data-page="admin"] .table-admin td:nth-child(5){ flex-direction: column; align-items: flex-start; }
  body[data-page="admin"] .table-admin td:nth-child(5) .btn-missing{ padding-left: 0; margin-left: 0; }
}
@media (min-width: 901px){
  /* Slightly widen the Admin Statut column on desktop and keep badge on one line */
  body[data-page="admin"] .table-admin colgroup col:nth-child(5){ width: 28ch !important; }
  body[data-page="admin"] .table-admin td:nth-child(5) .badge{ white-space: nowrap; }
}

/* On smaller screens keep labels left-aligned so values have full width */
@media (max-width: 900px) {
  .case-header .muted.small{ text-align:left; padding-right:6px }
  /* ensure contact values don't break awkwardly */
  .case-header #caseEmail, .case-header #caseEmail .contact-text{ white-space:normal; word-break:break-word; overflow-wrap:anywhere; hyphens:none }

  /* small selection badge shown next to file selection info */
  .sel-badge{
    display:inline-block;
    width:10px; height:10px; border-radius:999px;
    background:var(--brand-500); margin-left:8px; vertical-align:middle;
    box-shadow:0 4px 10px rgba(225,29,72,.18);
    animation:sel-pulse 1.8s infinite ease-in-out;
  }
  @keyframes sel-pulse{
    0%{ transform:scale(.95); opacity:1 }
    70%{ transform:scale(1.15); opacity:.6 }
    100%{ transform:scale(.95); opacity:1 }
  }
}

/* Copy hint pill (inlined feedback) */
.copy-hint{
  display:inline-block; margin-left:8px; padding:2px 8px;
  background:#f3f4f6; border:1px solid #e5e7eb; border-radius:999px;
  font-size:12px; color:#374151;
}

/* Tiny red indicator next to selection info when a file is selected */
#fileSelInfo::after{
  content: ""; display:none; width:10px; height:10px; margin-left:8px; border-radius:999px; background:#ef4444; box-shadow:0 4px 10px rgba(239,68,68,.25);
}
body.has-file-selected #fileSelInfo::after{ display:inline-block; }

/* Back to top button */
#backToTop{
  position:fixed; right:16px; bottom:16px; z-index:1000;
  width:42px; height:42px; border-radius:999px;
  border:1px solid #e6e8eb; background:#fff; color:#111;
  display:grid; place-items:center; box-shadow: var(--shadow-1);
  opacity:0; transform: translateY(6px); pointer-events:none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
#backToTop.show{ opacity:1; transform: translateY(0); pointer-events:auto }
#backToTop svg{ width:18px; height:18px }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto }
  *, *::before, *::after{ animation: none !important; transition: none !important; }
}

/* ---------- Mobile tweaks ---------- */
@media (max-width:760px){
  .page{ padding:0 14px }
  .header-inner{ padding:10px 14px }
  .nav-inline a{ padding:6px 10px }
  .pill-lg{ min-width:150px; height:44px }
  .req-row{ gap:10px }
}
@media (max-width:700px){
  /* Requirements stack neatly (title, badge, link — all left) */
  .req-row{
    grid-template-columns:1fr;
    grid-template-areas:
      "title"
      "badge"
      "action";
    row-gap:6px; align-items:start;
  }
  .req-row .badge, .req-row .btn-link{
    justify-self:start; white-space:normal;
  }
}
/* Déposé = amber/yellow style */
.badge.depose,
.badge.status.depose {
  color: var(--amber);
  background: var(--amber-200);
  border-color: #f2d8a5;   /* subtle border to match */
}
/* ===== History (mobile, clean & collision-free) ===== */
@media (max-width: 720px){
  /* Mobile: pin radio to bottom-right only on case/admin-case pages.
     Soumis and Admin list keep radio inline in header (top-left). */
  body[data-page="admin-case"] .case-card,
  body[data-page="case"] .case-card { padding-bottom: 56px; }
  body[data-page="admin-case"] .case-card input[type="radio"],
  body[data-page="case"] .case-card input[type="radio"] {
    position:absolute; right:16px; bottom:16px; width:22px; height:22px;
  }

  /* card row */
  .history tr{
    background:#fff;
    border:1px solid var(--line);
    border-radius:12px;
    box-shadow: var(--shadow-1);
    padding:12px;
    margin:12px 0;
  }

  /* kill any desktop borders/background that bleed through */
  .history td{ 
    border:0 !important; 
    background:transparent !important; 
  }

  /* label/value grid per cell (no overlapping) */
  .history td{
    display:grid;
    grid-template-columns: 110px 1fr; /* label | value */
    align-items:start;
    column-gap:12px;
    row-gap:6px;
    padding:6px 0;
    white-space:normal;
    word-break:break-word;
    hyphens:auto;
  }
  .history td::before{
    content: attr(data-label);        /* use data-label provided in HTML */
    font-weight:600;
    color: var(--muted);
    white-space:nowrap;
  }

  /* If a cell has no data-label, show nothing (prevents duplicates) */
  .history td:not([data-label])::before{ content:'' !important; }

  /* Override any earlier nth-child fallbacks so they don't clash */
  .history td:nth-child(1)::before,
  .history td:nth-child(2)::before,
  .history td:nth-child(3)::before,
  .history td:nth-child(4)::before{ content: attr(data-label) !important; }

  /* Keep dates on one line when possible */
  .history td[data-label="Envoyé le"]{ white-space:nowrap; }
}
@media (max-width: 640px){
  .tabs{
    display:none; /* hide pills */
  }
  .tabs-select{
    display:block;
    width:100%;
    margin:12px 0;
    padding:10px 14px;
    border:1px solid var(--line);
    border-radius:12px;
    font-size:15px;
  }
}
/* --- Burger button --- */
.menu-toggle{
  display:none; position:relative;
  width:44px; height:40px;
  border:none; border-radius:12px;
  background:#fff; cursor:pointer;
  box-shadow:0 1px 0 rgba(0,0,0,.03);
}
.menu-toggle span{
  position:absolute; left:10px; right:10px; height:2px;
  background:#e5e7eb; border-radius:2px;
  transition:transform .25s, top .25s, opacity .2s;
}
.menu-toggle span:nth-child(1){ top:12px }
.menu-toggle span:nth-child(2){ top:19px }
.menu-toggle span:nth-child(3){ top:26px }
.menu-toggle[aria-expanded="true"] span:nth-child(1){ top:19px; transform:rotate(45deg) }
.menu-toggle[aria-expanded="true"] span:nth-child(2){ opacity:0 }
.menu-toggle[aria-expanded="true"] span:nth-child(3){ top:19px; transform:rotate(-45deg) }

/* --- Dark slide-over --- */
.mobile-drawer{
  position:fixed; inset:0 0 0 auto;
  width:min(86vw, 320px);
  background:#2f2f2f; color:#f3f4f6;
  border-left:1px solid rgba(255,255,255,.06);
  box-shadow:0 20px 40px rgba(0,0,0,.35);
  transform:translateX(100%);
  transition:transform .28s cubic-bezier(.2,.8,.2,1);
  display:flex; flex-direction:column; gap:8px; padding:14px;
  z-index:60;
}
.mobile-drawer a,
.mobile-drawer .btn{
  display:block; text-decoration:none;
  margin:.25rem 0; padding:.9rem 1rem;
  border-radius:12px;
  color:#f3f4f6; background:#3a3a3a;
  border:1px solid rgba(255,255,255,.08);
}
.mobile-drawer .btn.btn-primary{
  background:linear-gradient(180deg,#ef4444,#dc2626);
  color:#fff; border:none;
}
.mobile-drawer .drawer-header{
  display:flex; align-items:center; justify-content:space-between; margin-bottom:6px;
}
.drawer-close{ border:none; background:transparent; color:#f3f4f6; font-size:22px; cursor:pointer }
.mobile-drawer.open{ transform:translateX(0) }

.mobile-backdrop{
  position:fixed; inset:0; z-index:55;
  background:rgba(0,0,0,.35);
  backdrop-filter:blur(2px);
  opacity:0; pointer-events:none;
  transition:opacity .2s;
}
.mobile-backdrop.show{ opacity:1; pointer-events:auto }

/* prevent body scroll when drawer open */
body.noscroll{ overflow:hidden }

/* --- Responsive trigger: hide tabs, show burger --- */
@media (max-width: 900px){
  .nav-inline{ display:none !important; }
  .menu-toggle{ display:inline-block; }
}
/* === Drawer above header fix === */
.mobile-drawer {
  z-index: 1200 !important; /* ensure it sits above header */
}
.mobile-backdrop {
  z-index: 1100 !important; /* backdrop just below drawer */
}
/* === Vivro soft background (from Welcome) === */
:root{
  --bg: #f7f7f8;
  --bg-gradient:
    radial-gradient(1200px 600px at 10% -10%, #ffe4e6 0%, transparent 40%),
    radial-gradient(1200px 600px at 90%   0%, #fecdd3 0%, transparent 35%),
    linear-gradient(180deg, #ffffff 0%, #fafafa 65%, #f7f7f8 100%);
}

/* Utility: apply Vivro background wherever you need it */
.bg-vivro {
  background: var(--bg);
  background-image: var(--bg-gradient);
}
body {
  background: #ffffff !important;
  background-image: none !important;
}
/* === Upload / Submitted item card: responsive meta layout === */
/* Wrap the item in .upload-card (or adjust selector to yours) */
.upload-card .meta {
  display: grid;
  grid-template-columns: 140px 1fr; /* label | value on desktop */
  gap: 10px 16px;
  align-items: start;
}

.upload-card .label {
  color: var(--muted);
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.3;
  /* neutralize any old layout tricks */
  position: static !important;
  white-space: normal !important;
}

.upload-card .value {
  color: var(--ink);
  font-weight: 500;
  line-height: 1.4;
  position: static !important;
  /* long filenames wrap instead of overflowing */
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Status pill aligns under the grid on mobile, right side on desktop (optional) */
.upload-card .status {
  justify-self: start;
  margin-top: 6px;
}

@media (min-width: 641px) {
  .upload-card .status { justify-self: end; }
}

/* Mobile: stack each pair label -> value vertically */
@media (max-width: 640px) {
  .upload-card .meta {
    grid-template-columns: 1fr;     /* one column */
  }
  .upload-card .label,
  .upload-card .value {
    grid-column: 1 / -1;            /* full width */
  }
}
/* Table responsive avec labels sur mobile */
@media (max-width: 700px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { margin-bottom: 12px; border: 1px solid #eee; border-radius: 8px; background: #fff; padding: 8px; }
  .table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #555;
    margin-right: 10px;
    flex-shrink: 0;
  }
}
/* Upload: compact, non-overlapping history table */
.table { table-layout: fixed; width: 100%; }
.table th, .table td { vertical-align: middle; }

.table th:nth-child(1){ width: 44%; }   /* Nom */
.table th:nth-child(2){ width: 24%; }   /* Catégorie */
.table th:nth-child(3){ width: 20%; }   /* Envoyé le */
.table th:nth-child(4){ width: 12%; }   /* Statut */

.table td { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Mobile: stacked “label: value” layout */
@media (max-width: 640px){
  .table thead { display:none; }
  .table tr { display:grid; grid-template-columns: 1fr; gap:.35rem; padding:.5rem 0; }
  .table td { display:flex; gap:.5rem; white-space:nowrap; }
  .table td::before{
    content: attr(data-label);
    flex: 0 0 7.5rem;      /* label column */
    font-weight:600;
    color:#475569;
  }
  .table-admin td span.badge{ margin-left:auto; } /* keep status chip at end */
  .table-admin td span.badge{ max-width: 180px; }
}
/* Soumis: file list as chips */
.files-list{
  display:flex; flex-wrap:wrap; gap:8px;
  list-style:none; padding:0; margin:.25rem 0 0;
}
.file-chip{
  max-width:100%;
  padding:6px 10px; border-radius:999px;
  background:#f3f4f6; border:1px solid #e5e7eb;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  font-size: .95rem;
}
/* ==== Cards grid (Admin & Soumis) ==== */
.cards-grid,
.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 16px;
}

/* Admin: slightly wider cards to improve readability (match Soumis feel) */
body[data-page="admin"] .cards-grid{
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
/* Soumis: match Admin card width for identical mobile layout */
body[data-page="soumis"] .cards-grid{
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Soumis: CSS-level layout toggle to avoid initial flicker/duplication */
@media (max-width: 768px){
  body[data-page="soumis"] .table-wrap{ display:none !important; }
  body[data-page="soumis"] #casesTable{ display:none !important; }
  body[data-page="soumis"] #casesCards{ display:grid !important; }
}
@media (min-width: 769px){
  body[data-page="soumis"] .table-wrap{ display:none !important; }
  body[data-page="soumis"] #casesTable{ display:none !important; }
  body[data-page="soumis"] #casesCards{ display:grid !important; }
}

.case-card {
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  padding: 14px 16px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative; /* allow absolutely-positioned controls inside */
}

/* Shared card header/body layout to match Admin */
.case-card .head{
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.case-card .head label{ justify-self:start; }
.case-card .id{ font-weight:700; letter-spacing:.2px; color: var(--ink); }
.case-card .cand{ color: var(--ink); font-weight:600; text-align:right; }
.case-card .body{
  display:grid;
  grid-template-columns: 1fr auto;
  gap:10px; align-items:center;
}
.case-card .prog{ color: var(--ink); }
.case-card .status{ text-align:center; display:flex; flex-direction:column; align-items:center; gap:6px; }
.case-card .head label{ justify-self:start; display:inline-flex; align-items:center; gap:8px; padding:6px; margin:-6px 0 -6px -6px; border-radius:999px; }
.case-card input[type="radio"]{ width:20px; height:20px; }
.case-card .btn-missing{ background:none; border:0; padding:0; cursor:pointer; color:#6b7280; font-weight:600; }
.case-card .btn-missing:hover{ text-decoration: underline; }

/* Admin page specific tweaks: prefer cards over legacy table */
/* Hide legacy admin table only when cards view is active */
body[data-page="admin"].admin-cards-active #tableWrap .table-wrap { visibility: hidden; height: 0; overflow: hidden; }
/* Ensure cards are visible on admin page (override base .admin-cards {display:none}) */
body[data-page="admin"] #cardsWrap { display: grid; }
/* Keep radio selector top-left like desktop on all breakpoints */
body[data-page="admin"] .case-card .head label { justify-self: start; }
@media (max-width: 640px){
  /* Explicitly keep position static on mobile (override any global pinning) */
  body[data-page="admin"] .case-card input[type="radio"]{ position: static !important; right:auto; bottom:auto; margin: 0; }
}

/* Mobile-specific tap target padding */
@media (max-width: 720px){
  .case-card .btn-missing{ padding:8px 10px; border-radius:10px; }
}

.case-card .case-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.case-card .case-id {
  font-weight: 600;
  color: var(--ink);
}

.case-card .case-status {
  font-size: 0.9rem;
}

.case-card .status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.status-badge.ok { background: #dcfce7; color: #166534; }
.status-badge.ko { background: #fee2e2; color: #991b1b; }
.status-badge.wait { background: #fef9c3; color: #854d0e; }
.status-badge.base { background: #e0e7ff; color: #3730a3; }

.case-card dl.case-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 0;
}
.case-card dl.case-meta dt {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
}
.case-card dl.case-meta dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
}

.case-card .case-files .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.case-card .chip {
  background: #f3f4f6;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
}

.case-card .case-history .timeline {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.case-card .case-history .timeline li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}
.case-card .case-history .dot {
  width: 8px;
  height: 8px;
  background: var(--brand);
  border-radius: 50%;
  flex-shrink: 0;
}
.case-card .case-history .h-title {
  font-weight: 500;
}
.case-card .case-history .h-meta {
  font-size: 0.75rem;
  color: var(--muted);
}
/* --- Admin mobile cards: add a bit more breathing room to match Soumis --- */
@media (max-width: 760px){
  body[data-page="admin"] .cards-grid{ gap: 22px; }
  body[data-page="admin"] .case-card{
    padding: 18px 18px;   /* was ~14-16 */
    gap: 14px;            /* space between rows */
  }
  body[data-page="admin"] .case-card .head{
    gap: 12px;
    margin-bottom: 12px;
  }
  /* Slightly taller line-height for readability */
  body[data-page="admin"] .case-card .id,
  body[data-page="admin"] .case-card .cand,
  body[data-page="admin"] .case-card .prog{ line-height: 1.45; }
  /* Make the status chip a hair wider so it doesn't feel cramped */
  body[data-page="admin"] .case-card .status .badge{ padding: 7px 12px; }
}
/* ==== Mobile admin nav drawer (RIGHT, consistent with other pages) ==== */
/* Hidden on desktop, shown on small screens */
#menuBtn{ display:none; }
#navDrawer{ display:none; }
#navBackdrop{ display:none; }

@media (max-width: 900px){
  #menuBtn{ display:inline-flex; }
  #navDrawer{ display:flex; }
  #navBackdrop{ display:block; }
}

/* Off-canvas drawer shell (right aligned) */
.mobile-drawer{
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: min(var(--drawer-w), 90%);
  background: #2f2f2f;
  box-shadow: -12px 0 24px rgba(0,0,0,.18);
  transform: translateX(100%);   /* hidden by default */
  transition: transform .25s ease;
  z-index: 1200;
  pointer-events: none;
  flex-direction: column;
}
.mobile-drawer.open{
  transform: translateX(0);
  pointer-events: auto;
}

/* Backdrop behind the drawer */
.mobile-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 1100;
}

/* Desktop: keep drawer visible and disable backdrop/burger */
@media (min-width: 1060px){
  .mobile-drawer{ transform: translateX(0); pointer-events:auto; }
  .mobile-backdrop{ display:none !important; opacity:0 !important; }
  .menu-toggle{ display:none !important; }
  /* Reserve space on the right for the persistent drawer */
  body{ padding-right: var(--drawer-w); }
  #mobileMenu .drawer-close{ display:none !important; }
}
.mobile-backdrop.show{
  opacity: 1;
  pointer-events: auto;
}
/* —— Admin page: show the admin burger & enable its drawer at all widths —— */
body.admin #menuBtn {                 /* show the burger even on desktop */
  display: inline-flex !important;
}

body.admin #navDrawer {               /* drawer element exists (still off-canvas until .open) */
  display: flex !important;
}

body.admin #navBackdrop {             /* allow backdrop; still hidden until .open is added in JS */
  display: block !important;
}
/* ===== Admin table polish ===== */
.table-admin {
  width: 100%;
  table-layout: fixed;       /* keeps columns aligned */
  border-collapse: separate; /* rounded rows */
  border-spacing: 0 10px;    /* "cards" feeling */
}
.table-admin colgroup col:nth-child(1) { width: 14ch; }   /* ID   */
.table-admin colgroup col:nth-child(2) { width: 22ch; }   /* Prog */
.table-admin colgroup col:nth-child(3) { width: 28ch; }   /* Name */
.table-admin colgroup col:nth-child(4) { width: 14ch; }   /* Stat */
.table-admin colgroup col:nth-child(5) { width: 22ch; }   /* Date */
.table-admin colgroup col:nth-child(6) { width: 28ch; }   /* Actions */

.table-admin thead th {
  position: sticky; top: 0;
  background: #fff;
  z-index: 1;
  font-weight: 600;
  color: var(--muted);
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #eef0f2;
}
.table-admin tbody td {
  background: #fff;
  padding: 12px 14px;
  vertical-align: middle;
  border: 1px solid #eef0f2;
}
.table-admin tbody tr td:first-child { border-radius: 12px 0 0 12px; }
.table-admin tbody tr td:last-child  { border-radius: 0 12px 12px 0; }

.table-admin .cell-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table-admin .btn-xs { font-size: 12px; padding: 6px 8px; border-radius: 8px; }

.status-badge { padding: 4px 8px; border-radius: 999px; font-size: 12px; }
.status-badge.ok   { background:#e7f7ee; color:#1b7a42; }
.status-badge.ko   { background:#fde8ea; color:#9d1c2b; }
.status-badge.wait { background:#fff4db; color:#8a5a03; }

/* keep long names from pushing columns */
.table-admin td, .table-admin th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Reduce unwanted ellipses in radio/status and allow program to wrap */
/* 1) First column (radio) shouldn't show ellipsis */
.table-admin td.sel,
.table-admin th.sel,
.table-admin td:nth-child(1),
.table-admin th:nth-child(1){
  overflow: visible; text-overflow: clip; white-space: nowrap;
}
/* 2) Program/Name column (usually 3rd) may wrap to avoid … */
.table-admin td:nth-child(3),
.table-admin th:nth-child(3){
  white-space: normal; overflow: visible; text-overflow: clip;
}
/* 3) Status cell: avoid … trimming badges */
.table-admin td:nth-child(4),
.table-admin th:nth-child(4){
  overflow: visible; text-overflow: clip; white-space: nowrap;
}
/* 4) If a cell contains a badge, prefer no ellipsis (broad safety) */
@supports selector(:has(*)){
  .table-admin td:has(.badge),
  .table-admin td:has(.status-badge){ overflow: hidden; text-overflow: ellipsis; }
}

/* drawer file list polish */
.files-list { display: grid; gap: 8px; margin-top: 6px; }
.files-list .file { display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px 12px; background:#fafafa; border:1px solid #eef0f2; border-radius:10px; }
  /* === Admin/Admin-case: header order to match public pages === */
.site-header .brand { order: 1; }          /* logo first (left)   */
.site-header .nav-inline { order: 2; }     /* tabs in the middle  */
#menuBtn { order: 3; margin-left: auto; }  /* burger last (right) */

/* Make sure the burger is visible when it should be */
@media (max-width: 900px){
  #menuBtn{ display:inline-flex; }
}

/* Drawer/backdrop are already right-aligned; keep them above header just in case */
.mobile-drawer { z-index: 1200 !important; }
.mobile-backdrop { z-index: 1100 !important; }
/* A thin horizontal scroller so wide tables never leak */
.table-wrap { overflow-x: auto; }

/* Drawer: keep DOM order and place login right after profile */
#mobileMenu{ min-height: 100vh; display:flex; flex-direction:column; }
#mobileMenu > * { order: initial; }
#mobileMenu #loginBtnMobile,
#mobileMenu #drawerLogin{ order: initial; margin-top: 0; }
/* Removed profileLinkMobile adjacency rules */

/* ===== Minimal mobile drawer look ===== */
#mobileMenu{ gap: 0; padding: 10px 12px calc(14px + env(safe-area-inset-bottom, 0px)); }
#mobileMenu a,
#mobileMenu .btn{
  display:block;
  margin:0; padding: 12px 10px;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  color:#f3f4f6;
  box-shadow: none !important;
  text-align: left;
}
#mobileMenu a + a,
#mobileMenu a + .btn,
#mobileMenu .btn + a,
#mobileMenu .btn + .btn{ border-top:1px solid rgba(255,255,255,.08); }
#mobileMenu a:hover,
#mobileMenu .btn:hover{ background: rgba(255,255,255,.06) !important; }

/* Active page highlight in drawer */
#mobileMenu a[aria-current="page"]{
  background: rgba(255,255,255,.10) !important;
  font-weight: 700;
}

/* Minimal primary emphasis for login button (text, no gradient) */
#mobileMenu .btn.btn-primary{
  color: var(--brand-500) !important;
  font-weight: 700;
}

/* Profile link removed from drawer */

/* ===== Skip to content (accessibility) ===== */
.skip-link{
  position:absolute; left:12px; top:6px; z-index:2000;
  transform: translateY(-200%);
  background:#111; color:#fff; padding:10px 12px; border-radius:10px;
  text-decoration:none; box-shadow:0 6px 16px rgba(0,0,0,.25);
}
.skip-link:focus{ transform:translateY(0); outline:none; }

/* ===== Button loading state ===== */
.btn[aria-busy="true"], .btn.loading{
  position: relative; pointer-events: none; opacity: .85;
}
.btn[aria-busy="true"]::after, .btn.loading::after{
  content:""; position:absolute; right:10px; top:50%; width:14px; height:14px; margin-top:-7px;
  border:2px solid rgba(0,0,0,.25); border-top-color: rgba(0,0,0,.6);
  border-radius:50%; animation:spin .8s linear infinite;
}
.btn.btn-primary[aria-busy="true"]::after, .btn.btn-primary.loading::after{
  border-color: rgba(255,255,255,.35); border-top-color:#fff;
}
@keyframes spin{ to { transform: rotate(360deg); } }

/* ===== Smoothness & Transitions ===== */
@media (prefers-reduced-motion: no-preference){
  html{ scroll-behavior:smooth; }
}

/* Page fade-in/out (triggered by nav-utils) */
@keyframes pageFadeIn{ from{ opacity:0 } to{ opacity:1 } }
@keyframes pageFadeOut{ from{ opacity:1 } to{ opacity:0 } }
@media (prefers-reduced-motion: no-preference){
  body.page-in{ animation: pageFadeIn .24s var(--ease) both; }
  body.page-out{ animation: pageFadeOut .18s ease-in both; }
}

/* Top progress bar on navigation */
#pageProgress{
  position:fixed; left:0; top:0; height:2px; width:0;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-600));
  box-shadow: 0 2px 6px rgba(239,68,68,.25);
  z-index:2000; transition: width .25s ease; pointer-events:none;
}
#pageProgress.show{ width: 65%; }
#pageProgress.done{ width: 100%; transition: width .18s ease; }

/* Element reveal animation used by ui-enhancements/nav-utils */
@keyframes revealUp{ from{ opacity:0; transform: translateY(8px); } to{ opacity:1; transform:none; } }
@media (prefers-reduced-motion: no-preference){
  .reveal{ animation: revealUp .32s var(--ease) both; }
}

/* ===== Skeleton shimmer (applied to elements with [data-skeleton] via JS) ===== */
.skeleton{
  position: relative;
  overflow: hidden;
  color: transparent !important;      /* hide text while loading */
}
.skeleton > *{ visibility: hidden; }
.skeleton::after{
  content: ""; position:absolute; inset:0;
  background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(240,240,240,.9) 40%, rgba(255,255,255,.9) 50%, rgba(240,240,240,.9) 60%, rgba(0,0,0,0) 100%);
  transform: translateX(-100%);
  animation: skeleton-scan 1.1s linear infinite;
}
@keyframes skeleton-scan{ to { transform: translateX(100%); } }

/* Optional smaller lines inside skeleton blocks */
.skeleton-line{
  height: 12px; border-radius: 8px; background: #eef0f2;
}
.skeleton-line + .skeleton-line{ margin-top: 10px; }

/* ===== Accessible focus styles ===== */
:root{ --focus: #2563eb; --focus-ring: 3px; }
*:focus{ outline: none; }
*:focus-visible{
  outline: var(--focus-ring) solid var(--focus);
  outline-offset: 2px;
}
.btn:focus-visible, .text-input:focus-visible, select:focus-visible{
  box-shadow: 0 0 0 3px rgba(37,99,235,.25);
  outline: none;
}

/* ===== Alerts / Notices ===== */
.alert{ border-radius: 10px; padding: 10px 12px; }
.alert.info{ background:#eff6ff; border:1px solid #bfdbfe; color:#1e40af; }
.alert.warn{ background:#fffbeb; border:1px solid #fde68a; color:#92400e; }
.alert.err{  background:#fef2f2; border:1px solid #fecaca; color:#991b1b; }
.alert.ok{   background:#ecfdf5; border:1px solid #bbf7d0; color:#065f46; }

/* Skip to content link (nav-utils injects it) */
.skip-link{
  position:absolute; left:8px; top:-40px; z-index:1000;
  background:#111; color:#fff; padding:8px 10px; border-radius:8px; text-decoration:none;
}
.skip-link:focus{ top:8px; }

/* ===== Soft micro-interactions for header links and primary buttons ===== */
.site-header .nav-inline a,
.site-header .nav-inline .btn{
  transition: color .18s var(--ease), text-decoration-color .18s var(--ease), opacity .18s var(--ease);
  text-underline-offset: 4px;
}
.site-header .nav-inline a:hover,
.site-header .nav-inline .btn:hover{
  text-decoration: underline;
  opacity: .92;
}

/* Minimal avatar next to profile */
.avatar{
  display:inline-grid; place-items:center; margin-right:8px;
  width:22px; height:22px; border-radius:999px; font-size:12px; font-weight:700;
  background: #e5e7eb; color:#111;
}
#mobileMenu .avatar{ width:22px; height:22px; background:#4b5563; color:#f9fafb; border-radius:999px; }

/* ===== Header icon removal (minimalist links, keep brand logo) ===== */
.site-header .nav-inline a svg,
.site-header .nav-inline a img,
#mobileMenu a svg,
#mobileMenu a img{
  display: none !important;
}
.site-header .nav-inline a::before,
.site-header .nav-inline a::after,
#mobileMenu a::before,
#mobileMenu a::after{
  content: none !important;
}

/* Avatar-only profile button (no dropdown) */
.avatar-btn{ border:none; background:transparent; padding:0; cursor:default; display:inline-grid; place-items:center }
.avatar-btn .avatar{ margin-right:0 }

.btn.btn-primary{
  transition: background-color .18s var(--ease), box-shadow .18s var(--ease), transform .12s var(--ease);
}
.btn.btn-primary:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(239,68,68,.24);
}

/* Modern, compact CTA button (survey results) */
.btn-cta-modern{
  background: var(--brand-600);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  line-height: 1.1;
  box-shadow: 0 6px 16px rgba(239,68,68,.18);
  touch-action: manipulation; /* faster taps on mobile */
}
.btn-cta-modern:hover{ background: var(--brand-500); box-shadow: 0 10px 20px rgba(239,68,68,.22); transform: translateY(-1px); }
.btn-cta-modern:active{ transform: translateY(0); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
@media (max-width: 640px){
  .btn-cta-modern{ padding: 12px 16px; border-radius: 12px; }
}

/* ===== Tiny popover for "Voir les manquants" (Soumis) ===== */
.mini-popover{
  position: absolute; z-index: 1500;
  background: #fff; color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(10,10,10,.18);
  padding: 10px; min-width: 220px; max-width: 320px;
}
.mini-popover__head{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px; }
.mini-popover__head strong{ font-size:.95rem; }
.mini-popover__close{ border:none; background:transparent; cursor:pointer; font-size:18px; line-height:1; padding:2px 6px; color:#555; }
.mini-popover__list{ list-style:disc; padding-left: 18px; margin: 8px 2px; max-height: 220px; overflow:auto; }
.mini-popover__list li{ margin: 2px 0; font-size:.95rem; }
.mini-popover__foot{ display:flex; justify-content:flex-end; margin-top:8px; }
.btn-missing{ margin-left: 6px; font-size: 12px; }

/* ===== Global focus-visible for keyboard users ===== */
@media (prefers-reduced-motion: no-preference){
  a:focus-visible,
  button:focus-visible,
  .btn:focus-visible,
  .nav-inline a:focus-visible,
  #mobileMenu a:focus-visible,
  #mobileMenu .btn:focus-visible{
    outline: none;
    box-shadow: 0 0 0 3px var(--ring);
    border-radius: 10px;
  }
  #mobileMenu a:focus-visible,
  #mobileMenu .btn:focus-visible{
    background: rgba(255,255,255,.08) !important;
  }
}

/* ===== Print styles (low-risk) ===== */
@media print{
  .site-header, .mobile-drawer, .mobile-backdrop, .floating-actions, .menu-toggle{ display:none !important; }
  body{ background:#fff; }
  .page{ max-width: 100%; margin:0; padding:0; }
  .card{ box-shadow:none; border:1px solid #ddd; break-inside: avoid; }
  a[href]::after{ content: " (" attr(href) ")"; font-size: 90%; color:#555; }
}

/* Offline banner (non-intrusive) */
#offlineBanner{
  display:none;
  position: sticky;
  top: 0;
  z-index: 1200;
  background: #fef3c7; /* amber-100 */
  color: #92400e;      /* amber-800 */
  padding: 10px 14px;
  text-align: center;
  border-bottom: 1px solid #fde68a;
  font-weight: 600;
}

/* Small inline "Copié" hint */
.copy-hint{
  display:inline-block;
  margin-left:6px;
  font-size:12px;
  color:#059669; /* green-600 */
  background:#d1fae5; /* green-100 */
  padding:2px 6px;
  border-radius:999px;
}

/* ===== Subtle table row hover ===== */
.table-admin tbody tr:hover td{ background: #fafafa; }

/* ===== Minimalist header (applies to all pages) ===== */
/* Keep it clean: smaller height, text-like links, subtle current-page indicator */
.site-header{
  background:#fff;             /* solid white */
  border-bottom:1px solid #eee;/* very light divider */
  box-shadow:none;             /* no drop shadow */
  backdrop-filter:none;        /* remove blur */
}
.site-header .header-inner{
  padding:12px 16px;           /* a bit larger per request */
  gap:12px;
}
.site-header .brand .logo{ height:26px; }
.site-header .brand-name{ display:none; }

/* Inline nav becomes simple text links */
.site-header .nav-inline{ gap:10px; }
.site-header .nav-inline a{
  padding:.5rem .8rem;         /* slightly larger click target */
  border:none;                 /* remove pill border */
  background:transparent;      /* no pill bg */
  border-radius:6px;
  color:#374151;               /* neutral ink */
}
.site-header .nav-inline a:hover{
  background:transparent;      /* no hover bg */
  text-decoration:underline;   /* classic minimal hover */
}
.site-header .nav-inline a[aria-current="page"]{
  color: var(--brand-600);
  border:none; background:transparent; box-shadow:none;
  text-decoration:none;
  position:relative;
}
.site-header .nav-inline a[aria-current="page"]::after{
  content:""; position:absolute; left:10px; right:10px; bottom:4px;
  height:2px; background: var(--brand-500); border-radius:2px;
}

/* Header buttons look like links too (keep visual hierarchy low) */
.site-header .nav-inline .btn,
.site-header .btn.btn-primary,
.site-header .btn.btn-outline{
  border:none;
  background:transparent;
  color: var(--brand-600);
  box-shadow:none;
  padding:.5rem .8rem;         /* match link size */
  font-weight:600;
}
.site-header .nav-inline .btn:hover,
.site-header .btn.btn-primary:hover,
.site-header .btn.btn-outline:hover{
  text-decoration:underline;
  transform:none;              /* no lift */
}

/* Burger becomes a ghost button */
.site-header .menu-toggle{
  width:40px; height:40px;     /* keep burger balanced */
  background:transparent; border:none; box-shadow:none;
}
.site-header .menu-toggle span{ background:#cbd5e1; }

/* Keep login/profile controls inline within header; avoid accidental floating */
.site-header [data-login],
.site-header #loginBtn{
  position: static !important;
  float: none !important;
}

/* Admin table sizing tuned so “Actions” stays in view */
.table-admin { table-layout: fixed; width: 100%; border-collapse: separate; border-spacing: 0 10px; }
.table-admin colgroup col:nth-child(1){ width: 12ch; }   /* ID */
.table-admin colgroup col:nth-child(2){ width: 22ch; }   /* Programme */
.table-admin colgroup col:nth-child(3){ width: 28ch; }   /* Candidat */
.table-admin colgroup col:nth-child(4){ width: 14ch; }   /* Statut */
.table-admin colgroup col:nth-child(5){ width: 22ch; }   /* Soumis */
.table-admin colgroup col:nth-child(6){ width: 20ch; }   /* Actions: a bit tighter */

.table-admin th, .table-admin td{
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; vertical-align:middle;
}

/* Buttons inside the last cell pack nicely */
.table-admin .cell-actions{ display:flex; gap:8px; flex-wrap:wrap; }
.table-admin .btn-xs{ font-size:12px; padding:6px 8px; border-radius:8px; }

/* Mobile: turn rows into clean cards with labels */
@media (max-width: 760px){
  .table-admin thead{ display:none; }
  .table-admin, .table-admin tbody, .table-admin tr, .table-admin td{ display:block; width:100%; }
  .table-admin tr{ background:#fff; border:1px solid #eef0f2; border-radius:12px; padding:12px; margin:12px 0; }
  .table-admin td{ display:flex; gap:.6rem; white-space:normal; padding:6px 0; }
  .table-admin td::before{ content: attr(data-label); flex:0 0 7.5rem; color:#6b7280; font-weight:600; }
  .table-admin td:last-child{ display:block; } /* actions row: stack buttons */
}
/* Admin Actions col sizing & nowrap */
.table-admin colgroup col:nth-child(6){ width: 26ch; }
.table-admin th:last-child,
.table-admin td:last-child{
  white-space: nowrap;
}
.table-admin {
  width: 100%;
  table-layout: fixed; /* important → respect colgroup widths */
  border-collapse: collapse;
}

.table-admin th, 
.table-admin td {
  padding: 8px 10px; /* reduce padding */
  text-align: left;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Table sizing (already discussed) */
.table-admin { width:100%; table-layout:fixed; border-collapse:collapse; }
.table-admin th, .table-admin td {
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile cards (hidden by default, shown on small screens) */
.admin-cards { display:none; gap:12px; margin-top:10px; }
.admin-card {
  background:#fff;
  border-radius:16px;
  box-shadow: 0 6px 28px rgba(16,24,40,.08);
  padding:14px;
}
.admin-card-head { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.admin-card-id {
  font-weight:600;
}
.admin-card-sub { color:#667085; font-size:.9rem; margin-top:2px; }
.admin-card-body {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px 16px;
  margin-top:10px;
}
.admin-card-actions {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}

/* Status pill reuses your badges if present; keep a fallback */
.status-badge { display:inline-block; padding:.25rem .5rem; border-radius:999px; font-size:.85rem; }
.status-badge.wait { background:#FEF3C7; color:#92400E; }
.status-badge.ok   { background:#DCFCE7; color:#14532D; }
.status-badge.ko   { background:#FEE2E2; color:#7F1D1D; }

/* Switch at mobile width */
@media (max-width: 720px){
  /* Mobile: pin radio to bottom-right only on case/admin-case pages.
     Soumis and Admin list keep radio inline in header (top-left). */
  body[data-page="admin-case"] .case-card,
  body[data-page="case"] .case-card { padding-bottom: 56px; }
  body[data-page="admin-case"] .case-card input[type="radio"],
  body[data-page="case"] .case-card input[type="radio"] {
    position:absolute; right:16px; bottom:16px; width:22px; height:22px;
  }
  /* (removed stray declarations) */
  /* Ensure mobile file cards are visible on Admin-Case */
  body[data-page="admin-case"] #filesCardsWrap{ display:block; }
}

/* Carte latérale blanche */
.hero-card .card{
  background:#fff;        /* blanc au lieu de rose */
  color:var(--ink);       /* texte sombre */
}
.hero-card .card li{ color:var(--text); }

/* Bouton principal inversé (fond blanc, texte rouge) */
.hero .btn.btn-primary{
  background:#fff !important;
  color:var(--brand-600) !important;
  font-weight:700;
  border:1.5px solid var(--brand-600);
  box-shadow:0 6px 14px rgba(0,0,0,.1);
}
.hero .btn.btn-primary:hover{
  background:var(--brand-600) !important;
  color:#e9d5d5 !important;
}
/* Force a single solid color on the hero */
.hero{
  background-color: #9268681a !important; /* your pink/red */
  background-image: none !important;    /* kill any gradient/image */
}

/* Safety: if a pseudo-overlay exists in styles.css */
.hero::before{ content: none !important; }
/* Texte du hero en noir */
.hero,
.hero h1,
.hero h2,
.hero h3,
.hero p,
.hero li,
.hero strong {
  color: #0e1322 !important;  /* noir/gris très foncé */
}
/* Rendre les pills lisibles sur fond clair dans le hero */
.hero .pill{
  background: #ffffff !important;                      /* fond blanc */
  color: #0e1322 !important;                           /* texte sombre */
  border: 1.5px solid rgba(15,23,42,.14) !important;   /* bordure discrète */
  box-shadow: 0 6px 14px rgba(17,17,17,.06);           /* légère ombre */
}

/* Au cas où un effet global les délavent */
.hero .badges{ opacity: 1 !important; filter: none !important; }
.hero{
  background-color: #fdf5f5!important;  /* ou la couleur unique que tu veux */
  background-image: none !important;
}
.hero, .hero h1, .hero p, .hero li, .hero strong{ color:#0e1322 !important; }
/* ===== Header order (same on desktop & mobile) ===== */
.site-header .brand { order: 1; }           /* logo first (left)  */
.site-header .nav-inline { order: 2; }      /* tabs in the middle */
.menu-toggle { order: 3; margin-left: auto; }  /* burger last (right) */

/* Mobile trigger: hide tabs, show burger */
@media (max-width: 900px){
  .nav-inline { display: none !important; }
  .menu-toggle { display: inline-flex !important; }
}

/* ===== Right-side drawer behavior (always) ===== */
.mobile-drawer{
  right: 0 !important;        /* stick to right edge */
  left: auto !important;
  transform: translateX(100%) !important; /* off-canvas to the right */
}
.mobile-drawer.open{
  transform: translateX(0) !important;    /* slide IN from right */
}

/* Backdrop stays full-screen and clickable */
.mobile-backdrop{
  inset: 0 !important;
  z-index: 1100 !important;
}
/* Bigger hero heading */
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 3rem) !important;
}
/* Corrige le bouton CTA mobile */
.hero .btn.btn-primary{
  white-space: nowrap;        /* empêche la coupure */
  background: var(--brand-600) !important;  /* rouge plein */
  color: #fff !important;     /* texte blanc */
  border: none !important;
  font-weight: 700;
  padding: 0.8em 1.6em;       /* un peu plus large pour respirer */
  display: inline-flex;       /* garder comportement bouton */
  align-items: center;
  justify-content: center;
}

.hero .btn.btn-primary:hover{
  background: var(--brand-500) !important; /* rouge un peu plus clair au hover */
}
/* Welcome hero: dark text on light background */
body.welcome .hero,
body.welcome .hero .kicker,
body.welcome .hero h1,
body.welcome .hero p,
body.welcome .hero .small,
body.welcome .hero li,
body.welcome .hero span{
  color: var(--ink) !important;     /* your dark text */
  text-shadow: none !important;     /* remove the white glow */
}
/* Badges (déjà présents chez toi, rappel) */
.badge.b-green{ color:#166534; background:#dcfce7; border-color:#bbf7d0; }
.badge.b-red  { color:#991b1b; background:#fee2e2; border-color:#fecaca; }

/* Boutons actions (tons clairs) */
.btn.green{
  background:#dcfce7; color:#166534; border:1px solid #bbf7d0;
}
.btn.green:hover{ background:#bbf7d0; }

.btn.red{
  background:#fee2e2; color:#991b1b; border:1px solid #fecaca;
}
.btn.red:hover{ background:#fecaca; }
/* Admin: autoriser le retour à la ligne pour Programme & Candidat */
body[data-page="admin"] .table-admin th:nth-child(3),
body[data-page="admin"] .table-admin td:nth-child(3), /* Programme */
body[data-page="admin"] .table-admin th:nth-child(4),
body[data-page="admin"] .table-admin td:nth-child(4)  /* Nom du candidat */
{
  white-space: normal !important;      /* casse autorisée */
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: break-word;               /* coupe dans les mots si besoin */
  overflow-wrap: anywhere;              /* casse sur caractères quelconques */
}

/* Option: desserrer un peu la colonne Statut pour laisser + de place aux 2 précédentes */
body[data-page="admin"] .table-admin th:nth-child(5),
body[data-page="admin"] .table-admin td:nth-child(5){
  width: auto;                          /* pas de largeur figée */
}
/* ===== Admin mobile cards: grille header + lignes Label | Valeur ===== */
@media (max-width: 900px){
  /* La carte devient une grille: 3 colonnes pour l'entête, puis 2 colonnes Label|Valeur */
  body[data-page="admin"] #cardsWrap .card{
    display: grid;
    grid-template-columns: auto 1fr auto;   /* radio | ID (large) | badge */
    grid-auto-rows: auto;
    column-gap: 14px;
    row-gap: 10px;
    padding: 16px 18px; /* un peu plus d'air (comme Soumis) */
    border-radius: 16px;
    box-shadow: 0 6px 28px rgba(16,24,40,.08);
  }

  /* --- Entête sur la 1re ligne --- */
  body[data-page="admin"] #cardsWrap .card > :nth-child(1){  /* radio */
    grid-column: 1; grid-row: 1; align-self: center;
  }
  body[data-page="admin"] #cardsWrap .card > :nth-child(2){  /* ID */
    grid-column: 2; grid-row: 1; 
    font-weight: 600;
    min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  body[data-page="admin"] #cardsWrap .card > :nth-child(3){  /* badge */
    grid-column: 3; grid-row: 1; justify-self: end; align-self: center;
  }

  /* --- Lignes Label | Valeur (à partir du 4e enfant) --- */
  /* Les labels (4,6,8,...) à gauche */
  body[data-page="admin"] #cardsWrap .card > :nth-child(n+4):nth-child(odd){
    grid-column: 1 / 2;         /* colonne label (à gauche de la grille 2-col) */
    color: var(--muted);
    font-weight: 600;
    white-space: normal;
  }
  /* Les valeurs (5,7,9,...) à droite et qui cassent correctement */
  body[data-page="admin"] #cardsWrap .card > :nth-child(n+4):nth-child(even){
    grid-column: 2 / 4;         /* étend sur ID+badge pour donner de la place */
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
}

/* Écrans très étroits : empiler label au-dessus de valeur pour éviter la colonne vide */
@media (max-width: 520px){
  body[data-page="admin"] #cardsWrap .card{
    grid-template-columns: 1fr;         /* une seule colonne */
  }
  /* entête sur une ligne: radio | ID | badge reste sur la même ligne grâce à l'auto-flow */
  /* lignes label/valeur empilées */
  body[data-page="admin"] #cardsWrap .card > :nth-child(n+4){
    grid-column: 1;
  }
  body[data-page="admin"] #cardsWrap .card > :nth-child(n+4):nth-child(odd){
    margin-bottom: 2px;                 /* petit espace entre label et valeur */
  }
}
/* Taille & look du bouton de soumission */
#submitBtn.submit-big{
  font-size: 1rem;
  padding: 14px 18px;
  border-radius: 14px;
  min-width: 260px;
}

/* Pleine largeur sur mobile, plus confortable */
@media (max-width: 700px){
  #submitBtn.submit-big{
    width: 100%;
  }
}

/* État désactivé : gris, non cliquable */
#submitBtn:disabled{
  background: #e5e7eb !important;
  color: #9ca3af !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: none !important;
  cursor: not-allowed;
  opacity: 1; /* pour éviter un gris trop pâle si un thème applique transparency */
}

/* État actif : garde ton style "btn-primary" existant (dégradé rouge) */
@media (max-width: 900px){
  body[data-page="admin-case"] #filesCardsWrap .admin-card{
    display:grid; gap:10px 12px;
    grid-template-columns: 120px 1fr; padding:14px 16px; border-radius:14px;
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card__header{
    grid-column:1 / -1;
    display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:10px;
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card__title{
    font-weight:600; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card__grid > div{
    display:grid; grid-template-columns: 120px 1fr; column-gap:12px; row-gap:4px;
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card .muted.small{ font-weight:600; color:var(--muted); }
}
@media (max-width: 520px){
  body[data-page="admin-case"] #filesCardsWrap .admin-card{
    grid-template-columns:1fr;
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card__grid > div{
    grid-template-columns:1fr;
  }
}
/* Admin-case: casser correctement dans la colonne "Nom" (td n°2) */
body[data-page="admin-case"] .table td:nth-child(2),
body[data-page="admin-case"] .table th:nth-child(2){
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: break-word;         /* casse dans les mots si nécessaire */
  overflow-wrap: anywhere;        /* casse sur n'importe quel caractère */
  hyphens: auto;
}

/* Si tu as une classe qui force l'ellipse (ex. .ellipsis, .ellipsis-2) : neutralise-la ici */
body[data-page="admin-case"] .table td:nth-child(2) .ellipsis,
body[data-page="admin-case"] .table td:nth-child(2) .ellipsis-2{
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
/* ===== Admin-case: cartes lisibles sur mobile ===== */
@media (max-width: 900px){
  body[data-page="case"] #filesCardsWrap .admin-card{
    display:grid; gap:10px 12px; grid-template-columns: 120px 1fr; padding:14px 16px; border-radius:14px;
  }
  body[data-page="case"] #filesCardsWrap .admin-card__header{
    grid-column:1 / -1; display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:10px;
  }
  /* On narrow screens prefer: title | badge | radio so title gets full width and badge keeps fixed size */
  body[data-page="case"] #filesCardsWrap .admin-card__header{
    grid-template-columns: 1fr auto auto; /* title | badge | radio */
  }
  /* File name: wrap onto next line but avoid mid-letter breaks */
  body[data-page="case"] #filesCardsWrap .admin-card__title{
    min-width: 0;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: none;
  }

  /* Keep badge/chip at a fixed visual width so it doesn't push or squash the title.
     If the badge label is longer it will be truncated with an ellipsis. */
  body[data-page="case"] #filesCardsWrap .chip,
  body[data-page="case"] #filesCardsWrap .badge{
    justify-self: end;
    flex: 0 0 120px;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    padding: 6px 10px; /* match other badge padding */
    text-align: center;
  }
  body[data-page="case"] #filesCardsWrap .admin-card__grid > div{ display:contents }
  body[data-page="case"] #filesCardsWrap .admin-card .label{ grid-column:1; color:var(--muted); font-weight:600 }
  body[data-page="case"] #filesCardsWrap .admin-card .value{ grid-column:2; align-self:end }

  /* carte = grille 2 colonnes (Label | Valeur) */
  body[data-page="admin-case"] #filesCardsWrap .admin-card{
    display: grid;
    grid-template-columns: 120px 1fr;   /* Label | Valeur */
    column-gap: 12px;
    row-gap: 8px;
    padding: 14px 16px;
    border-radius: 14px;
  }

  /* entête (radio + nom du fichier + puce "Ajouté par …") sur toute la largeur */
  body[data-page="admin-case"] #filesCardsWrap .admin-card__header{
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr auto; /* radio | nom | badge/puce */
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
  }

  /* Nom du fichier : doit pouvoir revenir à la ligne sans déborder */
  body[data-page="admin-case"] #filesCardsWrap .admin-card__title{
    min-width: 0;
    white-space: normal;          /* autoriser la casse */
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  /* La petite puce (ex: "Candidat", "Ajouté par l’admin") ne doit jamais se couper */
  body[data-page="admin-case"] #filesCardsWrap .chip,
  body[data-page="admin-case"] #filesCardsWrap .badge{
    white-space: nowrap;
    hyphens: none;
  }

  /* Grille des paires Label | Valeur */
  body[data-page="admin-case"] #filesCardsWrap .admin-card__grid > div{
    display: contents;            /* .label occupe la col 1, .value la col 2 */
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card .label{
    grid-column: 1;
    color: var(--muted);
    font-weight: 600;
    white-space: normal;
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card .value{
    grid-column: 2;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
}

/* Écrans très étroits : empiler label au-dessus de la valeur */
@media (max-width: 520px){
  body[data-page="admin-case"] #filesCardsWrap .admin-card{
    grid-template-columns: 1fr;
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card .label,
  body[data-page="admin-case"] #filesCardsWrap .admin-card .value{
    grid-column: 1;
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card .label{ margin-bottom: 2px; }
}
/* ===== Admin-case: nicer wrapping & alignment on mobile cards ===== */
@media (max-width: 900px){
  /* 1) Stop ugly hyphenation inside admin-case cards */
  body[data-page="admin-case"] #filesCardsWrap{
    hyphens: none;                /* override html{ hyphens:auto } */
  }

  /* 2) Header: radio | file name | badge at right */
  body[data-page="admin-case"] #filesCardsWrap .admin-card__header{
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
  }

  /* 3) File name: wrap onto next line but NEVER split letters */
  body[data-page="admin-case"] #filesCardsWrap .admin-card__title{
    min-width: 0;
    white-space: normal;          /* allow wrapping */
    word-break: break-word;       /* break only at safe points */
    overflow-wrap: break-word;    /* avoid overflow, no mid-letter split */
    hyphens: none;                /* no Pas-se-port */
  }

  /* 4) Keep the badge (“Candidat”, “Ajouté par l’admin”) on the right */
  body[data-page="admin-case"] #filesCardsWrap .chip,
  body[data-page="admin-case"] #filesCardsWrap .badge{
    justify-self: end;
    white-space: nowrap;
  }

  /* 5) Label|Value grid (Type, Ajouté le) with wider label column */
  body[data-page="admin-case"] #filesCardsWrap .admin-card{
    display: grid;
    grid-template-columns: 132px 1fr;  /* label | value */
    column-gap: 12px;
    row-gap: 8px;
    padding: 14px 16px;
    border-radius: 14px;
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card__grid > div{
    display: contents;            /* .label uses col 1, .value uses col 2 */
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card .label{
    grid-column: 1;
    color: var(--muted);
    font-weight: 600;
    text-align: left;
    white-space: normal;
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card .value{
    grid-column: 2;
    text-align: left;
    white-space: normal;
    word-break: break-word;       /* wrap whole words */
    overflow-wrap: break-word;
    hyphens: none;
  }

  /* 6) Dates & “Type” should stay on one line (readability) */
  body[data-page="admin-case"] #filesCardsWrap .admin-card__grid > div:nth-child(1) .value,
  body[data-page="admin-case"] #filesCardsWrap .admin-card__grid > div:nth-child(2) .value{
    white-space: nowrap;          /* Type + Ajouté le on one line */
  }
}

/* Ultra small screens: stack label above value to avoid right empty area */
@media (max-width: 520px){
  body[data-page="admin-case"] #filesCardsWrap .admin-card{
    grid-template-columns: 1fr;
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card .label,
  body[data-page="admin-case"] #filesCardsWrap .admin-card .value{
    grid-column: 1;
    text-align: left;
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card .label{ margin-bottom: 2px; }
}
/* ===== Admin-case: wrap long text in table (desktop) ===== */
body[data-page="admin-case"] table td {
  white-space: normal !important;    /* autorise le retour à la ligne */
  word-break: break-word;            /* casse aux limites naturelles */
  overflow-wrap: anywhere;           /* évite les dépassements */
}
/* Admin: empêcher le retour à la ligne dans les pastilles de statut */
body[data-page="admin"] .status-badge,
body[data-page="admin"] .badge.status,
body[data-page="admin"] .badge.b-amber,
body[data-page="admin"] .badge.b-green,
body[data-page="admin"] .badge.b-red{
  white-space: nowrap;
}

/* iPhone étroit : réduire très légèrement la taille des pastilles si besoin */
@media (max-width: 380px){
  body[data-page="admin"] .status-badge{ font-size: .92rem; padding: 6px 10px; }
}
/* Soumis: table → cartes en mobile (<=900px) */
@media (max-width: 900px){
  body[data-page="soumis"] #casesTable{ display:block; border:0; width:100%; }
  body[data-page="soumis"] #casesTable thead{ display:none; }
  body[data-page="soumis"] #casesTable tbody{ display:grid; gap:12px; }
  body[data-page="soumis"] #casesTable tbody tr{
    display:grid; grid-template-columns: 1fr auto; gap:10px 12px;
    background:#fff; border:1px solid var(--line); border-radius:16px; padding:12px;
    box-shadow:0 6px 18px rgba(0,0,0,.06);
  }
  body[data-page="soumis"] #casesTable td{ display:flex; align-items:center; gap:8px; }
  body[data-page="soumis"] #casesTable td::before{
    content: attr(data-label); font-weight:600; color:var(--muted); min-width:7.5rem; white-space:nowrap;
  }
  /* 1re cellule = radio → pas de label */
  body[data-page="soumis"] #casesTable td:first-child::before{ content:""; min-width:0; }
}
/* Admin-case: aucune numérotation/puce devant les cartes */
body[data-page="admin-case"] #filesCardsWrap,
body[data-page="admin-case"] #filesCardsWrap *{
  list-style: none !important;
}
/* Admin-case: header = titre | badge | radio (radio à droite) */
@media (max-width: 900px){
  body[data-page="admin-case"] #filesCardsWrap .admin-card__header{
    grid-column: 1 / -1;
    display:grid;
    grid-template-columns: 1fr auto auto; /* titre | badge | radio */
    align-items:center;
    gap:10px;
    margin-bottom:6px;
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card__title{
    min-width:0; white-space:normal; word-break:break-word; overflow-wrap:break-word;
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card__header .chip{ justify-self:end; white-space:nowrap; }
  body[data-page="admin-case"] #filesCardsWrap .admin-card__header .radio.right{ justify-self:end; }
}
@media (max-width: 900px){
  body[data-page="admin-case"] #filesCardsWrap .admin-card .value.date,
  body[data-page="admin-case"] #filesCardsWrap .admin-card .value.type{
    white-space: nowrap;
  }
}
/* Soumis: table → cartes sur mobile */
@media (max-width: 900px){
  body[data-page="soumis"] #casesTable{ display:block; border:0; width:100%; }
  body[data-page="soumis"] #casesTable thead{ display:none; }
  body[data-page="soumis"] #casesTable tbody{ display:grid; gap:12px; }
  body[data-page="soumis"] #casesTable tbody tr{
    display:grid;
    grid-template-columns: 1fr auto;      /* contenu | actions éventuelles */
    gap:10px 12px;
    background:#fff; border:1px solid var(--line);
    border-radius:16px; padding:12px;
    box-shadow:0 6px 18px rgba(0,0,0,.06);
  }
  body[data-page="soumis"] #casesTable td{ display:flex; align-items:center; gap:8px; }
  body[data-page="soumis"] #casesTable td::before{
    content: attr(data-label);
    font-weight:600; color:var(--muted);
    min-width: 7.5rem; white-space: nowrap;
  }
  /* 1re cellule = radio : pas de label */
  body[data-page="soumis"] #casesTable td:first-child::before{ content:""; min-width:0; }
}
/* Admin-case: actions sur une seule ligne */
@media (max-width: 900px){
  body[data-page="admin-case"] #fileActions > div:last-child{
    display:flex; gap:8px; flex-wrap: nowrap !important;
  }
  body[data-page="admin-case"] #fileActions .btn{
    white-space: nowrap;
  }
}
@media (max-width: 900px){
  body[data-page="admin-case"] #filesCardsWrap .admin-card__header{
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr auto auto; /* titre | badge | radio */
    align-items: center; gap: 10px; margin-bottom: 6px;
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card__title{
    min-width: 0; white-space: normal; word-break: break-word; overflow-wrap: break-word; hyphens: none;
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card__header .badge{ justify-self: end; white-space: nowrap; }
  body[data-page="admin-case"] #filesCardsWrap .admin-card__header .radio.right{ justify-self: end; display:flex; align-items:center; }
}
body[data-page="admin-case"] #filesCardsWrap,
body[data-page="admin-case"] #filesCardsWrap *{ list-style: none !important; }
/* Soumis: NE PAS cacher la table en mobile */
@media (max-width: 900px){
  body[data-page="soumis"] .table-wrap{ display:block !important; }
}

/* Soumis: table → cartes en mobile */
@media (max-width: 900px){
  body[data-page="soumis"] #casesTable{ display:block; border:0; width:100%; }
  body[data-page="soumis"] #casesTable thead{ display:none; }
  body[data-page="soumis"] #casesTable tbody{ display:grid; gap:12px; }
  body[data-page="soumis"] #casesTable tbody tr{
    display:grid; grid-template-columns: 1fr auto; gap:10px 12px;
    background:#fff; border:1px solid var(--line); border-radius:16px; padding:12px;
    box-shadow:0 6px 18px rgba(0,0,0,.06);
  }
  body[data-page="soumis"] #casesTable td{ display:flex; align-items:center; gap:8px; }
  body[data-page="soumis"] #casesTable td::before{
    content: attr(data-label); font-weight:600; color:var(--muted);
    min-width: 7.5rem; white-space: nowrap;
  }
  /* 1re cellule = radio → pas de label */
  body[data-page="soumis"] #casesTable td:first-child::before{ content:""; min-width:0; }
}

/* Admin: empêcher la casse des pastilles de statut */
body[data-page="admin"] .status-badge,
body[data-page="admin"] .badge.status,
body[data-page="admin"] .badge.b-amber,
body[data-page="admin"] .badge.b-green,
body[data-page="admin"] .badge.b-red{ white-space:nowrap; }

/* Admin-case: aucune numérotation/puce devant les cartes */
body[data-page="admin-case"] #filesCardsWrap,
body[data-page="admin-case"] #filesCardsWrap *{ list-style: none !important; }

/* Admin-case mobile : header = Titre | Badge | Radio (radio à droite) */
@media (max-width: 900px){
  body[data-page="admin-case"] #filesCardsWrap .admin-card__header{
    grid-column: 1 / -1;
    display:grid; grid-template-columns: 1fr auto auto; /* titre | badge | radio */
    align-items:center; gap:10px; margin-bottom:6px;
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card__title{
    min-width:0; white-space:normal; word-break:break-word; overflow-wrap:break-word; hyphens:none;
  }
  body[data-page="admin-case"] #filesCardsWrap .admin-card__header .badge{ justify-self:end; white-space:nowrap; }
  body[data-page="admin-case"] #filesCardsWrap .admin-card__header .radio.right{ justify-self:end; display:flex; align-items:center; }
}

/* Admin-case : actions sur une seule ligne en mobile */
@media (max-width: 900px){
  body[data-page="admin-case"] #fileActions > div:last-child{
    display:flex; gap:8px; flex-wrap:nowrap !important;
  }
  body[data-page="admin-case"] #fileActions .btn{ white-space:nowrap; }
}

/* Admin-case (desktop) : la colonne "Nom" doit pouvoir revenir à la ligne */
body[data-page="admin-case"] .table td:nth-child(2),
body[data-page="admin-case"] .table th:nth-child(2){
  white-space:normal !important; overflow:visible !important; text-overflow:clip !important;
  word-break:break-word; overflow-wrap:anywhere; hyphens:auto;
}
/* ===== Soumis (mobile) : cartes propres, sans cellule vide ===== */
@media (max-width: 900px){
  body[data-page="soumis"] #casesTable{
    display:block; border:0; width:100%;
  }
  body[data-page="soumis"] #casesTable thead{ display:none; }

  /* chaque ligne devient une carte en grille */
  body[data-page="soumis"] #casesTable tbody{
    display:grid; gap:12px;
  }
  body[data-page="soumis"] #casesTable tbody tr{
    display:grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "id     status"
      "program program"
      "submitted submitted";
    gap:8px 12px;
    background:#fff;
    border:1px solid var(--line);
    border-radius:16px;
    padding:12px;
    box-shadow:0 6px 18px rgba(0,0,0,.06);
  }

  /* neutraliser l'apparence “cellule de tableau” */
  body[data-page="soumis"] #casesTable td{
    background:transparent !important;
    border:0 !important;
    padding:4px 0 !important;
  }

  /* positionner chaque colonne dans la grille (ordre des colonnes: ID, Programme, Statut, Soumis) */
  body[data-page="soumis"] #casesTable td:nth-child(1){ grid-area:id;        font-weight:700; }
  body[data-page="soumis"] #casesTable td:nth-child(2){ grid-area:program;   }
  body[data-page="soumis"] #casesTable td:nth-child(3){ grid-area:status;    justify-self:end; }
  body[data-page="soumis"] #casesTable td:nth-child(4){ grid-area:submitted; white-space:nowrap; }

  /* on n'affiche PAS les labels automatiques pour éviter le doublon */
  body[data-page="soumis"] #casesTable td::before{ content:none !important; }

  /* garder les pastilles sur une seule ligne */
  body[data-page="soumis"] .badge,
  body[data-page="soumis"] .status-badge{ white-space:nowrap; }
}
/* Desktop: small selector column */
body[data-page="soumis"] .sel-col{ width:44px; }
body[data-page="soumis"] #casesTable td.sel{
  text-align:center;
  width:44px;
}
body[data-page="soumis"] #casesTable td.id{
  white-space:normal; overflow:visible; text-overflow:clip;
}

/* Mobile: table → card with selector + nice layout */
@media (max-width: 900px){
  body[data-page="soumis"] #casesTable{
    display:block; border:0; width:100%;
  }
  body[data-page="soumis"] #casesTable thead{ display:none; }
  body[data-page="soumis"] #casesTable tbody{ display:grid; gap:12px; }

  body[data-page="soumis"] #casesTable tbody tr{
    display:grid;
    grid-template-columns: 24px 1fr auto;   /* selector | id | status */
    grid-template-areas:
      "sel   id   status"
      "gap   program program"
      "gap   submitted submitted";
    column-gap:12px; row-gap:8px;
    background:#fff; border:1px solid var(--line);
    border-radius:16px; padding:12px;
    box-shadow:0 6px 18px rgba(0,0,0,.06);
    align-items:center;
  }

  /* neutralize td look */
  body[data-page="soumis"] #casesTable td{
    background:transparent !important;
    border:0 !important;
    padding:0 !important;
  }

  body[data-page="soumis"] #casesTable td.sel{ grid-area:sel; align-self:start; }
  body[data-page="soumis"] #casesTable td.id{ grid-area:id; font-weight:700; }
  body[data-page="soumis"] #casesTable td.status{ grid-area:status; justify-self:end; white-space:nowrap; }
  body[data-page="soumis"] #casesTable td.program{ grid-area:program; }
  body[data-page="soumis"] #casesTable td.submitted{ grid-area:submitted; white-space:nowrap; color:var(--muted); }

  /* no auto data-labels to avoid duplicates */
  body[data-page="soumis"] #casesTable td::before{ content:none !important; }

  /* keep badges on one line */
  body[data-page="soumis"] .badge{ white-space:nowrap; }
}
.badge.b-grey {
  background: #6b7280; /* Tailwind gray-500 */
  color: #fff;
}
/* ===== CONTACT SECTION ===== */

#contact {
  margin-top: 40px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 14px;
  box-shadow: var(--shadow-1);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}

.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.contact-card .contact-texts h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 600;
}

.contact-card .contact-texts p {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
}

/* --- Icône sans fond --- */
.icon-bubble {
  width: 50px;
  height: 50px;
  min-width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 8px; /* arrondi subtil, optionnel */
  box-shadow: none;
}

.icon-bubble img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}
/* role chips */
.chip{display:inline-block;padding:.15rem .6rem;border-radius:999px;font-size:.8rem;line-height:1.2;background:#f1f5f9;color:#334155}
.chip-user{background:#eef2ff;color:#3730a3}
.chip-admin{background:#e6f4ff;color:#075985}

/* ===== Global site footer ===== */
.site-footer{
  margin-top: 38px;
  border-top: 1px solid #eee;
  background: #fff;
}
.site-footer .footer-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 16px 0;
}
.site-footer .footer-top{ width:100%; padding: 8px 0 14px; }
.site-footer .footer-bottom{ display:flex; align-items:center; justify-content:space-between; gap:12px 16px; }
.site-footer .brand.small{ display:flex; align-items:center; gap:10px; }
.site-footer .brand.small .brand-name{ font-weight: 800; letter-spacing:.2px; }
.site-footer .footer-links{
  display:flex; flex-wrap:wrap; gap:12px 16px;
}
.site-footer .footer-links a{
  color:#6b7280; text-decoration:none; font-weight:600;
}
.site-footer .footer-links a:hover{ color:#374151; text-decoration:underline; }
.site-footer .legal{ color:#6b7280; white-space:nowrap; }
@media (max-width: 700px){
  .site-footer .footer-inner{ flex-direction:column; align-items:flex-start; }
  .site-footer .footer-bottom{ flex-direction:column; align-items:flex-start; gap:8px; }
  .site-footer .legal{ white-space:normal; }
}

/* file cards */
.file-card .file-row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:.35rem}
.file-card .file-name{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file-card .file-meta{display:grid;grid-template-columns:1fr 1fr;gap:.35rem .75rem;margin:.25rem 0 .35rem}
.file-card dt{font-size:.8rem;color:#64748b}
.file-card dd{margin:0}
.file-card .file-select{display:flex;justify-content:flex-end}
.wrap-text {
  white-space: normal;   /* allow wrapping */
  word-break: break-word; /* break long words if needed */
}
.file-card .top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.file-card .right-rail {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;   /* pushes badge + selector all the way to right */
}
/* Card header layout */
.file-card .file-top{
  display:flex;
  align-items:center;
  gap:12px;
}

/* Title grows; right rail sticks to the right */
.file-card .file-name{
  flex:1 1 auto;
  min-width:0;           /* enables ellipsis to actually work */
}

/* Badge + radio aligned right, on one line */
.file-card .right-rail{
  margin-left:auto;      /* push to far right */
  display:flex;
  align-items:center;
  gap:12px;
}

/* Badge style (reuse your colors if you already have) */
.chip{
  padding:6px 12px;
  border-radius:9999px;
  background:#6b7280;    /* neutral */
  color:#fff;
  font-weight:600;
  font-size:.9rem;
  white-space:nowrap;
}
.chip-user{ background:#6b7280; }             /* Candidat */
.chip-admin{ background:#6b7280; }            /* legacy (unused) */
/* Minimal role badges unified with case page */
.role-badge{background:#f1f5f9;color:#475569;border:1px solid #e2e8f0;padding:4px 10px;border-radius:999px;font-size:11px;font-weight:500;letter-spacing:.25px;display:inline-flex;align-items:center;gap:4px}
.role-badge.role-admin{background:#e2e8f0;color:#334155;border-color:#cbd5e1}
.role-badge.role-user{background:#f8fafc;color:#475569;border-color:#e2e8f0}

/* Optional: tidy up “Type / Ajouté le” rows */
.file-card .file-meta{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:6px 16px;
  margin-top:8px;
}
@media (max-width:640px){
  .file-card .file-meta{ grid-template-columns: 1fr; }
}
/* put in styles.css */
.admin-card__header {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

/* Mobile: pin radio in case-card to bottom-right to avoid overlap
   (apply to admin and case pages only; Soumis wants radio top-left like desktop) */
@media (max-width: 640px) {
  /* Keep admin cards identical to desktop (radio stays top-left).
     Still pin radios for admin-case and case pages to avoid overlaps in dense file lists. */
  body[data-page="admin-case"] .case-card,
  body[data-page="case"] .case-card { padding-bottom: 56px; }
  body[data-page="admin-case"] .case-card input[type="radio"],
  body[data-page="case"] .case-card input[type="radio"] {
    position: absolute;
    right: 16px;
    bottom: 14px;
    width: 20px; height: 20px; margin: 0; z-index: 6;
  }
}

.admin-card__actions {
  display:flex;
  align-items:center;
  gap:10px;
}

.admin-card__title {
  overflow-wrap:anywhere;  /* long names wrap */
}
.admin-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-card__title {
  flex: 1 1 auto;              /* title can shrink */
  min-width: 0;                /* allow ellipsis */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;         /* keep title on one line */
}

.admin-card__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;         /* force badge + radio on one line */
}
/* keep the action buttons on one line, align info to left and actions to right */
#fileActions { display:flex; align-items:center; gap:12px }
#fileActions > div:last-child { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-left:auto; justify-content:flex-end }
#fileActions .action-bar{ display:flex; gap:8px; align-items:center }
#fileActions .action-bar .btn{ white-space:nowrap }
/* Keep all header links visible on one or two lines */
.site-header .nav.nav-inline{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;            /* <-- allows wrapping instead of dropping items */
}
.site-header .nav.nav-inline a,
.site-header .nav.nav-inline button{
  white-space:nowrap;        /* each item stays intact; they wrap as a group */
}
.card.video-card {
  margin: 20px 0;
  text-align: center;
}

.video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;   /* keeps video like a thumbnail */
  object-fit: cover;      /* crop like an image */
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}
/* soumis.html — allow program name to wrap */
#casesTable th:nth-child(3),
#casesTable td:nth-child(3) {
  white-space: normal;
  word-break: break-word;
}
@media (max-width: 600px) {
  #casesTable thead { display: none; }

  #casesTable,
  #casesTable tbody,
  #casesTable tr,
  #casesTable td { display: block; width: 100%; }

  #casesTable tr {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    padding: 12px 14px;
    margin: 12px 0;
  }

  /* Radio cell at the top */
  #casesTable td.sel {
    display: flex;
    align-items: center;
    padding: 0 0 8px 0;
  }

  /* Each field shows a small label + value */
  #casesTable td:not(.sel) {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  #casesTable td:not(.sel)::before {
    content: attr(data-label);
    color: #6b7280;
    font-size: 13px;
    margin-right: 12px;
    flex: 0 0 40%;
    max-width: 45%;
  }
  #casesTable td:not(.sel) > * {
    flex: 1 1 auto;
    text-align: right;   /* set to left if you prefer */
  }

  /* Make ID a bit stronger */
  #casesTable td[data-label="ID"] > * {
    font-weight: 700;
    font-size: 18px;
  }
}
/* Candidate column */
#casesTable th:nth-child(5),
#casesTable td:nth-child(5) {
  white-space: normal;      /* allow wrapping */
  overflow-wrap: anywhere;  /* break long names if needed */
  word-break: break-word;
  line-height: 1.3;
}

/* On small screens: let it wrap fully */
@media (max-width: 640px) {
  #casesTable th:nth-child(5),
  #casesTable td:nth-child(5) {
    max-width: unset;       /* remove forced cutoff */
  }
}