/*
VOICE: régie de stream, nette et nocturne, faite pour être lue d'un coup d'œil pendant un live.
IDEA: la console de régie : panneaux sombres, voyants allumés, une seule couleur « on air ».
PICTURE: la scène d'overlay et le flux d'activité en direct sont les images principales.
COLOUR/TYPE: noir encre, panneaux ardoise, orange « on air » #ff5a36 ; Inter Tight pour les titres, Inter pour le texte.
LAYOUT: barre latérale de navigation, contenu en grille, tout s'empile sous 760 px.
*/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Inter+Tight:wght@600;700;800&display=swap');

:root {
  --bg: #0c0e12; --panel: #151820; --panel2: #1c2029; --line: #272c37; --ink: #eef1f6; --muted: #9098a8;
  --accent: #ff5a36; --accent-ink: #1a0a05; --ok: #3ddc84; --warn: #ffb020; --bad: #ff4d5e;
  --twitch: #9146ff; --youtube: #ff0033; --kick: #53fc18; --tiktok: #25f4ee;
  --r: 12px; color-scheme: dark;
}
* { box-sizing: border-box; min-width: 0; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, system-ui, sans-serif; }
h1, h2, h3 { font-family: 'Inter Tight', Inter, sans-serif; letter-spacing: -.01em; margin: 0; line-height: 1.1; }
h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
a { color: var(--accent); }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code, .mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; }

