@font-face { font-family: Libron; src: url('/ui/fonts/Libron-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Libron; src: url('/ui/fonts/Libron-Italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: Libron; src: url('/ui/fonts/Libron-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: Libron; src: url('/ui/fonts/Libron-BoldItalic.woff2') format('woff2'); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  --paper: #faf8f4; --card: #fff; --ink: #1c1b19; --muted: #6f6b63; --line: #e4dfd5;
  --accent: #1f4fd8; --accent-soft: #e8eefc; --ok: #1d7a46; --warn: #a15c00; --danger: #b3261e;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Libron, Georgia, serif; background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.45; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 700; }

.btn { border: 1px solid var(--line); background: var(--card); padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.btn:hover { border-color: #c9c2b4; background: #fffdf9; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1a43b8; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: 3px 9px; font-size: 14px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* connexion */
.center-page { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 32px; width: 100%; max-width: 380px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 24px; margin-bottom: 4px; }
.login-card form { display: grid; gap: 12px; margin-top: 20px; }
.login-card input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.error { color: var(--danger); min-height: 1.4em; font-size: 14px; }

/* tableau de bord */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--card); }
.topbar h1 { font-size: 20px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 28px 24px; }
.deck-list { display: grid; gap: 12px; margin-top: 18px; }
.deck-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.deck-row h2 { font-size: 18px; }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); margin-left: 8px; vertical-align: 2px; }
.badge.ok { background: #e3f4ea; color: var(--ok); }
.empty { border: 1px dashed #cfc8b9; border-radius: var(--radius); padding: 28px; color: var(--muted); background: #fffdf8; }
.empty code { background: #f1ede3; padding: 1px 6px; border-radius: 4px; }

/* éditeur */
.editor { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.editor .topbar { padding: 8px 16px; gap: 12px; }
.editor .topbar .left, .editor .topbar .right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.editor .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 36vw; }
.status { font-size: 13px; color: var(--muted); min-width: 120px; text-align: right; }
.status.err { color: var(--danger); }
.panes { display: grid; grid-template-columns: 220px 1fr 300px; min-height: 0; }
.slides-pane, .notes-pane { background: var(--card); overflow: auto; padding: 10px; }
.slides-pane { border-right: 1px solid var(--line); }
.notes-pane { border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.slide-item { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; cursor: pointer; background: #fff; display: grid; grid-template-columns: 24px 1fr; gap: 6px; position: relative; }
.slide-item .n { color: var(--muted); font-size: 13px; padding-top: 2px; }
.slide-item .t { font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.slide-item.active { border-color: var(--accent); background: var(--accent-soft); }
.slide-item.drop-before { box-shadow: 0 -3px 0 var(--accent); }
.slide-item .acts { position: absolute; right: 4px; top: 4px; display: none; gap: 2px; }
.slide-item:hover .acts { display: flex; }
.acts button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 0 6px; cursor: pointer; font-size: 13px; line-height: 20px; }
.stage-pane { background: #2a2925; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 12px; }
.stage-pane iframe { width: 100%; height: 100%; border: 0; background: #000; border-radius: 6px; }
.notes-pane h3 { font-size: 15px; }
.notes-pane textarea { flex: 1; min-height: 160px; resize: none; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf8; }
.hint { font-size: 13px; color: var(--muted); }

/* panneaux flottants */
.panel { position: fixed; right: 16px; top: 56px; width: 380px; max-height: 80vh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.18); z-index: 20; display: grid; gap: 12px; }
.panel h3 { font-size: 17px; }
.panel input[type=text] { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf8; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.qr { width: 180px; height: 180px; border: 1px solid var(--line); border-radius: 8px; image-rendering: pixelated; }
.hist-item { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #222; color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 14px; z-index: 30; }
