* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #1a1a2e;
  color: #eee;
  height: 100vh;
  overflow: hidden;
}

/* === HOME / LOGIN SCREEN === */
#login-screen {
  height: 100vh;
  overflow-y: auto;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}

#home-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
#home-header {
  text-align: center;
  padding: 30px 20px 16px;
  border-bottom: 1px solid #0f3460;
}

#home-header h1 {
  font-size: 28px;
  color: #e94560;
  margin-bottom: 4px;
}

.home-subtitle {
  font-size: 14px;
  color: #888;
}

/* Content layout */
#home-content {
  flex: 1;
  display: flex;
  gap: 0;
}

/* Schedule (left) */
#home-schedule {
  flex: 1;
  padding: 24px 30px;
  overflow-y: auto;
  border-right: 1px solid #0f3460;
}

#home-schedule h2 {
  font-size: 18px;
  color: #eee;
  margin-bottom: 16px;
}

/* Next live banner */
#next-live-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(233,69,96,0.15), rgba(15,52,96,0.4));
  border: 1px solid #e94560;
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 20px;
}

.next-live-dot {
  width: 10px;
  height: 10px;
  background: #e94560;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
}

#next-live-text {
  font-size: 14px;
  font-weight: bold;
  color: #eee;
}

/* Schedule grid */
.schedule-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-day {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 10px;
  overflow: hidden;
}

.day-header {
  background: #0f3460;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: bold;
  color: #e94560;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.schedule-slot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-top: 1px solid #0f3460;
  transition: background 0.2s;
}

.schedule-slot:hover {
  background: rgba(233,69,96,0.05);
}

.schedule-slot.is-next {
  background: rgba(233,69,96,0.1);
  border-left: 3px solid #e94560;
}

.slot-time {
  font-size: 13px;
  font-weight: bold;
  color: #e94560;
  min-width: 48px;
  flex-shrink: 0;
}

.slot-info {
  flex: 1;
  min-width: 0;
}

.slot-title {
  font-size: 13px;
  font-weight: bold;
  color: #eee;
  margin-bottom: 2px;
}

.slot-speaker {
  font-size: 12px;
  color: #888;
}

.slot-morning .slot-time { color: #f39c12; }
.slot-afternoon .slot-time { color: #3498db; }

/* Login (right) */
#home-login {
  width: 400px;
  padding: 30px 30px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-shrink: 0;
}

#login-box {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  width: 100%;
  position: sticky;
  top: 30px;
}

#login-box h2 {
  margin-bottom: 6px;
  font-size: 20px;
  color: #e94560;
}

.login-desc {
  font-size: 13px;
  color: #888;
  margin-bottom: 20px;
}

#login-box input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #0f3460;
  border-radius: 8px;
  background: #1a1a2e;
  color: #eee;
  font-size: 15px;
  outline: none;
  margin-bottom: 12px;
}

#login-box input:focus {
  border-color: #e94560;
}

#login-box button {
  width: 100%;
  padding: 14px;
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

#login-box button:hover {
  background: #c73652;
}

#login-error {
  color: #e94560;
  font-size: 13px;
  min-height: 20px;
  margin-bottom: 8px;
}

/* Responsive: mobile */
@media (max-width: 768px) {
  #home-content {
    flex-direction: column;
  }
  #home-schedule {
    border-right: none;
    border-bottom: 1px solid #0f3460;
  }
  #home-login {
    width: 100%;
    padding: 20px;
  }
  #login-box {
    position: static;
  }
}

/* === LOBBY === */
#lobby {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}

#lobby-box {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  width: 480px;
}

#lobby-box h1 {
  margin-bottom: 12px;
  font-size: 24px;
  color: #e94560;
}

#lobby-role {
  margin-bottom: 8px;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
  display: inline-block;
}

#lobby-welcome {
  margin-bottom: 16px;
  font-size: 15px;
  color: #aaa;
}

.role-broadcaster {
  background: #e94560;
  color: #fff;
}

.role-admin {
  background: #8e44ad;
  color: #fff;
}

.role-modo {
  background: #f39c12;
  color: #000;
}

.role-viewer {
  background: #0f3460;
  color: #eee;
}

#lobby-cam-status {
  font-size: 13px;
  color: #aaa;
  margin-bottom: 8px;
  min-height: 18px;
}

/* Lobby cam preview */
#lobby-preview {
  margin-bottom: 16px;
}

