/* MeetClic : styles communs (administration, entrée en salle, salle, synthèse). Thème sombre par défaut, jour avec data-theme="light". */
:root {
  --bg: #020617; --card: #0b1226; --card2: #101a36; --fg: #e8eefc; --muted: #8fa0c4; --line: rgba(148, 163, 184, .2);
  --accent: #00d4ff; --accent2: #a855f7; --on-accent: #00131a; --danger: #fb7185; --ok: #34d399; --warn: #fbbf24; --radius: 14px;
  --stage: #05080f; --tile: #111a30;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
:root[data-theme="light"] {
  --bg: #f4f7fb; --card: #ffffff; --card2: #f1f5f9; --fg: #0f172a; --muted: #5b6b86; --line: rgba(15, 23, 42, .14);
  --accent: #0099c6; --accent2: #7c3aed; --on-accent: #ffffff; --danger: #e11d48; --ok: #059669; --warn: #b45309; --stage: #e6ebf3; --tile: #d5dce8;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; }
[hidden] { display: none !important; }
.mc-logo { display: inline-flex; align-items: center; gap: 12px; line-height: 1; text-decoration: none; color: var(--fg); }
.mc-logo img { display: block; border-radius: 22%; box-shadow: 0 0 0 1px var(--line), 0 6px 18px rgba(0, 153, 198, .28); }
.mc-logo b { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mc-logo span { font-weight: 800; letter-spacing: -.02em; }
.btn { display: inline-flex; align-items: center; gap: 8px; justify-content: center; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); cursor: pointer; font-weight: 700; text-decoration: none; color: var(--fg); }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent2))); color: var(--on-accent); border: 0; }
.btn.danger { background: var(--danger); color: #fff; border: 0; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
input[type=text], input[type=password], input[type=datetime-local], select, textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); color: var(--fg); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
label.l { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 5px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--card2); border: 1px solid var(--line); }
.pill.ok { color: var(--ok); } .pill.no { color: var(--danger); } .pill.warn { color: var(--warn); }
.help { color: var(--muted); font-size: 13px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.theme { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--card2); }
.theme button { border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 12px; padding: 5px 9px; border-radius: 8px; cursor: pointer; }
:root[data-theme-pref="auto"] .theme [data-t="auto"], :root[data-theme-pref="light"] .theme [data-t="light"], :root[data-theme-pref="dark"] .theme [data-t="dark"] { background: var(--accent); color: var(--on-accent); }
.toast-zone { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); pointer-events: auto; max-width: 92vw; display: flex; gap: 10px; align-items: center; }

/* ---------- administration ---------- */
.adm-wrap { max-width: 1040px; margin: 0 auto; padding: 22px 18px 70px; }
.adm-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--card); color: var(--fg); padding: 8px 16px; border-radius: 12px; cursor: pointer; font-weight: 700; }
.tabs button.on { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); border-color: var(--accent); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.login-box { max-width: 380px; margin: 14vh auto; }
.rec-detail { display: grid; gap: 16px; }
.rec-detail video { width: 100%; border-radius: 12px; background: #000; max-height: 60vh; }
.md h2 { font-size: 17px; margin: 18px 0 6px; } .md ul { padding-left: 20px; margin: 4px 0 10px; } .md p { margin: 6px 0; }
.transcript { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card2); font-size: 14px; }
.transcript .who { font-weight: 800; color: var(--accent); }
.transcript .ts { color: var(--muted); font-size: 12px; margin-right: 6px; cursor: pointer; }

