:root{
  --bg: #0b1020;
  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.09);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.65);
  --border: rgba(255,255,255,.12);
  --accent: #7c5cff;
  --good: #1dd1a1;
  --warn: #ff9f43;
  --bad: #ff6b6b;
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --radius: 16px;
}

*{ box-sizing: border-box; }
html, body { height: 100%; overflow-x: hidden; }

body{
  margin:0;
  overflow-y: auto;
  color: var(--text);
  background: radial-gradient(1200px 800px at 20% 10%, rgba(124,92,255,.25), transparent 60%),
              radial-gradient(900px 700px at 80% 30%, rgba(29,209,161,.18), transparent 55%),
              var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; }

code{
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.08);
}

.container{
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.logo{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(124,92,255,1), rgba(29,209,161,1));
  box-shadow: 0 10px 35px rgba(124,92,255,.22);
}
.brand h1{
  font-size: 14px;
  margin:0;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .9;
}
.nav{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap: wrap;
}
.pill{
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
}

.pill--mini{
  padding: 4px 10px;
  font-size: 10px;
  border-radius: 999px;
}

.hint--spaced{
  margin: 6px 0 14px 0;
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}

.rowActions--nowrap{
  flex-wrap: nowrap;
}

select.input:disabled,
.input:disabled,
.input[readonly],
textarea.input[readonly]{
  opacity: 1;
}

select.input:disabled{
  background: rgba(255,255,255,.75);
  color: var(--text);
}

.input[readonly],
textarea.input[readonly]{
  background: rgba(255,255,255,.75);
}
.pill.active{
  border-color: rgba(124,92,255,.6);
  box-shadow: 0 0 0 3px rgba(124,92,255,.18);
}
.meta{
  display:flex;
  flex-direction: column;
  text-align: right;
  gap: 2px;
  min-width: 220px;
}
.meta .email{
  font-size: 13px;
  color: var(--muted);
}
.badge{
  font-size: 12px;
  width: fit-content;
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.05);
}
.badge.admin{ border-color: rgba(124,92,255,.5); }
.badge.manager{ border-color: rgba(255,159,67,.5); }
.badge.employee{ border-color: rgba(29,209,161,.5); }

.grid{
  padding-top: 18px;
  display:grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 14px;
}

@media(max-width: 900px){
  .grid{ grid-template-columns: 1fr; }
  .meta{ text-align:left; min-width: auto; }
  .badge{ margin-left: 0; }
}

.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 16px;
}

.card h2{
  margin: 2px 0 10px;
  font-size: 16px;
  letter-spacing: .02em;
}
.muted{ color: var(--muted); }

.kpi{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}
.kpi .k{
  flex: 1 1 120px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
}
.k .label{ font-size: 12px; color: var(--muted); }
.k .value{ font-size: 20px; margin-top: 3px; }

.table{
  width:100%;
  border-collapse: collapse;
}
.table th, .table td{
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 10px 8px;
  text-align:left;
  font-size: 14px;
  vertical-align: top;
}
.table th{
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.table td small{ color: var(--muted); }

.empty{
  padding: 16px;
  border: 1px dashed rgba(255,255,255,.2);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255,255,255,.03);
}

.btn{
  appearance:none;
  border: 1px solid rgba(124,92,255,.55);
  background: rgba(124,92,255,.15);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 950;
}
.btn:hover{ filter: brightness(1.05); }
.btn:active{ transform: translateY(1px); }

.btn.ghost{
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.16);
}
.btn.danger{
  background: rgba(255,107,107,.12);
  border-color: rgba(255,107,107,.45);
}
.btn[disabled]{
  opacity: .55;
  cursor:not-allowed;
}

.alert{
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.05);
}
.alert.bad{ border-color: rgba(255,107,107,.45); }
.alert.good{ border-color: rgba(29,209,161,.45); }
.alert.warn{ border-color: rgba(255,159,67,.45); }

.center{
  min-height: 60vh;
  display:flex;
  align-items:center;
  justify-content:center;
}

hr.sep{
  border: none;
  border-top: 1px solid rgba(255,255,255,.08);
  margin: 12px 0;
}