#lobby-video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

#lobby-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#lobby-cam-off {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.9);
  color: #666;
  font-size: 15px;
  z-index: 2;
}

/* VU meter */
#lobby-vu {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

#lobby-vu span {
  font-size: 13px;
  color: #aaa;
  min-width: 40px;
}

#vu-bar {
  flex: 1;
  height: 8px;
  background: #0f3460;
  border-radius: 4px;
  overflow: hidden;
}

#vu-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #27ae60, #e94560);
  border-radius: 4px;
  transition: width 0.05s;
}

/* Toggle buttons */
#lobby-toggles {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 4px;
}

.toggle-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  color: #fff;
}

.toggle-btn.on {
  background: #27ae60;
}

.toggle-btn:not(.on) {
  background: #555;
}

/* Lobby buttons */
#lobby-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

#btn-go-live {
  padding: 14px;
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

#btn-go-live:hover {
  background: #c73652;
}

#btn-join-session,
#btn-join {
  padding: 14px;
  background: #0f3460;
  color: #eee;
  border: 1px solid #0f3460;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

#btn-join-session:hover,
#btn-join:hover {
  background: #1a1a4e;
}

#btn-dashboard {
  display: block;
  padding: 12px;
  background: transparent;
  color: #888;
  border: 1px dashed #0f3460;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s;
}

#btn-dashboard:hover {
  color: #e94560;
  border-color: #e94560;
}

/* === MAIN VIEW === */
#container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

#video-wrapper {
  flex: 1;
  position: relative;
  background: #000;
  padding-bottom: 68px; /* room for fixed toolbar */
  overflow: hidden;
}

/* Video grid */
#video-grid {
  width: 100%;
  height: 100%;
  display: grid;
  gap: 2px;
  background: #000;
}

#video-grid.grid-1 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

#video-grid.grid-2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

/* 3 cells: 2 on top row, 1 spanning full width on bottom */
#video-grid.grid-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

#video-grid.grid-3 .video-cell:last-child {
  grid-column: 1 / -1;
}

#video-grid.grid-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

/* 5-6 cells: 3 columns, 2 rows */
#video-grid.grid-6 {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

/* 7-8 cells: 4 columns, 2 rows */
#video-grid.grid-8 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.video-cell {
  position: relative;
  background: #111;
  overflow: hidden;
}

.video-cell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-cell .cell-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 13px;
  z-index: 2;
}

.video-cell .cell-live {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #e94560;
  color: #fff;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  z-index: 2;
  animation: pulse 1.5s infinite;
}

.video-cell .cell-self {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.6);
  color: #f39c12;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  z-index: 2;
}

/* Per-cell status badge (replaces global LIVE badge for non-self cells) */
.video-cell .cell-status {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  z-index: 2;
}

.video-cell .cell-status.status-live {
  background: #e94560;
  color: #fff;
  animation: pulse 1.5s infinite;
}

.video-cell .cell-status.status-session {
  background: rgba(243,156,18,0.9);
  color: #000;
}

.video-cell .cell-status.status-connecting {
  background: rgba(52,152,219,0.85);
  color: #fff;
}

.video-cell .cell-status.status-lost {
  background: rgba(100,100,100,0.85);
  color: #eee;
}

/* Placeholder for cells without video stream */
.video-cell .cell-no-video {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  color: #555;
  font-size: 40px;
}

#waiting-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  color: #aaa;
  font-size: 20px;
  z-index: 2;
}

/* Waiting overlay actions (admin/modo when no stream) */
.waiting-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 320px;
  width: 100%;
}

.waiting-msg {
  font-size: 18px;
  color: #aaa;
  margin-bottom: 8px;
  text-align: center;
}

.waiting-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s;
}

.waiting-btn-primary {
  background: #e94560;
  color: #fff;
}

.waiting-btn-primary:hover {
  background: #c73652;
}

.waiting-btn-secondary {
  background: #0f3460;
  color: #eee;
}

.waiting-btn-secondary:hover {
  background: #1a1a4e;
}

.waiting-btn-dashboard {
  background: #8e44ad;
  color: #fff;
}

.waiting-btn-dashboard:hover {
  background: #732d91;
}

.waiting-btn-back {
  background: transparent;
  color: #888;
  border: 1px dashed #555;
  font-weight: normal;
  font-size: 13px;
  padding: 10px;
}

.waiting-btn-back:hover {
  color: #eee;
  border-color: #888;
}