/* ---------- entrée en salle ---------- */
.pre { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1.3fr) minmax(300px, 1fr); gap: 28px; align-items: center; max-width: 1080px; margin: 0 auto; padding: 24px 18px; }
.pre-video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.pre-video video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.pre-video .off { position: absolute; inset: 0; display: grid; place-items: center; color: #cbd5e1; font-size: 15px; background: #0b1226; text-align: center; padding: 14px; }
.pre-ctl { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; gap: 10px; justify-content: center; }
.meter { height: 6px; border-radius: 999px; background: var(--card2); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), var(--accent)); transition: width .08s linear; }
.cbtn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(15, 23, 42, .78); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 18px; position: relative; }
.cbtn:hover { background: rgba(51, 65, 85, .95); }
.cbtn.off { background: var(--danger); }
.cbtn.on { background: var(--accent); color: var(--on-accent); }
.cbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cbtn .badge { position: absolute; top: -3px; right: -3px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
@media (max-width: 860px) { .pre { grid-template-columns: 1fr; align-content: start; gap: 16px; } }

/* ---------- salle ---------- */
#meeting { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--stage); }
.mbar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; color: var(--fg); }
.mbar .title { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }
.mbar .sp { flex: 1; }
.rec-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--danger); color: #fff; padding: 4px 11px; border-radius: 999px; font-weight: 800; font-size: 13px; }
.rec-chip i { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.mmain { position: relative; display: flex; min-height: 0; flex: 1; }
.stage { flex: 1; min-width: 0; padding: 6px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.grid { flex: 1; display: grid; gap: 8px; min-height: 0; align-content: center; justify-content: center; }
.main-view { flex: 1; min-height: 0; display: flex; }
.main-view .tile { flex: 1; }
.strip { display: flex; gap: 8px; overflow-x: auto; height: 118px; flex: none; }
.strip .tile { width: 190px; flex: none; }
.tile { position: relative; background: var(--tile); border-radius: 14px; overflow: hidden; min-height: 0; min-width: 0; border: 2px solid transparent; cursor: pointer; }
.tile.speaking { border-color: var(--ok); }
.tile video { width: 100%; height: 100%; object-fit: cover; background: #000; display: block; }
.tile.screen video { object-fit: contain; }
.tile.self video.cam { transform: scaleX(-1); }
.tile .av { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(135deg, #172554, #3b0764); }
.tile .av b { width: 22%; min-width: 54px; max-width: 120px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-size: clamp(20px, 4vw, 44px); }
.tile .nm { position: absolute; left: 8px; bottom: 8px; background: rgba(2, 6, 23, .72); color: #fff; padding: 3px 9px; border-radius: 8px; font-size: 13px; font-weight: 600; max-width: calc(100% - 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; align-items: center; }
.tile .ic { position: absolute; top: 8px; right: 8px; display: flex; gap: 5px; }
.tile .ic span { background: rgba(2, 6, 23, .72); color: #fff; border-radius: 8px; padding: 2px 6px; font-size: 13px; }
.tile .hand { position: absolute; top: 8px; left: 8px; font-size: 22px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.side { width: 340px; max-width: 92vw; background: var(--card); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 800; }
.side .body { flex: 1; overflow-y: auto; padding: 10px 12px; min-height: 0; }
.msg { margin: 8px 0; } .msg .who { font-weight: 800; font-size: 13px; } .msg .t { color: var(--muted); font-size: 11px; margin-left: 6px; } .msg p { margin: 2px 0 0; white-space: pre-wrap; word-break: break-word; }
.chat-in { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.plist .p { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.plist .p .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.plist .p button { border: 1px solid var(--line); background: var(--card2); border-radius: 8px; cursor: pointer; padding: 3px 8px; font-size: 12px; font-weight: 700; }
.mctl { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 14px 16px; flex-wrap: wrap; }
.mctl .cbtn { background: var(--card); color: var(--fg); border: 1px solid var(--line); width: 50px; height: 50px; }
.mctl .cbtn.off { background: var(--danger); color: #fff; border: 0; }
.mctl .cbtn.on { background: var(--accent); color: var(--on-accent); border: 0; }
.mctl .cbtn.leave { background: var(--danger); color: #fff; border: 0; width: 64px; border-radius: 26px; }
.menu { position: absolute; bottom: 76px; right: 50%; transform: translateX(50%); background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px; min-width: 250px; box-shadow: 0 14px 40px rgba(0, 0, 0, .45); z-index: 20; }
.menu button { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.menu button:hover { background: var(--card2); }
.emoji-row { display: flex; gap: 6px; padding: 6px; } .emoji-row button { font-size: 24px; width: auto; padding: 4px 8px; }
.float-emoji { position: fixed; bottom: 90px; font-size: 44px; pointer-events: none; z-index: 50; animation: floatup 3s ease-out forwards; }
@keyframes floatup { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-260px); opacity: 0; } }
.banner { background: var(--danger); color: #fff; text-align: center; padding: 6px 12px; font-weight: 700; font-size: 14px; }
.banner.warn { background: var(--warn); color: #1c1100; }
.modal-back { position: fixed; inset: 0; background: rgba(2, 6, 23, .6); display: grid; place-items: center; z-index: 70; padding: 16px; }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; width: min(520px, 100%); max-height: 90vh; overflow: auto; }
.center-screen { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 20px; }
@media (max-width: 760px) { .side { position: absolute; right: 0; top: 0; bottom: 0; z-index: 25; } .mctl .cbtn { width: 44px; height: 44px; } .strip .tile { width: 130px; } }