.formGrid{
  display: grid;
  /* Use minmax(0, 1fr) to prevent grid items (file inputs, long text, etc.) from forcing the grid wider than its container. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 160px 140px 120px;
  gap: 10px;
  align-items: end;
}

/* Create point: keep type-specific fields on the same row */
.formGrid--step{
  grid-template-columns: 180px 240px minmax(0, 1fr) 140px 120px;
}
.formGrid > *{ min-width: 0; }
@media(max-width: 900px){
  .formGrid{ grid-template-columns: 1fr; }
}

.field label{
  display:block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: .03em;
}
.input, .select, .textarea{
  min-width: 0;
  width: 100%;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  color: var(--text);
  outline: none;
}
.textarea{
  min-height: 120px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
}
.input:focus, .select:focus, .textarea:focus{
  border-color: rgba(124,92,255,.65);
  box-shadow: 0 0 0 3px rgba(124,92,255,.16);
}

.inline{
  display:flex;
  gap: 8px;
  align-items:center;
  flex-wrap: wrap;
}
.hint{
  font-size: 12px;
  color: var(--muted);
}
.chip{
  display:inline-flex;
  gap: 8px;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  font-size: 12px;
}
.chip.mandatory{ border-color: rgba(255,159,67,.45); }
.chip.optional{ border-color: rgba(29,209,161,.45); }
.chip.status{ border-color: rgba(124,92,255,.45); }
.chip.status.completed{ border-color: rgba(29,209,161,.45); }
.chip.status.in_progress{ border-color: rgba(255,159,67,.45); }
.chip.status.not_started{ border-color: rgba(255,255,255,.2); }
.chip.status.overdue{ border-color: rgba(255,107,107,.55); }

.toggle{
  display:inline-flex;
  align-items:center;
  gap: 8px;
}
.toggle input{
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.rowActions{
  display:flex;
  gap: 8px;
  align-items:center;
  flex-wrap: wrap;
}

.toastWrap{
  position: fixed;
  bottom: 16px;
  right: 16px;
  display:flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  max-width: min(520px, calc(100vw - 32px));
}
.toast{
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(8,12,24,.75);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  color: var(--text);
}
.toast.good{ border-color: rgba(29,209,161,.45); }
.toast.bad{ border-color: rgba(255,107,107,.45); }
.toast.warn{ border-color: rgba(255,159,67,.45); }
.toast .t{ font-weight: 950; margin-bottom: 4px; }
.toast .m{ color: var(--muted); }

.subnav{
  margin-top: 14px;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.subnav .pill{ padding: 8px 12px; }

/* Player */
.playerHeader{
  display:flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.playerTitle{
  margin: 0;
  font-size: 18px;
}
.progressBar{
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.09);
  overflow: hidden;
}
.progressBar > div{
  height: 100%;
  background: rgba(124,92,255,.6);
  width: 0%;
}
.playerMeta{
  display:flex;
  gap: 8px;
  align-items:center;
  flex-wrap: wrap;
  margin-top: 8px;
}
.playerStage{
  margin-top: 14px;
}
.videoWrap{
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.25);
}
.videoWrap iframe{
  width: 100%;
  height: 100%;
  border: none;
}
.videoWrap video{
  width: 100%;
  height: 100%;
}
.gallery{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media(max-width: 900px){
  .gallery{ grid-template-columns: 1fr; }
}
.gallery img{
  width:100%;
  height:auto;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.2);
}
.qBox{
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  padding: 14px;
}
.qTitle{
  margin: 0 0 6px;
  font-size: 14px;
  letter-spacing: .02em;
}
.qQuestion{
  margin: 0 0 12px;
  color: var(--text);
}
.options{
  display:flex;
  flex-direction: column;
  gap: 8px;
}
.option{
  display:flex;
  gap: 10px;
  align-items:flex-start;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.14);
  cursor: pointer;
}
.option:hover{ filter: brightness(1.05); }
.option input{
  margin-top: 2px;
  accent-color: var(--accent);
}
.playerActions{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* Quiz result */
.resultGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media(max-width: 900px){
  .resultGrid{ grid-template-columns: 1fr; }
}
.resultScore{
  font-size: 40px;
  font-weight: 1000;
  line-height: 1;
}


.grid2{
  padding-top: 18px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* === Theme override: align Maya Learn with MayaCheck (light theme) === */
:root{
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel2: #f1f5f9;
  --text: #0b1220;
  --muted: #667085;
  --border: #dde6f2;
  --accent: #0ea5e9;
  --good: #16a34a;
  --warn: #f97316;
  --bad: #ef4444;
  --shadow: 0 18px 40px rgba(15,23,42,.06);
  --radius: 18px;
}

body{
  margin:0;
  color: var(--text);
  background: var(--bg);
  font-family: system-ui,-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI","Roboto","Helvetica Neue",Arial,sans-serif;
}

/* layout / header */

.container{
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.topbar{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  background: linear-gradient(180deg,#ffffff,#f9fafb);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  box-shadow: 0 10px 35px rgba(15,23,42,.08);
  backdrop-filter: blur(10px);
}

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

.logo{
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%,#22d3ee,#0284c7);
  box-shadow: 0 10px 30px rgba(56,189,248,.5);
}

.brand h1{
  font-size: 15px;
  margin:0;
  letter-spacing:.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* nav pills */

.nav{
  margin-left:auto;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.pill{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 13px;
}

.pill.active{
  border-color: var(--accent);
  background: #ecfeff;
  box-shadow: 0 0 0 1px rgba(14,165,233,.4);
}

/* cards & dashboard */

.card{
  background: var(--panel);
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 18px 40px rgba(15,23,42,.06);
  padding: 16px;
}

.kpi .k{
  background:#f9fafb;
  border-radius: 14px;
  border:1px solid #e2e8f0;
}

/* tables */

.table{
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td{
  vertical-align: middle;
}

.table th,
.table td{
  border-bottom: 1px solid #e2e8f0;
}

/* buttons */

.btn{
  appearance:none;
  border-radius: 12px;
  border:1px solid #e2e8f0;
  background:#ffffff;
  color: var(--text);
  padding:8px 12px;
  font-size: 14px;
  font-weight: 500;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:6px;
}

.btn:hover{
  background:#f1f5f9;
}

.btn:active{
  transform: translateY(1px);
}

.btn.ghost{
  background: #f8fafc;
  border-color:#e2e8f0;
}

.btn.danger{
  background:#fef2f2;
  border-color:#fecaca;
  color:#b91c1c;
}

/* forms */

.input,
.select,
.textarea{
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background:#ffffff;
  color: var(--text);
  outline:none;
}

.input:focus,
.select:focus,
.textarea:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(14,165,233,.4);
}

.textarea{
  min-height: 120px;
  resize: vertical;
}

/* alerts */

.alert{
  border-radius: 12px;
  border:1px solid #e2e8f0;
  background:#f9fafb;
}

.alert.good{
  border-color:#bbf7d0;
  background:#f0fdf4;
}

.alert.bad{
  border-color:#fecaca;
  background:#fef2f2;
}

.alert.warn{
  border-color:#fed7aa;
  background:#fffbeb;
}

/* misc */

.muted{
  color: var(--muted);
}

/* === Theme override: MayaBay-inspired (vert profond + rose poudré) === */
:root{
  --mb-green: #2f3f35;
  --mb-green-2: #36463c;
  --mb-cream: #f6f1ea;
  --mb-cream-2: #f1ebe4;
  --mb-pink: #e7c0c1;
  --mb-ink: #1f2a22;

  --bg: var(--mb-cream);
  --panel: #ffffff;
  --panel2: var(--mb-cream-2);
  --text: #1b1f1d;
  --muted: rgba(27,31,29,.65);
  --border: rgba(47,63,53,.16);
  --accent: var(--mb-pink);
  --good: #1f7a4c;
  --warn: #c07b2c;
  --bad: #b23a3a;
  --shadow: 0 18px 50px rgba(31,42,34,.10);
  --radius: 18px;
}

html, body{
  height: 100%;
}

body{
  margin:0;
  color: var(--text);
  background: var(--bg);
  font-family: system-ui,-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI","Roboto","Helvetica Neue",Arial,sans-serif;
}

.shell{
  min-height: 100vh;
  display:flex;
  flex-direction: column;
}

/* Header (full width like the reference site) */
.topbar{
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  background: var(--mb-green);
}

.topbarInner{
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 20px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 16px;
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
}

.logo{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 26px rgba(0,0,0,.12);
}

.brand h1{
  margin:0;
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: rgba(255,255,255,.88);
}

.nav{
  display:flex;
  gap: 12px;
  align-items:center;
  flex-wrap: wrap;
}

.pill{
  padding: 10px 6px;
  border-radius: 0;
  border: none;
  background: transparent;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 11px;
  color: rgba(255,255,255,.78);
  border-bottom: 1px solid transparent;
}

.pill:hover{
  text-decoration: none;
  border-bottom-color: rgba(255,255,255,.35);
}

.pill.active{
  color: rgba(255,255,255,.96);
  border-bottom-color: var(--mb-pink);
  box-shadow: none;
}

.meta{
  display:flex;
  flex-direction: column;
  text-align: right;
  gap: 4px;
  min-width: 200px;
}

.meta .email{
  font-size: 12px;
  color: rgba(255,255,255,.72);
}

.badge{
  font-size: 11px;
  width: fit-content;
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.86);
}

.badge.admin{ border-color: rgba(231,192,193,.55); }
.badge.manager{ border-color: rgba(255,255,255,.28); }
.badge.employee{ border-color: rgba(255,255,255,.22); }

/* Main layout */
.container{
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px 20px 52px;
}

.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.card h2{
  margin: 2px 0 10px;
  font-size: 15px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Buttons (rose poudré) */
.btn{
  appearance: none;
  border: 1px solid rgba(47,63,53,.22);
  background: var(--mb-pink);
  color: var(--mb-ink);
  padding: 11px 14px;
  border-radius: 2px;
  cursor: pointer;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
}

.btn:hover{ filter: brightness(1.03); }
.btn:active{ transform: translateY(1px); }

.btn.ghost{
  background: transparent;
  border-color: rgba(47,63,53,.28);
  color: var(--mb-ink);
}

/* Small white capsule button used to open a module for editing in /admin/quiz */
.btn.btnPick{
  background: #fff;
  border-color: rgba(47,63,53,.28);
  color: var(--mb-ink);
  border-radius: 999px;
  height: var(--btn-h-sm);
  padding: 0 12px;
  min-width: 44px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 16px;
}
.btn.btnPick:hover{ background: #faf8f6; }

.btn.danger{
  background: #f3d1d1;
  border-color: rgba(178,58,58,.35);
  color: #7a2424;
}

/* Save icon buttons */
.btn.btnIcon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 46px;
  padding: 11px 14px;
}

.iconSave{
  width: 18px;
  height: 18px;
  display: block;
}

/* Forms */
.input, .select, .textarea{
  min-width: 0;
  width: 100%;
  padding: 10px 10px;
  border-radius: 2px;
  border: 1px solid rgba(47,63,53,.22);
  background: rgba(255,255,255,.92);
  color: var(--text);
  outline: none;
}

.input:focus, .select:focus, .textarea:focus{
  border-color: rgba(47,63,53,.55);
  box-shadow: 0 0 0 3px rgba(231,192,193,.25);
}

.field label{
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Tables */
.table th{
  color: rgba(47,63,53,.85);
}

/* Chips */
.chip{
  border-radius: 999px;
  border: 1px solid rgba(47,63,53,.18);
  background: rgba(241,235,228,.7);
  font-size: 11px;
}

.chip.status.completed{ border-color: rgba(31,122,76,.35); }
.chip.status.in_progress{ border-color: rgba(192,123,44,.4); }
.chip.status.overdue{ border-color: rgba(178,58,58,.45); }

/* Player progress */
.progressBar > div{
  background: rgba(231,192,193,.95);
}

/* Toast */
.toast{
  background: rgba(54,70,60,.92);
  border-color: rgba(255,255,255,.18);
}

.toast .m{
  color: rgba(255,255,255,.75);
}

@media(max-width: 900px){
  .meta{ text-align:left; min-width:auto; }
  .badge{ margin-left: 0; }
}


/* === ZIP19: Header layout + Admin tabs in white bar (MayaBay-like) === */

/* Header: full width, left brand, centered flower, right actions */
.topbarInner{
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 16px 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
}

.brand{
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand:hover{ text-decoration: none; }

.brand h1{
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: rgba(255,255,255,.88);
}

.mark{
  justify-self: center;
  display:flex;
  align-items:center;
  justify-content:center;
}

.markImg{
  display:block;
  height: 34px;
  width: auto;
}

.topRight{
  justify-self: end;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

/* Header CTAs (rose) */
.topbar .nav{
  display:flex;
  gap: 12px;
  align-items:center;
  flex-wrap: wrap;
}

.topCta{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 16px;
  border-radius: 2px;
  border: 1px solid rgba(47,63,53,.25);
  background: var(--mb-pink);
  color: var(--mb-ink);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.topCta:hover{ filter: brightness(1.03); text-decoration:none; }
.topCta:active{ transform: translateY(1px); }

.topCta.active{
  box-shadow: 0 0 0 3px rgba(231,192,193,.28);
}


/* Account menu (icon + dropdown) */
.topbar .meta{
  min-width: auto;
  display:flex;
  flex-direction: row;
  align-items:center;
  justify-content:flex-end;
  gap: 0;
  text-align: left;
}

.accountMenuWrap{
  position: relative;
}

.accountBtn{
  appearance: none;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.92);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor: pointer;
}

.accountBtn:hover{ background: rgba(255,255,255,.12); }
.accountBtn:active{ transform: translateY(1px); }

.accountBtn:focus-visible{
  outline: 3px solid rgba(231,192,193,.55);
  outline-offset: 2px;
}

.accountIcon{
  width: 18px;
  height: 18px;
  display:block;
}

.accountMenu{
  display:none;
  position:absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 280px;
  background: #ffffff;
  border: 1px solid rgba(47,63,53,.18);
  border-radius: 12px;
  box-shadow: 0 18px 46px rgba(31,42,34,.18);
  padding: 10px;
  z-index: 2000;
  text-align: left;
}

.accountMenu::before{
  content:"";
  position:absolute;
  right: 12px;
  top: -6px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-left: 1px solid rgba(47,63,53,.18);
  border-top: 1px solid rgba(47,63,53,.18);
  transform: rotate(45deg);
}

.accountMenuWrap.open .accountMenu{ display:block; }

.accountMenuHeader{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 4px 4px 10px;
}

.accountAvatar{
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(47,63,53,.16);
  background: rgba(47,63,53,.06);
  color: rgba(31,42,34,.88);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 750;
  font-size: 14px;
  letter-spacing: .02em;
}

.accountIdentity{
  min-width:0;
  display:flex;
  flex-direction: column;
  gap: 2px;
}

.accountName{
  font-size: 13px;
  font-weight: 750;
  color: rgba(31,42,34,.92);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accountEmail{
  font-size: 12px;
  font-weight: 650;
  color: rgba(31,42,34,.72);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
}

.accountMenu .badge{
  margin-left: auto;
  background: rgba(231,192,193,.22);
  border-color: rgba(47,63,53,.22);
  color: rgba(31,42,34,.90);
}

.accountMenuDivider{
  height: 1px;
  background: rgba(47,63,53,.12);
  margin: 6px 0 6px;
}

.accountMenuItem{
  width: 100%;
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-weight: 650;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: rgba(31,42,34,.90);
}

.accountMenuItem:hover{
  background: rgba(47,63,53,.06);
  border-color: rgba(47,63,53,.12);
}

.accountMenuItem:active{ transform: translateY(1px); }

.accountMenuItem:focus-visible{
  outline: 3px solid rgba(231,192,193,.55);
  outline-offset: 2px;
}

.accountMenuItemIcon{
  width: 18px;
  height: 18px;
  display:block;
  flex: 0 0 auto;
}

.accountMenuItem.danger{
  color: #7a2424;
}

.accountMenuItem.danger:hover{
  background: rgba(178,58,58,.08);
  border-color: rgba(178,58,58,.20);
}


@media(max-width: 900px){
  .topbarInner{
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 10px;
    padding: 14px 18px;
  }

  .mark{ grid-column: 1 / -1; grid-row: 1; }
  .brand{ grid-column: 1; grid-row: 2; }
  .topRight{ grid-column: 2; grid-row: 2; }
  .topbar .meta{ min-width: auto; }
}

/* Admin tabs bar (white bar under header) */
.subbar{
  /* Full-bleed bar without creating horizontal overflow (no 100vw). */
  margin-top: -26px; /* cancel container top padding so it sits right under the header */
  background: #ffffff;
  box-shadow:
    0 0 0 100vmax #ffffff,
    0 1px 0 100vmax rgba(47,63,53,.14);
  clip-path: inset(0 -100vmax);
}

.subbarInner{
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px;
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  align-items:center;
  gap: 14px;
}

.subbarRight{ justify-self: end; }
.subbarLeft{ justify-self: start; }

.subbar .subnav{
  margin: 0;
  display:flex;
  gap: 18px;
  align-items:center;
  justify-content:center;
  flex-wrap: wrap;
}

.tabLink{
  display:inline-block;
  padding: 12px 2px;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 11px;
  color: rgba(31,42,34,.62);
  border-bottom: 1px solid transparent;
  text-decoration: none;
}

.tabLink:hover{
  color: rgba(31,42,34,.86);
  border-bottom-color: rgba(47,63,53,.22);
  text-decoration: none;
}

.tabLink.active{
  color: rgba(31,42,34,.92);
  border-bottom-color: var(--mb-pink);
}

/* The rest of the admin page content sits below the bar */
.adminArea{
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
}

.sectionHeader{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sectionTitle{
  min-width: 0;
}

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

.sectionActions .btn{
  white-space: nowrap;
}

.userPwdCreate{
  display: flex;
  align-items: center;
  height: var(--btn-h);
}

.userPwdDotsLg{
  height: var(--btn-h);
}

.userPwdDots.pwdSet{
  border-color: rgba(47,63,53,.35);
  background: rgba(241,235,228,.85);
}


/* Restore generic pills for toggles, filters, etc. (not the header/admin tabs) */
.pill{
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(47,63,53,.18);
  background: rgba(241,235,228,.7);
  color: var(--mb-ink);
  text-decoration: none;
  letter-spacing: .02em;
  text-transform: none;
  font-size: 12px;
}

.pill:hover{ text-decoration:none; filter: brightness(1.02); }

.pill.active{
  border-color: rgba(47,63,53,.28);
  box-shadow: 0 0 0 3px rgba(231,192,193,.22);
}



/* ZIP33 — Admin / Utilisateurs : mise en ordre */

/* ZIP37 — Admin / Utilisateurs : alignement header + boutons */
.usersScroller{
  width: 100%;
  overflow-x: auto;
  /* Center the whole users grid/table inside the card when there is extra space */
  text-align: center;
}

.usersCols{
  display: inline-block;
  --users-cols: 186px 168px 176px 176px 136px 106px 106px 86px;
  /* Keep inner content left-aligned while the block itself is centered */
  text-align: left;
}

.usersTitleRow{
  padding: 0 8px;
  margin-bottom: 6px;
}

.usersTitleRow h2{ margin: 0; }

.usersToolbar{
  display: grid;
  grid-template-columns: var(--users-cols);
  column-gap: 0;
  row-gap: 0;
  align-items: end;
  justify-content: start;
  margin-bottom: 12px;
}

.usersToolbar > *{ min-width: 0; }

.usersToolbarSearch{ grid-column: 1 / span 2; }
.usersToolbarRole{ grid-column: 3; }
.usersToolbarStatus{ grid-column: 4 / span 2; }
.usersToolbarBtn{ grid-column: 6; }
.usersToolbarBtn .btn{ width: 100%; justify-content: center; }

.usersToolbarSearch,
.usersToolbarRole,
.usersToolbarStatus,
.usersToolbarBtn{ padding: 0 8px; }

.usersCreateBox{
  margin-bottom: 12px;
}

.usersCreateBox > b{
  display: block;
  margin: 6px 8px 10px;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.usersCreateGrid{
  display: grid;
  grid-template-columns: var(--users-cols);
  column-gap: 0;
  row-gap: 0;
  align-items: end;
  justify-content: start;
}

.usersCreateGrid > *{ min-width: 0; }
.usersCreateGrid .field{ padding: 0 8px; }
.usersCreateGrid .btn{ width: 100%; justify-content: center; }
.fieldNoLabel label{ visibility: hidden; }

.usersTable{
  table-layout: fixed;
  width: auto;
}

.usersTableWrap{
  width: 100%;
}

.usersFooter{
  margin-top: 12px;
}

.usersTable th:nth-child(1),
.usersTable td:nth-child(1){ width: 170px; }

.usersTable th:nth-child(2),
.usersTable td:nth-child(2){ width: 152px; }

.usersTable th:nth-child(3),
.usersTable td:nth-child(3){ width: 160px; }

.usersTable th:nth-child(4),
.usersTable td:nth-child(4){ width: 160px; }

.usersTable th:nth-child(5),
.usersTable td:nth-child(5){ width: 120px; }

.usersTable th:nth-child(6),
.usersTable td:nth-child(6){ width: 90px; }

.usersTable th:nth-child(7),
.usersTable td:nth-child(7){ width: 90px; }

.usersTable th:nth-child(8),
.usersTable td:nth-child(8){ width: 70px; }

.usersTable td{ vertical-align: middle; }

.userEmailLine{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.userEmailLine b{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  min-width: 0;
}

.userMeTag{
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(47,63,53,.22);
  background: rgba(231,192,193,.25);
  color: rgba(31,42,34,.82);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  flex: 0 0 auto;
}

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

.userLock{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(47,63,53,.22);
  background: rgba(231,192,193,.22);
  cursor: default;
  font-size: 14px;
  flex: 0 0 auto;
}

.userPwdWrap{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.userPwdDots{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  min-width: 48px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

.usersPager{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.usersPager .pagerInfo{
  min-width: 110px;
  text-align: center;
  font-weight: 700;
}

.userActions{
  display: flex;
  justify-content: center;
}

.userActions .btn{
  width: 100%;
  justify-content: center;
}

.btn.sm{
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: .02em;
}

@media(max-width: 980px){
  .usersToolbar{
    grid-template-columns: 1fr;
  }

  .usersToolbarSearch,
  .usersToolbarRole,
  .usersToolbarStatus,
  .usersToolbarBtn{ grid-column: auto; }

  .usersCreateGrid{ grid-template-columns: 1fr; }
}

/* ===================== ZIP42 – Dashboard & Admin alignment tweaks ===================== */

/* Dashboard metric tables: force identical column widths across Modules / Utilisateurs */
.table.dashMetricsTable{
  table-layout: fixed;
}

.table.dashMetricsTable col.dashColCount{ width: 72px; }
.table.dashMetricsTable col.dashColPct{ width: 92px; }
.table.dashMetricsTable col.dashColDate{ width: 150px; }

.table.dashMetricsTable th:nth-child(n+2),
.table.dashMetricsTable td:nth-child(n+2){
  text-align: center;
  white-space: nowrap;
}

/* Dashboard filters: keep controls on the same line as the section title */
.dashHeaderRow{
  gap: 12px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dashFilters{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
  flex: 1 1 auto;
}
.dashFilters .input{
  width: 200px;
  max-width: 100%;
}
.dashFilters .select{
  min-width: 140px;
}

/* Dashboard sorting: click column titles */
th[data-dash-sort]{
  cursor: pointer;
  user-select: none;
}
th[data-dash-sort]:hover{
  text-decoration: underline;
}
th[data-sort-dir="desc"]::after{
  content: " ▼";
  font-size: 11px;
  opacity: .6;
}
th[data-sort-dir="asc"]::after{
  content: " ▲";
  font-size: 11px;
  opacity: .6;
}

/* Dashboard KPI cards: center values vertically */
.kpi .k{
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 86px;
}

.kpi .k .value.valueSm{
  font-size: 16px;
}

/* Users table – password button centered */
.userPwdWrap{
  justify-content: center;
}

/* Dashboard collapsible sections */
.dashSectionHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:18px 0 8px;
}
.dashSectionHeader h3{
  margin:0;
}
.dashToggle{
  width:28px;
  min-width:28px;
  height:28px;
  padding:0;
  font-weight:700;
  line-height:1;
}

/* Admin layout: keep a stable width regardless of accordion state */
.adminArea > .card,
.adminArea > .stack{
  width: 100%;
}

.stack{
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
}

.stack > .card{
  width: 100%;
}

/* Light background wrapper used to visually separate "existing" lists from "create" forms */
.existingPanel{
  background: rgba(47, 63, 53, 0.04);
  border: 1px solid rgba(47, 63, 53, 0.10);
  border-radius: 14px;
  padding: 10px;
}
.existingPanel .table{
  margin: 0;
}

/* YES/NO switch (used for "Libre accès" etc.) */
.switchYN{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  user-select: none;
  cursor: pointer;
}
.switchYN input{
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switchYN .track{
  width: 44px;
  height: 24px;
  display: inline-block;
  border-radius: 999px;
  border: 1px solid rgba(47, 63, 53, 0.25);
  background: rgba(47, 63, 53, 0.12);
  position: relative;
  box-sizing: border-box;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}
.switchYN .track::before{
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  opacity: 1;
  box-shadow: 0 4px 10px rgba(15,23,42,0.18);
  transition: transform .16s ease, opacity .16s ease, box-shadow .16s ease;
}
.switchYN input:checked + .track{
  background: rgba(181, 129, 139, 0.28);
  border-color: rgba(181, 129, 139, 0.55);
}
.switchYN input:checked + .track::before{
  transform: translateX(20px);
  opacity: 1;
}
.switchYN .label{
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.switchYN input:checked ~ .label.on{ display: inline; }
.switchYN input:checked ~ .label.off{ display: none; }
.switchYN input:not(:checked) ~ .label.on{ display: none; }
.switchYN input:not(:checked) ~ .label.off{ display: inline; }

/* ===================== ZIP50 – button sizing normalisation ===================== */

:root{
  --btn-h: 42px;
  --btn-h-sm: 34px;
}

/* Ensure all buttons align perfectly in height across the admin UI */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--btn-h);
  padding: 0 14px;
  line-height: 1;
}

.btn.sm{
  height: var(--btn-h-sm);
  padding: 0 10px;
}

/* Save buttons are icon-only => render as perfect squares */
.btn.saveBtn{
  width: var(--btn-h) !important;
  min-width: var(--btn-h) !important;
  max-width: var(--btn-h) !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.btn.saveBtn .iconSave{
  width: 18px;
  height: 18px;
}

/* --- Ordering controls (ZIP54) --- */

.btn.btnMini {
  height: var(--btn-h-sm);
  width: var(--btn-h-sm);
  min-width: var(--btn-h-sm);
  padding: 0;
}

.posCell {
  width: 110px;

  white-space: nowrap;}

.posArrows {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.posArrows .posNum {
  min-width: 22px;
  text-align: center;
  font-weight: 700;
}

.posArrows .posNum {
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
}

/* Modules (front office): keep module rows aligned to the first line */
.modulesListTable th,
.modulesListTable td{
  vertical-align: top;
}

#stepsTable{
  width: 100%;
  table-layout: fixed;
}

#stepsTable th:nth-child(1),
#stepsTable td:nth-child(1){
  width: 120px;
}

#stepsTable th:nth-child(6),
#stepsTable td:nth-child(6){
  width: 150px;
}

#stepsTable td,
.quizQuestionsTable td {
  vertical-align: middle;
}

/* Quiz table: stable columns */
.quizQuestionsTable { table-layout: fixed; width: 100%; }
.quizQuestionsTable col.posCol { width: 110px; }
.quizQuestionsTable col.answerCol { width: 180px; }
.quizQuestionsTable col.activeCol { width: 120px; }
.quizQuestionsTable col.actionsCol { width: 120px; }

/* Modules list: pick a module by clicking a row */
.moduleRow.pickable { cursor: pointer; }
.moduleRow.pickable:hover { background: rgba(0,0,0,.03); }
.moduleRow.selected { background: rgba(0,0,0,.04); }

/* Generic utility */
.hidden{ display: none !important; }

/* Step editor ("Modifier" on points) */
.stepEditor{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0,0,0,.15);
}

.stepEditor .in{
  width: 100%;
}


/* Modules table: align toggle/switch a bit lower */
#modulesTable td .toggle,
#modulesTable td .switchYN {
  margin-top: 6px;
}

#modulesTable td .btn {
  margin-top: 4px;
}

.formGrid .fieldToggle .toggle,
.formGrid .fieldSwitch .switchYN {
  margin-top: 6px;
}

/* Quiz table: stable columns */
.quizQuestionsTable { table-layout: fixed; width: 100%; }
.quizQuestionsTable col.posCol { width: 110px; }
.quizQuestionsTable col.answerCol { width: 180px; }
.quizQuestionsTable col.activeCol { width: 120px; }
.quizQuestionsTable col.actionsCol { width: 120px; }

/* Modules list: pick a module by clicking a row */
.moduleRow.pickable { cursor: pointer; }
.moduleRow.pickable:hover { background: rgba(0,0,0,.03); }
.moduleRow.selected { background: rgba(0,0,0,.04); }



/* ----------------------------- modal ----------------------------- */
body.modal-open, body.modalOpen { overflow: hidden; }

.modalOverlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,0.35);
  z-index: 9999;
}

.modalDialog {
  width: min(840px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 30px 100px rgba(0,0,0,0.25);
  overflow: hidden;
}

.modalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.modalTitle {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.modalClose {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modalClose:hover {
  background: rgba(0,0,0,0.03);
}

.modalBody {
  padding: 18px;
}

.modalText{
  color: var(--mb-ink);
  line-height: 1.45;
  font-size: 14px;
}

.modalActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
}

.createPanel {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 12px;
}

/* Compact reorder arrows (points + quiz questions) */
.btn.btnArrow {
  padding: 6px 8px;
  min-width: 32px;
  height: 32px;
  justify-content: center;
}

.posArrows {
  gap: 8px;
}
.posArrows .posButtons {
  gap: 4px;
}

.posArrows .btn{
  min-width: 32px;
  height: 32px;
  padding: 0;
  line-height: 32px;
}
.posArrows .posNum {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

/* --- POS (reorder) controls: keep number + arrows on one line --- */
.posArrows{
  flex-wrap: nowrap;
  white-space: nowrap;
}
.posArrows .posButtons{
  display: inline-flex;
  flex-direction: row;
  gap: 6px;
  white-space: nowrap;
}
.posArrows .btn{
  min-width: 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  line-height: 32px;
}