/* btn-watch style */
#btn-watch {
  padding: 14px;
  background: #27ae60;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

#btn-watch:hover {
  background: #219a52;
}

#lobby-bc-info {
  font-size: 12px;
  color: #888;
  text-align: center;
}

/* Disabled/grayed button */
.btn-disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* Preview badge in lobby */
#lobby-preview-badge {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: #f39c12;
  padding: 4px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
  z-index: 3;
  border: 1px dashed #f39c12;
}

/* Not-live overlay for broadcaster in session (not streaming) */
#not-live-overlay {
  position: absolute;
  inset: 0 0 68px 0; /* stop at toolbar top — don't cover action buttons */
  display: flex;
  align-items: flex-start; /* badge at top — avoids overlapping cell names at bottom */
  justify-content: center;
  padding-top: 48px;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 20px,
    rgba(100,100,100,0.08) 20px,
    rgba(100,100,100,0.08) 22px
  );
}

#not-live-overlay span {
  background: rgba(0,0,0,0.75);
  color: #f39c12;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  border: 1px dashed #f39c12;
}

/* Sidebar */
#sidebar {
  width: 320px;
  background: #16213e;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #0f3460;
}

#tabs {
  display: flex;
  border-bottom: 1px solid #0f3460;
}

#tabs button {
  flex: 1;
  padding: 12px;
  background: transparent;
  color: #eee;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

#tabs button:hover {
  background: #0f3460;
}

.tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#chat {
  padding: 10px;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

#chat-messages div {
  padding: 6px 10px;
  margin-bottom: 4px;
  background: #0f3460;
  border-radius: 6px;
  font-size: 13px;
  word-break: break-word;
}

/* Chat: broadcaster messages */
#chat-messages div.chat-broadcaster {
  background: linear-gradient(135deg, #e94560, #0f3460);
  font-weight: bold;
}

#chat-messages div.chat-broadcaster .chat-badge {
  background: #e94560;
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  margin-right: 6px;
  font-weight: bold;
}

/* Chat: modo messages */
#chat-messages div.chat-modo {
  background: linear-gradient(135deg, rgba(243,156,18,0.4), #0f3460);
  font-weight: bold;
}

#chat-messages div.chat-modo .chat-badge {
  background: #f39c12;
  color: #000;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  margin-right: 6px;
  font-weight: bold;
}

/* Chat: admin messages */
#chat-messages div.chat-admin {
  background: linear-gradient(135deg, rgba(142,68,173,0.4), #0f3460);
  font-weight: bold;
}

#chat-messages div.chat-admin .chat-badge {
  background: #8e44ad;
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  margin-right: 6px;
  font-weight: bold;
}

/* Chat: guest messages */
#chat-messages div.chat-guest {
  background: linear-gradient(135deg, rgba(26,188,156,0.4), #0f3460);
  font-weight: bold;
}

#chat-messages div.chat-guest .chat-badge {
  background: #1abc9c;
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  margin-right: 6px;
  font-weight: bold;
}

#chat-form {
  display: flex;
  gap: 6px;
}

#chat input {
  flex: 1;
  padding: 10px;
  border: 1px solid #0f3460;
  border-radius: 6px;
  background: #1a1a2e;
  color: #eee;
  font-size: 14px;
  outline: none;
}

#chat button {
  padding: 10px 14px;
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

#chat button:hover {
  background: #c73652;
}

/* Participants list */
#viewers {
  padding: 10px;
  overflow-y: auto;
}

#viewer-list {
  list-style: none;
}

#viewer-list li {
  padding: 8px 12px;
  margin-bottom: 4px;
  background: #0f3460;
  border-radius: 6px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#viewer-list li.host {
  background: linear-gradient(135deg, #e94560, #0f3460);
  font-weight: bold;
  font-size: 14px;
}

#viewer-list li.modo {
  background: linear-gradient(135deg, #f39c12, #0f3460);
  font-weight: bold;
}

#viewer-list li.admin {
  background: linear-gradient(135deg, #8e44ad, #0f3460);
  font-weight: bold;
}

.live-badge {
  background: #e94560;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  margin-left: 8px;
  animation: pulse 1.5s infinite;
}

.session-badge {
  background: #f39c12;
  color: #000;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  margin-left: 8px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* === FORCE DISCONNECT OVERLAY === */
#force-disconnect-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#force-disconnect-box {
  background: #16213e;
  border: 1px solid #e94560;
  border-radius: 16px;
  padding: 44px 40px;
  text-align: center;
  max-width: 420px;
  width: 90%;
}

