/* Charte event.elecom.fr : Montserrat, noir #0a0a0a + jaune #FCD400 */
@font-face { font-family: 'Montserrat'; font-weight: 100 900; font-display: swap;
  src: url('/fonts/montserrat-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-weight: 100 900; font-display: swap;
  src: url('/fonts/montserrat-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #0a0a0a; --panel: #141414; --panel2: #1b1b1b; --line: #262626; --line2: #333;
  --text: #f5f5f5; --muted: #9a9a9a; --accent: #FCD400; --accent-h: #ffe14d; --accent-ink: #0a0a0a;
  --danger: #ff5c5c; --ok: #3ecf8e; --r: 12px;
}
* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Montserrat', system-ui, sans-serif; font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }

/* ---------- login ---------- */
.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(900px 500px at 80% -10%, rgba(252,212,0,.14), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 36px 32px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { height: 34px; width: auto; display: block; }
.brand .launcher-tag { font-size: 12px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); padding: 3px 9px 3px 11px; border-radius: 6px; }
.login-card h1 { font-size: 15px; font-weight: 500; color: var(--muted); margin: 10px 0 28px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.input, select.input, textarea.input { width: 100%; background: var(--bg); border: 1px solid var(--line2); border-radius: 10px; padding: 11px 13px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(252,212,0,.18); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line2); background: var(--panel2); border-radius: 10px; padding: 9px 16px; font-weight: 600; cursor: pointer; transition: all .15s; }
.btn:hover { border-color: #555; background: #222; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-h); border-color: var(--accent-h); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.sm { padding: 5px 11px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; padding: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.err { color: var(--danger); font-size: 13px; min-height: 20px; margin: 4px 0 12px; }
.ok-msg { color: var(--ok); }

/* ---------- shell ---------- */
.shell { display: flex; flex-direction: column; height: 100%; }
.topbar { display: flex; align-items: stretch; gap: 14px; height: 54px; padding: 0 14px; background: #0f0f0f; border-bottom: 1px solid var(--line); flex: none; }
.topbar .brand { align-self: center; padding-right: 6px; cursor: pointer; }
.topbar .brand .logo { height: 22px; }
.topbar .brand .launcher-tag { font-size: 10px; padding: 2px 7px 2px 9px; }
.tabs { display: flex; align-items: flex-end; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; padding-top: 10px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: flex; align-items: center; gap: 8px; max-width: 220px; min-width: 0; height: 100%; padding: 0 12px; border: 1px solid transparent; border-bottom: none; border-radius: 10px 10px 0 0; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; background: transparent; white-space: nowrap; flex: none; }
.tab:hover { color: var(--text); background: #181818; }
.tab.active { color: var(--text); background: var(--bg); border-color: var(--line); box-shadow: inset 0 2px 0 var(--accent); }
.tab .t-ic { font-size: 15px; }
.tab .t-name { overflow: hidden; text-overflow: ellipsis; }
.tab .t-x { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; line-height: 1; color: var(--muted); flex: none; }
.tab .t-x:hover { background: #333; color: var(--text); }
.userbox { display: flex; align-items: center; gap: 10px; align-self: center; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: 13px; cursor: pointer; border: none; }
.menu { position: absolute; right: 14px; top: 56px; width: 250px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 8px; z-index: 50; box-shadow: 0 18px 50px rgba(0,0,0,.6); }
.menu .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .who b { display: block; }
.menu .who small { color: var(--muted); }
.menu button { display: block; width: 100%; text-align: left; background: none; border: none; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.menu button:hover { background: var(--panel2); }
.badge { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; padding: 2px 8px; border-radius: 99px; background: rgba(252,212,0,.14); color: var(--accent); }
.badge.off { background: rgba(255,92,92,.14); color: var(--danger); }
.badge.grey { background: #222; color: var(--muted); }

.stage { position: relative; flex: 1; min-height: 0; }
.view { position: absolute; inset: 0; overflow: auto; }
.frame-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; background: #fff; }
.frame-bar { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: #111; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); flex: none; }
.frame-bar .url { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame-wrap iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.frame-wrap .loading { position: absolute; inset: 38px 0 0; display: grid; place-items: center; background: var(--bg); color: var(--muted); pointer-events: none; transition: opacity .25s; }
.frame-wrap .loading.done { opacity: 0; }

/* ---------- accueil ---------- */
.home { max-width: 1180px; margin: 0 auto; padding: 38px 28px 60px; }
.home h2 { font-size: 30px; font-weight: 800; letter-spacing: -1px; margin: 0; }
.home h2 i { color: var(--accent); font-style: normal; }
.home .sub { color: var(--muted); margin: 6px 0 26px; }
.search { max-width: 420px; margin-bottom: 30px; }
.cat { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin: 28px 0 14px; display: flex; align-items: center; gap: 12px; }
.cat::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.card { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; cursor: pointer; transition: transform .15s, border-color .15s, background .15s; display: flex; flex-direction: column; gap: 6px; min-height: 140px; }
.card:hover { transform: translateY(-3px); border-color: var(--accent); background: #181818; }
.card .ic { width: 46px; height: 46px; border-radius: 12px; background: #0a0a0a; border: 1px solid var(--line2); display: grid; place-items: center; font-size: 24px; font-weight: 800; color: var(--accent); margin-bottom: 6px; }
.card b { font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
.card .ext { font-size: 11px; color: var(--muted); }
.empty { color: var(--muted); padding: 50px 0; text-align: center; border: 1px dashed var(--line2); border-radius: 16px; }

/* ---------- admin ---------- */
.admin { max-width: 1180px; margin: 0 auto; padding: 30px 28px 60px; }
.admin h2 { margin: 0 0 18px; font-size: 26px; font-weight: 800; letter-spacing: -.8px; }
.subtabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.subtab { background: none; border: none; padding: 10px 16px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtab.active { color: var(--text); border-color: var(--accent); }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; }
.toolbar span { color: var(--muted); }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: #101010; }
tr:last-child td { border-bottom: none; }
td .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
td small { color: var(--muted); display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: grid; place-items: center; padding: 20px; z-index: 100; overflow: auto; }
.modal { width: 100%; max-width: 560px; background: var(--panel); border: 1px solid var(--line2); border-radius: 18px; padding: 26px; max-height: calc(100vh - 40px); overflow: auto; }
.modal h3 { margin: 0 0 18px; font-size: 18px; }
.modal .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.checklist { max-height: 170px; overflow: auto; border: 1px solid var(--line2); border-radius: 10px; padding: 6px; background: var(--bg); }
.checklist label { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.checklist label:hover { background: var(--panel2); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
.pwd-box { background: var(--bg); border: 1px dashed var(--accent); border-radius: 10px; padding: 14px; font-weight: 700; font-size: 17px; letter-spacing: .05em; text-align: center; user-select: all; color: var(--accent); margin: 12px 0; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 11px 20px; border-radius: 10px; z-index: 200; }

@media (max-width: 720px) {
  .topbar { gap: 8px; padding: 0 8px; }
  .home, .admin { padding: 22px 14px 50px; }
  .modal .row { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
}
.topbar > div:first-child { display: flex; align-items: center; }

/* ---------- tuiles ---------- */
.tile { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; min-height: 176px; padding: 18px; border-radius: 20px; border: 1px solid rgba(255,255,255,.08); color: #fff; text-align: left; cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; isolation: isolate; width: 100%; }
div.tile { cursor: default; }
button.tile:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 16px 40px rgba(0,0,0,.55), 0 0 0 1px var(--accent); }
.tile.has-img::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.85) 8%, rgba(0,0,0,.15) 70%); z-index: -1; }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; }
.tile-ic { width: 54px; height: 54px; border-radius: 15px; background: rgba(0,0,0,.28); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.14); display: grid; place-items: center; font-size: 28px; font-weight: 800; }
.tile-ic svg { width: 30px; height: 30px; }
.tile-ext { font-size: 15px; opacity: .75; }
.tile-txt { display: flex; flex-direction: column; gap: 2px; }
.tile-txt b { font-size: 18px; font-weight: 800; letter-spacing: -.3px; line-height: 1.2; }
.tile-txt span { font-size: 13px; opacity: .8; line-height: 1.35; }
.tile.light { color: #0a0a0a; }
.tile.light .tile-ic { background: rgba(255,255,255,.35); border-color: rgba(0,0,0,.12); }
.picto { display: inline-grid; place-items: center; } .picto svg { width: 100%; height: 100%; }
.mini { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; font-size: 18px; border: 1px solid rgba(255,255,255,.1); }

/* ---------- formulaire générateur ---------- */
.modal.wide { max-width: 680px; }
.section { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin: 22px 0 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.modal > .section:first-of-type, .modal h3 + div > .section:first-child { margin-top: 0; border: none; padding-top: 0; }
.preview-box { max-width: 290px; margin: 0 0 16px; }
.picto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; max-height: 150px; overflow: auto; padding: 6px; background: var(--bg); border: 1px solid var(--line2); border-radius: 10px; }
.pk { height: 42px; border-radius: 9px; border: 1px solid transparent; background: var(--panel2); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.pk svg { width: 22px; height: 22px; }
.pk:hover { border-color: #555; } .pk.on { border-color: var(--accent); color: var(--accent); background: rgba(252,212,0,.1); }
.segs { display: inline-flex; border: 1px solid var(--line2); border-radius: 9px; overflow: hidden; margin-bottom: 12px; }
.seg { background: var(--bg); border: none; padding: 7px 16px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg.on { background: var(--accent); color: var(--accent-ink); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.sw { width: 38px; height: 38px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; outline: 1px solid var(--line2); }
.sw:hover { border-color: var(--accent); }
.colors { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.colors label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
input[type=color] { width: 38px; height: 30px; padding: 0; border: 1px solid var(--line2); border-radius: 8px; background: none; cursor: pointer; }

.ico { display: inline-grid; place-items: center; width: 16px; height: 16px; flex: none; }
.ico svg { width: 100%; height: 100%; }
.menu button { display: flex; align-items: center; gap: 10px; }
.tab .t-ic { display: inline-grid; place-items: center; width: 16px; height: 16px; }
.tab .t-ic svg { width: 100%; height: 100%; }
.badge.grey .ico { width: 11px; height: 11px; }
.btn .ico svg { stroke-width: 2.4; }

/* ---------- mobile / tablette / PWA ---------- */
.topbar { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
@media (max-width: 640px) { .topbar .launcher-tag { display: none; } .tab { max-width: 150px; } }
@media (display-mode: standalone) { body { overscroll-behavior: none; } }
.card, .tile, .btn, .tab { -webkit-tap-highlight-color: transparent; }
.login-wrap { grid-template-columns: minmax(0, 1fr); }
.login-card { margin: 0 auto; }
@media (max-width: 480px) { .login-card { padding: 28px 22px; } .brand .logo { height: 28px; } }
