/* Quiz YS — back-office (violet & blanc) */
:root {
  --violet: #6D35E8;
  --violet-600: #5B21D6;
  --violet-700: #4C1BB0;
  --violet-50: #F4F0FE;
  --violet-100: #EAE2FD;
  --violet-200: #D6C7FB;
  --ink: #1E1442;
  --ink-2: #4B4672;
  --muted: #7A7598;
  --line: #ECE8F7;
  --bg: #F6F4FC;
  --card: #FFFFFF;
  --green: #16A34A;
  --green-50: #E8F8EE;
  --red: #E11D48;
  --red-50: #FDECF0;
  --amber: #F59E0B;
  --amber-50: #FEF5E1;
  --blue: #3B82F6;
  --blue-50: #E8F0FE;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(30, 20, 66, .04), 0 4px 18px rgba(30, 20, 66, .06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; }
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
code { background: var(--violet-50); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mb { margin-bottom: 14px; }
.c-red { color: var(--red); } .c-green { color: var(--green); } .c-violet { color: var(--violet); }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.adm { display: flex; min-height: 100vh; }
.adm-side {
  width: 236px; flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #3A0E8F 0%, #2A0A6B 55%, #1E0752 100%); color: #fff; padding: 18px 14px; z-index: 40;
}
.adm-brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 4px 8px 20px; text-decoration: none !important; }
.adm-brand-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #A78BFA, #6D35E8); box-shadow: 0 6px 18px rgba(109,53,232,.45); color: #FDE047; }
.adm-brand-ic .ic { width: 22px; height: 22px; }
.adm-brand-tx { font-weight: 800; font-size: 18px; line-height: 1.05; display: flex; flex-direction: column; }
.adm-brand-tx small { font-weight: 600; font-size: 13px; opacity: .8; }
.adm-nav { display: flex; flex-direction: column; gap: 4px; }
.adm-nav a { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.82); padding: 10px 12px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.adm-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.adm-nav a.is-active { background: linear-gradient(90deg, #7C3AED, #6D35E8); color: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.adm-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid rgba(255,255,255,.12); }
.adm-avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.14); display: grid; place-items: center; }
.adm-user-tx { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.adm-user-tx strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-user-tx small { opacity: .7; }
.adm-logout { background: none; border: 0; color: rgba(255,255,255,.75); cursor: pointer; padding: 6px; border-radius: 8px; }
.adm-logout:hover { background: rgba(255,255,255,.1); color: #fff; }
.adm-main { flex: 1; min-width: 0; padding: 24px 28px 48px; }
.adm-burger { display: none; }
.adm-backdrop { display: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 800; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Cards / grids ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.card-title { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head .card-title { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2-1 { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; }
.grid-3-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 1.8fr; gap: 18px; }
.grid-2 > .card, .grid-2-1 > .card, .grid-3-2 > .card, .grid-1-2 > .card { margin-bottom: 18px; }

.stats { display: grid; gap: 14px; margin-bottom: 18px; }
.stats-5 { grid-template-columns: repeat(5, 1fr); }
.stats-4 { grid-template-columns: repeat(4, 1fr); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; align-items: center; gap: 14px; }
.stat strong { font-size: 24px; font-weight: 800; display: block; line-height: 1.1; }
.stat span { color: var(--ink-2); font-size: 13px; }
.stat-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.stat-ic .ic { width: 22px; height: 22px; }
.ic-violet { background: var(--violet-100); color: var(--violet); }
.ic-blue { background: var(--blue-50); color: var(--blue); }
.ic-green { background: var(--green-50); color: var(--green); }
.ic-amber { background: var(--amber-50); color: var(--amber); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none !important; transition: .15s; white-space: nowrap; }
.btn .ic { width: 16px; height: 16px; }
.btn-primary { background: linear-gradient(135deg, #7C3AED, #6D35E8); color: #fff; box-shadow: 0 6px 16px rgba(109,53,232,.28); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-outline { background: #fff; color: var(--violet); border-color: var(--violet-200); }
.btn-outline:hover { background: var(--violet-50); }
.btn-danger-outline { background: #fff; color: var(--red); border-color: #F7C4D0; }
.btn-danger-outline:hover { background: var(--red-50); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--violet-50); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; filter: none; }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none !important; }
.icon-btn:hover { background: var(--violet-50); color: var(--violet); }
.icon-btn.danger { color: var(--red); }
.icon-btn.danger:hover { background: var(--red-50); }
.icon-btn .ic { width: 17px; height: 17px; }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.link { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 13px; }
.link .ic { width: 15px; height: 15px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-live { background: var(--green); color: #fff; }
.badge-red { background: var(--red); color: #fff; }
.badge-ready { background: var(--violet-100); color: var(--violet-600); }
.badge-done { background: #EEF0F4; color: #586174; }
.badge-muted { background: #F1F0F6; color: var(--muted); }
.badge-info { background: var(--blue-50); color: var(--blue); }
.badge-green { background: var(--green-50); color: var(--green); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-2); padding: 9px 10px; background: #FAF9FE; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.t-right { text-align: right !important; }
.t-actions { white-space: nowrap; }
.t-quiz { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.t-quiz a { color: var(--ink); }
.t-thumb { width: 34px; height: 34px; border-radius: 8px; overflow: hidden; background: linear-gradient(135deg, #4C1D95, #7C3AED); color: #FCD34D; display: grid; place-items: center; flex: none; }
.t-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rank { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--violet-50); color: var(--violet); font-weight: 800; }
.rank-1 { background: #FEF3C7; color: #B45309; } .rank-2 { background: #F1F5F9; color: #475569; } .rank-3 { background: #FDE8D7; color: #9A3412; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.ans { display: inline-block; min-width: 28px; padding: 2px 6px; border-radius: 7px; font-weight: 800; font-size: 12px; }
.ans.ok { background: var(--green-50); color: var(--green); }
.ans.ko { background: var(--red-50); color: var(--red); }
.ans.none { color: #B9B5CC; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 700; color: var(--ink); }
.req { color: var(--red); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=datetime-local], input:not([type]), select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid #DCD6EE; border-radius: 10px; padding: 9px 12px; width: 100%; outline: none; transition: .15s;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(109,53,232,.14); }
input.is-invalid, textarea.is-invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(225,29,72,.1); }
.select-sm { width: auto; padding: 6px 10px; font-size: 13px; }
.field-inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.field-inline select { width: auto; min-width: 240px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.inline-form input, .inline-form select { flex: 1; min-width: 140px; width: auto; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid #DCD6EE; border-radius: 10px; padding: 0 10px; background: #fff; flex: 1; min-width: 200px; }
.search input { border: 0 !important; box-shadow: none !important; padding: 9px 0; }
.search .ic { color: var(--muted); }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.input-icon input, .input-icon select { padding-left: 34px; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 600; padding: 6px 0; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 40px; height: 22px; border-radius: 999px; background: #D9D5E6; position: relative; transition: .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + .track { background: var(--violet); }
.switch input:checked + .track::after { left: 21px; }
.switch input:disabled + .track { opacity: .45; }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(109,53,232,.25); }
.switch .tip { color: var(--muted); display: inline-flex; }
.switch .tip .ic { width: 15px; height: 15px; }

/* ---------- Alerts / misc ---------- */
.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; white-space: pre-line; }
.alert-success { background: var(--green-50); color: #166534; }
.alert-error { background: var(--red-50); color: #9F1239; }
.alert-warning { background: var(--amber-50); color: #92400E; }
.alert-info { background: var(--violet-50); color: var(--violet-700); }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty > .ic { width: 34px; height: 34px; color: var(--violet-200); }
.empty p { margin: 8px 0 6px; font-weight: 700; color: var(--ink-2); }
.empty small { display: block; margin-bottom: 8px; }
.meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-2); font-size: 13px; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta .ic { width: 15px; height: 15px; color: var(--violet); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.h3 { font-size: 15px; font-weight: 800; margin: 16px 0 8px; }
.loading { padding: 60px; text-align: center; color: var(--muted); }
.log { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow: auto; }
.log li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.log time { color: var(--muted); display: inline-block; min-width: 150px; }

/* ---------- Dashboard ---------- */
.live-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.live-thumb { width: 92px; height: 70px; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, #2A0A6B, #7C3AED); display: grid; place-items: center; color: #FCD34D; flex: none; }
.live-thumb img { width: 100%; height: 100%; object-fit: cover; }
.live-thumb .ic { width: 34px; height: 34px; }
.live-info { flex: 1; min-width: 0; }
.live-info strong { font-size: 15px; display: block; margin-bottom: 6px; }
.live-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; font-weight: 700; color: var(--ink); text-decoration: none; }
.quick a:hover { border-color: var(--violet-200); background: var(--violet-50); }
.quick .ic { width: 22px; height: 22px; color: var(--violet); padding: 8px; box-sizing: content-box; background: var(--violet-50); border-radius: 10px; }
.chart { width: 100%; height: 210px; display: block; }
.chart-grid { stroke: #EEEAF8; stroke-width: 1; }
.chart-label { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.chart-line { fill: none; stroke: #8B5CF6; stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-dot { fill: #fff; stroke: #8B5CF6; stroke-width: 2; }

/* ---------- Quiz list ---------- */
.quiz-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.quiz-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.quiz-card-img { height: 130px; background-size: cover; background-position: center; display: grid; place-items: center; position: relative; }
.quiz-card-img img { max-height: 96px; max-width: 70%; object-fit: contain; }
.quiz-card-ic .ic { width: 54px; height: 54px; color: #FCD34D; }
.quiz-card-live { position: absolute; top: 10px; right: 10px; }
.quiz-card-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.quiz-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.quiz-card-top h3 { font-size: 15px; }
.quiz-card-top h3 a { color: var(--ink); }
.quiz-card-actions { display: flex; gap: 6px; align-items: center; margin-top: auto; flex-wrap: wrap; }

/* ---------- Create / templates ---------- */
.create-form { max-width: 820px; }
.tpl-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tpl-option input { position: absolute; opacity: 0; }
.tpl-box { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; height: 100%; }
.tpl-option input:checked + .tpl-box { border-color: var(--violet); background: var(--violet-50); }
.tpl-option input:focus-visible + .tpl-box { box-shadow: 0 0 0 3px rgba(109,53,232,.25); }
.tpl-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--violet-100); color: var(--violet); display: grid; place-items: center; margin-bottom: 4px; }
.tpl-ic.big { width: 50px; height: 50px; }
.tpl-ic.big .ic { width: 26px; height: 26px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tpl-card { border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.tpl-card p { margin: 0; }
.tpl-details { width: 100%; font-size: 13px; }
.tpl-details summary { cursor: pointer; color: var(--violet); font-weight: 700; }
.tpl-details ol { padding-left: 18px; color: var(--ink-2); }

/* ---------- Auth / install ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 10% -10%, #7C3AED33, transparent), radial-gradient(900px 500px at 110% 110%, #6D35E833, transparent), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 18px; padding: 28px; box-shadow: 0 20px 60px rgba(30,20,66,.12); border: 1px solid var(--line); }
.install-card { max-width: 620px; }
.auth-card h1 { font-size: 22px; margin: 18px 0 6px; display: flex; align-items: center; gap: 8px; }
.auth-card > p { margin: 0 0 18px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.auth-brand small { color: var(--muted); font-weight: 600; }
.checklist { list-style: none; padding: 0; margin: 0 0 16px; }
.checklist li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-weight: 600; }
.checklist li.ok .ic { color: var(--green); } .checklist li.ko { color: var(--red); } .checklist li.warn .ic { color: var(--amber); }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.radio-card { display: flex; gap: 10px; padding: 12px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--violet); background: var(--violet-50); }
.radio-card span { display: flex; flex-direction: column; gap: 3px; }
.radio-card small { color: var(--muted); }
.code-area { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }

/* ---------- Toasts / modal ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-weight: 600; max-width: 380px; animation: tin .2s ease-out; white-space: pre-line; }
.toast.success { background: #15803D; } .toast.error { background: #BE123C; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
.modal-bg { position: fixed; inset: 0; background: rgba(20,10,50,.45); display: grid; place-items: center; z-index: 999; padding: 16px; animation: fin .15s; }
@keyframes fin { from { opacity: 0; } }
.modal { background: #fff; border-radius: 16px; padding: 22px; width: 100%; max-width: 440px; box-shadow: 0 30px 80px rgba(0,0,0,.25); color: var(--ink); font-family: var(--font); }
.modal h3 { font-size: 18px; margin-bottom: 8px; }
.modal p { color: var(--ink-2); margin: 0 0 18px; white-space: pre-line; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.btn-danger { background: var(--red); color: #fff; }

/* ---------- Editor ---------- */
.ed-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ed-title { flex: 1; min-width: 200px; }
.ed-title h1 { font-size: 22px; font-weight: 800; }
.ed-title span { color: var(--ink-2); font-weight: 600; }
.dirty-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.dirty-pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.dirty-pill.is-dirty i { background: var(--amber); }
.dirty-pill.is-dirty { color: #92400E; }
.ed-tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px; margin-bottom: 16px; overflow-x: auto; box-shadow: var(--shadow); }
.ed-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: none; border: 0; padding: 10px 14px; font: inherit; font-weight: 700; color: var(--ink-2); border-radius: 10px; cursor: pointer; white-space: nowrap; position: relative; }
.ed-tabs button:hover { background: var(--violet-50); }
.ed-tabs button.is-active { color: var(--violet); background: var(--violet-50); }
.ed-tabs button.is-active::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: 2px; height: 3px; border-radius: 3px; background: var(--violet); }
.ed-tabs button.has-error { color: var(--red); }
.ed-errors { background: var(--red-50); color: #9F1239; border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; font-weight: 600; }
.ed-errors ul { margin: 6px 0 0; padding-left: 18px; }
.ed-cols { display: grid; gap: 16px; align-items: start; }
.ed-cols-info { grid-template-columns: 1fr 340px; }
.ed-cols-cand { grid-template-columns: 300px 1fr; }
.ed-cols-q { grid-template-columns: 300px 1fr 360px; }
.ed-cols-design { grid-template-columns: 1fr 1fr 380px; }
.ed-cols-pub { grid-template-columns: 1fr 1fr 1fr; }
.ed-cols > * { margin-bottom: 0; }
.sticky { position: sticky; top: 16px; }

.img-pick { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.img-pick-box { width: 160px; height: 120px; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #2A0A6B, #7C3AED); display: grid; place-items: center; color: #FCD34D; border: 1px solid var(--line); }
.img-pick-box img { width: 100%; height: 100%; object-fit: cover; }
.img-pick-box .ic { width: 46px; height: 46px; }
.info-grid { display: grid; grid-template-columns: 170px 1fr; gap: 18px; }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
.preview-card { border-radius: 14px; overflow: hidden; background-size: cover; background-position: center; color: #fff; height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 14px; gap: 10px; }
.preview-card img { max-height: 80px; max-width: 60%; object-fit: contain; }
.preview-card .ic { width: 56px; height: 56px; color: #FCD34D; }
.preview-card h3 { font-size: 22px; font-weight: 800; text-shadow: 0 2px 10px rgba(0,0,0,.3); }
.preview-facts { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 10px; }
.preview-facts li { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.preview-facts .ic { color: var(--violet); }

.cand-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.code-cell { display: inline-flex; align-items: center; gap: 4px; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; letter-spacing: 2px; font-size: 15px; }
.code-input { width: 70px !important; text-align: center; font-family: ui-monospace, Menlo, monospace; font-weight: 800; letter-spacing: 2px; }
.status-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 0; cursor: pointer; }
.status-pill.active { background: var(--green-50); color: var(--green); }
.status-pill.disabled { background: #F1F0F6; color: var(--muted); }
.status-pill .ic { width: 13px; height: 13px; }
.idx { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--violet-50); color: var(--violet); font-weight: 800; font-size: 12px; flex: none; }
.cand-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--violet-100); color: var(--violet); display: inline-grid; place-items: center; flex: none; }
.cand-avatar .ic { width: 15px; height: 15px; }
.cand-name { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.bulk-bar { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 8px; flex-wrap: wrap; }
.bulk-bar select { width: auto; }
.bulk-bar .spacer { flex: 1; }
.chk { width: 16px; height: 16px; accent-color: var(--violet); }

.q-list { list-style: none; padding: 0; margin: 0; max-height: 62vh; overflow: auto; }
.q-item { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.q-item:hover { background: #FAF9FE; }
.q-item.is-active { background: var(--violet-50); border-color: var(--violet-200); }
.q-item.has-error .idx { background: var(--red-50); color: var(--red); }
.q-item.drag-over { border-top: 2px solid var(--violet); }
.q-item .grip { color: #B9B5CC; cursor: grab; display: inline-flex; }
.q-item .grip .ic { width: 15px; height: 15px; }
.q-item .q-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.q-item .q-txt em { color: var(--muted); font-weight: 500; }
.q-item .icon-btn { width: 26px; height: 26px; }
.q-item .icon-btn .ic { width: 15px; height: 15px; }
.q-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 8px; font-weight: 700; }
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.q-head .card-title { margin: 0; }
.choice-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.choice-row .letter { width: 28px; height: 28px; border-radius: 8px; background: var(--violet-50); color: var(--violet); display: grid; place-items: center; font-weight: 800; flex: none; }
.choice-row.is-correct input[type=text] { background: var(--green-50); border-color: #9EDDB5; }
.choice-row .correct-toggle { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #CFC9E3; background: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; color: transparent; }
.choice-row .correct-toggle.multi { border-radius: 7px; }
.choice-row.is-correct .correct-toggle { background: var(--green); border-color: var(--green); color: #fff; }
.choice-row .correct-toggle .ic { width: 15px; height: 15px; }
.btn-add-choice { width: 100%; border: 1.5px dashed var(--violet-200); background: #fff; color: var(--violet); padding: 9px; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; margin: 4px 0 14px; }
.btn-add-choice:hover { background: var(--violet-50); }
.hint { font-size: 12px; color: var(--muted); margin-top: -8px; margin-bottom: 12px; }

.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.preset { height: 62px; border-radius: 12px; border: 2px solid transparent; background-size: cover; background-position: center; color: #fff; font-weight: 700; font-size: 12px; display: flex; align-items: flex-end; padding: 8px; cursor: pointer; position: relative; text-shadow: 0 1px 4px rgba(0,0,0,.4); font-family: inherit; }
.preset.is-active { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(109,53,232,.2); }
.preset.is-active::after { content: "✓"; position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: var(--violet); display: grid; place-items: center; font-size: 12px; text-shadow: none; }
.preset.light { color: var(--ink); text-shadow: none; }
.opt-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.opt-card { border: 2px solid var(--line); border-radius: 12px; padding: 10px; display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; font-size: 13px; background: #fff; font-family: inherit; color: var(--ink); }
.opt-card.is-active { border-color: var(--violet); background: var(--violet-50); }
.opt-card .demo { width: 54px; height: 20px; border-radius: 6px; background: linear-gradient(135deg, #8B5CF6, #6D35E8); flex: none; }
.opt-card .demo.outline { background: #fff; border: 2px solid #8B5CF6; }
.color-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.color-row label { flex: 1; font-weight: 600; font-size: 13px; }
.color-row input[type=color] { width: 36px; height: 30px; border: 1px solid #DCD6EE; border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.color-row input[type=text] { width: 100px; font-family: ui-monospace, Menlo, monospace; text-transform: uppercase; }
.bg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.bg-opt { aspect-ratio: 4/3; border-radius: 10px; border: 2px solid transparent; background-size: cover; background-position: center; cursor: pointer; position: relative; padding: 0; }
.bg-opt.is-active { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(109,53,232,.2); }
.bg-opt.is-active::after { content: "✓"; position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 50%; background: #fff; color: var(--violet); display: grid; place-items: center; font-size: 11px; }
.logo-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo-prev { height: 54px; min-width: 120px; padding: 6px 12px; border-radius: 10px; background: linear-gradient(135deg, #2A0A6B, #6D35E8); display: flex; align-items: center; justify-content: center; gap: 6px; color: #fff; font-weight: 800; }
.logo-prev img { max-height: 42px; max-width: 160px; object-fit: contain; }
.device-toggle { display: inline-flex; gap: 4px; background: var(--violet-50); padding: 3px; border-radius: 10px; }
.device-toggle button { border: 0; background: transparent; border-radius: 8px; padding: 5px 8px; cursor: pointer; color: var(--ink-2); display: inline-grid; place-items: center; }
.device-toggle button.is-active { background: var(--violet); color: #fff; }
.preview-frame { border-radius: 16px; overflow: hidden; margin: 0 auto; transition: width .2s; width: 100%; }
.preview-frame.mobile { width: 260px; }
.preview-frame.tablet { width: 320px; }

.link-box { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.link-box input { font-size: 12.5px; background: #FAF9FE; }
.host-code { display: flex; align-items: center; gap: 10px; }
.host-code strong { font-size: 30px; letter-spacing: 10px; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--violet-700); background: var(--violet-50); border-radius: 12px; padding: 6px 16px; }
.access-block { border: 1px solid var(--violet-200); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.access-block h3 { font-size: 14px; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.access-block p { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; }
.status-radios { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.status-radios label { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 2px solid var(--line); border-radius: 10px; cursor: pointer; }
.status-radios label:has(input:checked) { border-color: var(--violet); background: var(--violet-50); }
.status-radios small { display: block; color: var(--muted); }
.publish-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: linear-gradient(90deg, var(--violet-50), #fff); border: 1px solid var(--violet-200); border-radius: 14px; padding: 16px 18px; margin-top: 16px; flex-wrap: wrap; }
.publish-bar h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.publish-bar p { margin: 2px 0 0; color: var(--muted); }

/* ---------- Shows (éditeur) ---------- */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--violet-50); padding: 4px; border-radius: 12px; margin-bottom: 14px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: transparent; border-radius: 9px; padding: 9px 10px; font: inherit; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.seg button.is-active { background: #fff; color: var(--violet); box-shadow: 0 2px 8px rgba(30,20,66,.1); }
.seg button:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; }
.icon-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.icon-pick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-size: 12px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.icon-pick button .ic { width: 26px; height: 26px; color: var(--show, var(--violet)); }
.icon-pick button.is-active { border-color: var(--show, var(--violet)); background: var(--violet-50); color: var(--ink); }
.color-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.color-pick button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.color-pick button.is-active { box-shadow: 0 0 0 2px var(--ink); }
.color-pick input[type=color] { width: 40px; height: 32px; border: 1px solid #DCD6EE; border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.show-dot { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: #fff; flex: none; }
.show-dot .ic { width: 15px; height: 15px; }
.show-th .ic { width: 18px; height: 18px; }
.q-add-row { display: flex; gap: 6px; }
.custom-color-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1.5px dashed var(--violet-200); background: #fff; color: var(--violet); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.custom-color-btn .ic { width: 16px; height: 16px; }
.custom-color-btn:hover { background: var(--violet-50); }
.custom-color-btn.is-active { border-style: solid; border-color: var(--show, var(--violet)); color: var(--ink); }
.custom-color { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin: -4px 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #FAF9FE; }
.custom-color input[type=color] { width: 48px; height: 38px; border: 1px solid #DCD6EE; border-radius: 10px; padding: 3px; background: #fff; cursor: pointer; flex: none; }
.hex-input { flex: 1; min-width: 140px; }
.hex-input input { padding-left: 48px; font-family: ui-monospace, Menlo, Consolas, monospace; text-transform: uppercase; }
.hex-hash { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .05em; }
.color-preview { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.color-preview .ic { width: 20px; height: 20px; }
.pts-hint { display: block; color: var(--red); margin-top: 4px; }

/* ---------- Corrections manuelles ---------- */
.ans-btn { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 40px; padding: 3px 4px; border: 1px solid transparent; border-radius: 9px; background: transparent; font: inherit; cursor: pointer; }
.ans-btn:hover { border-color: var(--violet-200); background: var(--violet-50); }
.ans-btn:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; }
.ans-btn .ic { width: 14px; height: 14px; }
.ans-btn.is-fixed::after, .ans-legend i { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 2px #fff; }
.ans-btn.is-fixed::after { position: absolute; top: -2px; right: -2px; }
.ans-legend { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.ans-pts { font-size: 10.5px; font-weight: 700; color: #92400E; }
.fix-modal { max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; }
.fix-info { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 4px 0 16px; padding: 12px 14px; background: #FAF9FE; border: 1px solid var(--line); border-radius: 12px; }
.fix-info dt { color: var(--muted); font-size: 13px; }
.fix-info dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.fix-opt { padding: 10px 0; border-top: 1px solid var(--line); }
.fix-opt p { margin: 6px 0 0; }
.fix-choices { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.fix-choice { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 10px; background: #fff; font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
.fix-choice b { width: 24px; height: 24px; border-radius: 7px; background: var(--violet-50); color: var(--violet); display: grid; place-items: center; flex: none; }
.fix-choice.is-on { border-color: var(--violet); background: var(--violet-50); }
.fix-summary { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--violet-50); color: var(--violet-700); }
.fix-summary span { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.fix-summary small { color: var(--ink-2); }
.fix-actions { flex-wrap: wrap; margin-top: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .ed-cols-q { grid-template-columns: 260px 1fr; }
  .ed-cols-q > .q-preview-col { grid-column: 1 / -1; }
  .ed-cols-design { grid-template-columns: 1fr 1fr; }
  .ed-cols-design > .design-preview-col { grid-column: 1 / -1; }
  .stats-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1080px) {
  .grid-2-1, .grid-3-2, .grid-1-2, .ed-cols-info, .ed-cols-cand, .ed-cols-pub { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 860px) {
  .adm-side { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  .adm-side.is-open { transform: none; }
  .adm-backdrop.is-open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }
  .adm-burger { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; margin-bottom: 12px; cursor: pointer; color: var(--ink); }
  .adm-main { padding: 16px 16px 40px; }
  .grid-2, .ed-cols-q, .ed-cols-design, .info-grid, .opt-grid, .row-2, .row-3, .radio-cards, .tpl-pick { grid-template-columns: 1fr; }
  .stats-5, .stats-4, .cand-stats { grid-template-columns: 1fr 1fr; }
  .quick { grid-template-columns: 1fr; }
  .ed-head .btn-primary { width: 100%; }
}