#force-disconnect-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

#force-disconnect-box h2 {
  font-size: 22px;
  color: #e94560;
  margin-bottom: 12px;
}

#force-disconnect-msg {
  font-size: 14px;
  color: #aaa;
  line-height: 1.6;
  margin-bottom: 28px;
}

#force-disconnect-box button {
  padding: 12px 36px;
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

#force-disconnect-box button:hover {
  background: #c73652;
}

/* Toolbar */
#toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 320px;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  background: rgba(22, 33, 62, 0.95);
  border-top: 1px solid #0f3460;
}

#toolbar button {
  padding: 10px 24px;
  background: #0f3460;
  color: #eee;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

#toolbar button:hover {
  background: #e94560;
}

#toolbar button:disabled {
  cursor: not-allowed;
}

#toolbar button.is-live {
  background: #e94560;
  animation: pulse 1.5s infinite;
}

/* Device toggle buttons: green = active, red = inactive */
#toolbar button.btn-device-on {
  background: #27ae60;
  color: #fff;
}
#toolbar button.btn-device-on:hover {
  background: #1e8449;
}
#toolbar button.btn-device-off {
  background: #c0392b;
  color: #fff;
}
#toolbar button.btn-device-off:hover {
  background: #e74c3c;
}

#toolbar button:disabled:hover {
  background: #e94560;
}

/* Stream options dropdown */
#stream-options {
  position: relative;
}

#stream-options-btn {
  background: #c0392b !important;
  color: #fff !important;
}

#stream-options-btn:hover {
  background: #e74c3c !important;
}

#stream-options-menu {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 8px;
  padding: 6px 0;
  margin-bottom: 8px;
  min-width: 220px;
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
}

#stream-options-menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  color: #eee;
  border: none;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

#stream-options-menu button:hover {
  background: #0f3460;
}

#stream-options-menu #btn-end-session {
  color: #e94560;
}

#stream-options-menu #btn-end-session:hover {
  background: rgba(233,69,96,0.15);
}

#stream-options-menu hr {
  border: none;
  border-top: 1px solid #0f3460;
  margin: 4px 0;
}

#stream-options-menu button.menu-item-disabled {
  color: #555;
  cursor: not-allowed;
  font-style: italic;
}

#stream-options-menu button.menu-item-disabled:hover {
  background: transparent;
}

/* Screen share button */
#screen-share-btn {
  background: #2980b9 !important;
  color: #fff !important;
}

#screen-share-btn:hover {
  background: #3498db !important;
}

#screen-share-btn.sharing {
  background: #e67e22 !important;
}

#screen-share-btn.sharing:hover {
  background: #d35400 !important;
}

#screen-share-menu {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 8px;
  padding: 6px 0;
  margin-bottom: 8px;
  min-width: 240px;
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
}

#screen-share-menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: transparent !important;
  color: #eee;
  border: none;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

#screen-share-menu button:hover {
  background: #0f3460 !important;
}

#leave-session-btn {
  background: transparent !important;
  color: #888 !important;
  border: 1px solid #333 !important;
  font-size: 12px !important;
  padding: 8px 16px !important;
}

#leave-session-btn:hover {
  background: #333 !important;
  color: #eee !important;
}

/* Admin dashboard link in toolbar */
.toolbar-admin-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: transparent;
  color: #888;
  border: 1px dashed #0f3460;
  border-radius: 8px;
  font-size: 12px;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.toolbar-admin-link:hover {
  color: #e94560;
  border-color: #e94560;
}

/* === PROFILE CARD (home page, logged-in state) === */
#profile-box {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 16px;
  padding: 28px 32px;
  text-align: center;
  width: 100%;
  position: sticky;
  top: 30px;
}

#profile-role-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 12px;
  background: #e94560;
  color: #fff;
}

#profile-box h2 {
  font-size: 20px;
  color: #eee;
  margin-bottom: 18px;
}

.profile-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(15,52,96,0.5);
  text-align: left;
  font-size: 13px;
}

.profile-field:last-of-type {
  border-bottom: none;
}

.profile-label {
  color: #888;
  min-width: 80px;
  flex-shrink: 0;
}

.profile-value {
  color: #eee;
  flex: 1;
  word-break: break-all;
}