/* Contrôles */
button, .btn { font: 600 14px Inter, sans-serif; border: 1px solid var(--line); background: var(--panel2); color: var(--ink); border-radius: 10px;
  padding: 0 16px; min-height: 40px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
button:hover, .btn:hover { border-color: #3a4150; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.danger { color: var(--bad); }
.ghost { background: transparent; }
.sm { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: 16px Inter, sans-serif; color: var(--ink); background: #0f1218; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%; }
textarea { min-height: 80px; resize: vertical; }
input[type=color] { padding: 2px; height: 40px; width: 56px; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; }
.check { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; margin: 0; }

/* Mise en page de l'app */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: #0a0c10; border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font: 800 18px 'Inter Tight', sans-serif; }
.brand .dot { width: 30px; height: 30px; border-radius: 8px; background: url(/logo.png) center/cover; flex: none; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--ink); background: var(--panel); }
.nav a.on { color: var(--ink); background: var(--panel2); }
.nav a .badge { margin-left: auto; }
.side .foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); }
main { padding: 28px clamp(16px, 3vw, 40px) 60px; max-width: 1400px; width: 100%; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head p { margin: 6px 0 0; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; } .c3 { grid-column: span 3; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card > h2, .card > h3 { margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font: 800 34px 'Inter Tight', sans-serif; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--panel2); color: var(--muted); white-space: nowrap; }
.badge.on { background: rgba(61,220,132,.14); color: var(--ok); }
.badge.wait { background: rgba(255,176,32,.14); color: var(--warn); }
.badge.err { background: rgba(255,77,94,.14); color: var(--bad); }
.badge.hot { background: var(--accent); color: var(--accent-ink); }
.pf { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }

/* Fil d'activité & chat */
.feed { display: flex; flex-direction: column; max-height: 520px; overflow-y: auto; }
.feed-item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.feed-item .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; font-weight: 800; font-size: 13px; color: #0c0e12; }
.feed-item .txt { flex: 1; min-width: 0; }
.feed-item .txt b { font-weight: 600; }
.feed-item .txt small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.chatlog { height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 4px; }
.chatlog .ln { padding: 4px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.chatlog .ln:hover { background: var(--panel2); }
.chatlog .ln.del { opacity: .4; text-decoration: line-through; }
.chatlog .ln.bot { color: var(--accent); }
.chatlog .ln b { font-weight: 600; }

/* Éditeur d'overlay */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
.stage-wrap { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line);
  background: repeating-conic-gradient(#1a1d25 0 25%, #14171d 0 50%) 0 0 / 32px 32px; }
.stage-wrap .stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.stage .wg.ed { outline: 1px dashed rgba(255,255,255,.25); cursor: move; }
.stage .wg.ed.sel { outline: 2px solid var(--accent); }
.stage .wg .handle { position: absolute; right: -8px; bottom: -8px; width: 18px; height: 18px; background: var(--accent); border-radius: 4px; cursor: nwse-resize; z-index: 5; }
.stage .wg .tag { position: absolute; left: 0; top: -26px; background: var(--accent); color: var(--accent-ink); font: 600 16px Inter; padding: 2px 8px; border-radius: 6px 6px 0 0; white-space: nowrap; }
.inspector { display: flex; flex-direction: column; gap: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Modale */
dialog { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: min(520px, 92vw); }
dialog::backdrop { background: rgba(0,0,0,.6); }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--panel2); border: 1px solid var(--line); padding: 12px 16px; border-radius: 12px; z-index: 50; max-width: 360px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.toast.err { border-color: var(--bad); }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.copy { display: flex; gap: 8px; }
.copy input { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.platform-card { display: flex; align-items: center; gap: 14px; }
.platform-card .logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font: 800 16px 'Inter Tight'; color: #0c0e12; flex: none; }
.platform-card .info { flex: 1; min-width: 0; }

@media (max-width: 1100px) { .c3, .c4, .c5, .c7, .c8 { grid-column: span 12; } .c6 { grid-column: span 12; } .editor { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 10px; gap: 4px; }
  .brand { padding: 0 10px 0 4px; }
  .nav { display: flex; gap: 4px; } .nav a { white-space: nowrap; }
  .side .foot { display: none; }
  main { padding: 20px 14px 50px; }
}

/* Pages publiques et connexion */
.public { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(255,90,54,.18), transparent 60%), var(--bg); }
.public .box { width: min(480px, 100%); }
.public .box.wide { width: min(880px, 100%); }
.amounts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.amounts button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---- Tableau de bord façon StreamElements ---- */
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 clamp(14px, 3vw, 32px); background: rgba(12,14,18,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .grow { flex: 1; }
.channel { display: flex; align-items: center; gap: 10px; }
.channel b { display: block; font-size: 15px; }
.channel small { display: block; font-size: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent) url(/logo.png) center/cover; flex: none; }
.bell { position: relative; }
.bell svg, .nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.bell .badge { position: absolute; top: -2px; right: -4px; padding: 0 6px; }
#navToggle { display: none; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a span:first-of-type { flex: 1; }
.nav a > svg:last-child:not(:first-child) { width: 14px; height: 14px; opacity: .55; }
.nav-sec { font-size: 11px; font-weight: 600; color: #5d6576; padding: 16px 12px 6px; letter-spacing: .02em; }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px; border-radius: var(--r); border: 1px solid var(--line); background: linear-gradient(120deg, rgba(255,90,54,.16), rgba(255,42,104,.06) 55%, transparent), var(--panel); }
.checklist { display: grid; gap: 8px; }
.checklist a, .checklist div { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: var(--panel2); color: var(--ink); text-decoration: none; }
.checklist .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; flex: none; }
.checklist .done .tick { background: var(--ok); border-color: var(--ok); color: #0c0e12; }
.checklist .done span.l { text-decoration: line-through; color: var(--muted); }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .v { font: 800 30px 'Inter Tight', sans-serif; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 13px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-top: 10px; }
.bars div { flex: 1; min-width: 0; background: var(--accent); border-radius: 4px 4px 0 0; position: relative; }
.bars div:hover::after { content: attr(data-t); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; font-size: 12px; white-space: nowrap; margin-bottom: 4px; }
.bars-x { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 6px; }
.ov-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ov-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel2); text-decoration: none; color: var(--ink); }
.ov-card .thumb { aspect-ratio: 16/9; background: repeating-conic-gradient(#1a1d25 0 25%, #14171d 0 50%) 0 0 / 20px 20px; position: relative; overflow: hidden; }
.ov-card .thumb .stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.ov-card .meta { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; }
@media (max-width: 760px) {
  #navToggle { display: inline-flex; }
  .topbar .btn { display: none; }
  .side { display: none; }
  .side.open { display: flex; flex-direction: column; position: fixed; inset: 60px 0 0 0; z-index: 9; height: auto; overflow-y: auto; }
  .nav { flex-direction: column; }
}

/* Galerie de thèmes d'overlay */
.th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.th-card { background: var(--panel2); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; border: 1px solid transparent; transition: border-color .15s; }
.th-card:hover { border-color: var(--accent, #ff5a36); }
.th-card .th-prev { border-radius: 0; }
.th-info { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.th-info p { margin: 0; font-size: 13px; min-height: 34px; }
.th-prem { background: rgba(228,191,104,.16); color: #e4bf68; }
.th-card.locked .th-prev::after { content: '🔒'; position: absolute; right: 10px; top: 8px; font-size: 18px; }
.lib-prev { position: relative; aspect-ratio: 16/9; background: #11141a; overflow: hidden; }
.lib-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-tabs button.on { background: var(--accent, #ff5a36); color: #fff; border-color: transparent; }
.lib-card[hidden] { display: none; }
.pk-card { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 18px; background: var(--panel2); border-radius: 14px; overflow: hidden; }
.pk-prev { align-self: start; }
.pk-prev img { width: 100%; object-fit: cover; display: block; aspect-ratio: 16/9; }
.pk-info { padding: 14px 16px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.pk-info p { margin: 0; font-size: 14px; }
.pk-thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.pk-thumbs figure { margin: 0; }
.pk-thumbs img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; display: block; }
.pk-thumbs figcaption { font-size: 10.5px; color: var(--muted); margin-top: 3px; line-height: 1.2; }
.pk-links { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.pk-link { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 900px) { .pk-card { grid-template-columns: 1fr; } .pk-info { padding: 0 14px 14px; } .pk-thumbs { grid-template-columns: repeat(3, 1fr); } }