.profile-email-verified {
  background: rgba(39,174,96,0.2);
  color: #27ae60;
  border: 1px solid #27ae60;
  border-radius: 4px;
  font-size: 10px;
  padding: 1px 6px;
  white-space: nowrap;
}

.profile-email-unverified {
  background: rgba(233,69,96,0.15);
  color: #e94560;
  border: 1px solid #e94560;
  border-radius: 4px;
  font-size: 10px;
  padding: 1px 6px;
  white-space: nowrap;
}

.btn-profile-enter {
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-profile-enter:hover {
  background: #c73652;
}

/* === SIDEBAR PLANNING TAB === */
#sidebar-schedule {
  padding: 10px;
  overflow-y: auto;
  flex: 1;
}

.sidebar-schedule-day {
  margin-bottom: 10px;
}

.sidebar-day-header {
  font-size: 11px;
  font-weight: bold;
  color: #e94560;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 8px;
  background: #0f3460;
  border-radius: 4px;
  margin-bottom: 4px;
}

.sidebar-slot {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 11px;
  border-left: 2px solid transparent;
  transition: background 0.15s;
}

.sidebar-slot:hover {
  background: rgba(15,52,96,0.4);
}

.sidebar-slot.is-next {
  border-left-color: #e94560;
  background: rgba(233,69,96,0.08);
}

.sidebar-slot.is-current {
  border-left: 3px solid #27ae60;
  background: rgba(39,174,96,0.1);
}

.sidebar-slot-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-top: 3px;
}

.sidebar-slot-badge.en-cours {
  background: rgba(39,174,96,0.2);
  color: #27ae60;
  border: 1px solid #27ae60;
}

.sidebar-slot-badge.a-venir {
  background: rgba(233,69,96,0.15);
  color: #e94560;
  border: 1px solid #e94560;
}

.sidebar-slot-time {
  color: #f39c12;
  font-weight: bold;
  min-width: 36px;
  flex-shrink: 0;
}

.sidebar-slot-info .sidebar-slot-title {
  color: #eee;
  margin-bottom: 1px;
}

.sidebar-slot-info .sidebar-slot-speaker {
  color: #888;
  font-size: 10px;
}

/* Session state banner (top of participant list) */
#session-state-banner {
  padding: 6px 10px;
  border-bottom: 1px solid #0f3460;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  letter-spacing: 1px;
}

#session-state-banner.state-live {
  background: rgba(233,69,96,0.15);
  color: #e94560;
}

#session-state-banner.state-session {
  background: rgba(243,156,18,0.1);
  color: #f39c12;
}

/* Lobby back button */
.btn-lobby-back {
  background: transparent !important;
  color: #888 !important;
  border: 1px dashed #333 !important;
  border-radius: 8px !important;
  padding: 10px !important;
  font-size: 13px !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  width: 100%;
}

.btn-lobby-back:hover {
  color: #eee !important;
  border-color: #888 !important;
}

/* Profile card — dashboard + logout buttons */
.btn-profile-dashboard {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  background: #8e44ad;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-profile-dashboard:hover {
  background: #732d91;
}

.btn-profile-logout {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: transparent;
  color: #888;
  border: 1px solid #333;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-profile-logout:hover {
  color: #e94560;
  border-color: #e94560;
}

/* === TECHNIQUE TAB === */
#technique {
  padding: 10px;
  overflow-y: auto;
}

#tech-stats {
  font-size: 12px;
  color: #ccc;
}

.tech-section {
  margin-bottom: 12px;
}

.tech-section h4 {
  font-size: 12px;
  color: #e94560;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #0f3460;
}

.tech-pc {
  background: #0f3460;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

.tech-pc .tech-label {
  font-weight: bold;
  color: #eee;
  margin-bottom: 4px;
}

.tech-pc .tech-row {
  display: flex;
  justify-content: space-between;
  padding: 1px 0;
}

.tech-pc .tech-key {
  color: #888;
}

.tech-pc .tech-val {
  color: #eee;
}

.tech-val.state-connected { color: #27ae60; }
.tech-val.state-checking, .tech-val.state-new { color: #f39c12; }
.tech-val.state-failed, .tech-val.state-disconnected { color: #e94560; }

/* === GUEST ROLE STYLES === */
#viewer-list li.guest {
  background: linear-gradient(135deg, #1abc9c, #0f3460);
  font-weight: bold;
}

.role-guest {
  background: #1abc9c;
  color: #fff;
}

/* === SPEAKER ROLE STYLES === */
.role-speaker {
  background: #3498db;
  color: #fff;
}

#viewer-list li.speaker {
  background: linear-gradient(135deg, #3498db, #0f3460);
  font-weight: bold;
}

#chat-messages div.chat-speaker {
  background: linear-gradient(135deg, rgba(52,152,219,0.4), #0f3460);
  font-weight: bold;
}

#chat-messages div.chat-speaker .chat-badge {
  background: #3498db;
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  margin-right: 6px;
  font-weight: bold;
}

/* === MINI-LOBBY (profile cam preview) === */
#profile-cam-preview { margin: 14px 0; }
#profile-video-wrapper {
  position: relative; width: 100%; aspect-ratio: 16/9;
  background: #000; border-radius: 8px; overflow: hidden; margin-bottom: 8px;
}
#profile-video { width: 100%; height: 100%; object-fit: cover; }
#profile-cam-off {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; background: rgba(0,0,0,0.9); color: #666; font-size: 13px; z-index: 2;
}
#profile-cam-status { font-size: 12px; color: #aaa; min-height: 16px; margin-bottom: 4px; }
#profile-toggles { display: flex; gap: 8px; justify-content: center; margin-bottom: 4px; }
#profile-toggles .toggle-btn { padding: 6px 14px; font-size: 12px; }
#profile-vu-mini { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
#profile-vu-mini span { font-size: 11px; color: #aaa; min-width: 36px; }
#profile-vu-bar { flex: 1; height: 6px; background: #0f3460; border-radius: 3px; overflow: hidden; }
#profile-vu-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, #27ae60, #e94560);
  border-radius: 3px; transition: width 0.05s;
}

/* Boutons action profile */
.btn-profile-backstage {
  display: block; width: 100%; margin-top: 8px; padding: 14px;
  background: #0f3460; color: #eee; border: 1px solid #0f3460;
  border-radius: 8px; font-size: 16px; cursor: pointer; transition: background 0.2s;
}
.btn-profile-backstage:hover { background: #1a1a4e; }

.btn-profile-watch {
  display: block; width: 100%; margin-top: 8px; padding: 14px;
  background: #27ae60; color: #fff; border: none;
  border-radius: 8px; font-size: 16px; cursor: pointer; transition: background 0.2s;
}
.btn-profile-watch:hover { background: #219a52; }

.btn-profile-join {
  display: block; width: 100%; margin-top: 8px; padding: 14px;
  background: #0f3460; color: #eee; border: 1px solid #0f3460;
  border-radius: 8px; font-size: 16px; cursor: pointer; transition: background 0.2s;
}

.btn-profile-settings {
  display: block; width: 100%; margin-top: 8px; padding: 8px;
  background: transparent; color: #666; border: none; font-size: 12px;
  text-decoration: underline; text-align: center; cursor: pointer;
}
.btn-profile-settings:hover { color: #aaa; }

/* === LOBBY PREFERENCES CHECKBOXES === */
#lobby-prefs { margin: 12px 0; padding: 10px 14px; background: rgba(255,255,255,0.05); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; }
.pref-checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: #ccc; user-select: none; }
.pref-checkbox input[type="checkbox"] { width: 16px; height: 16px; accent-color: #27ae60; cursor: pointer; flex-shrink: 0; }
.pref-checkbox span { line-height: 1.3; }

/* === PIP POSITION SELECTOR === */
#pip-pos-btn {
  background: #8e44ad !important;
  color: #fff !important;
}
#pip-pos-btn:hover { background: #9b59b6 !important; }

#pip-pos-panel {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
}

.pip-pos-title {
  font-size: 11px;
  color: #888;
  text-align: center;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pip-pos-grid {
  display: grid;
  grid-template-columns: repeat(3, 28px);
  grid-template-rows: repeat(3, 28px);
  gap: 4px;
}

.pip-pos-cell {
  background: #0f3460;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.pip-pos-cell:hover { background: #3498db; }
.pip-pos-cell.active { background: #e94560; }

.pip-pos-off {
  margin-top: 8px;
  text-align: center;
  font-size: 11px;
  color: #888;
  cursor: pointer;
  transition: color 0.15s;
}
.pip-pos-off:hover { color: #e94560; }
.pip-pos-off.active { color: #e94560; font-weight: bold; }
