html, body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #f5f6f8;
  color: #1f2937;
  font-family: Arial, Helvetica, sans-serif;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: #172033;
  color: #fff;
  padding: 24px 18px;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 28px;
}

.menu {
  display: grid;
  gap: 8px;
}

.menu button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #dbe4f0;
  padding: 10px 12px;
  text-align: left;
  text-decoration: none;
}

.menu .active,
.menu button:hover,
.menu button:hover {
  background: #25324a;
  color: #fff;
}

.main-panel {
  flex: 1;
  padding: 28px;
}

.auth-mode .app-shell {
  display: block;
}

.auth-mode .sidebar {
  display: none;
}

.auth-mode .main-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

h1 {
  font-size: 28px;
  margin: 0;
}

h2 {
  font-size: 18px;
  margin: 0 0 14px;
}

h3 {
  font-size: 17px;
  margin: 0 0 8px;
}

.muted {
  color: #6b7280;
  margin: 4px 0 0;
}

.auth-wrap {
  width: 100%;
  max-width: 860px;
}

.auth-box,
.tool-panel,
.item,
.empty {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 18px;
}

.auth-box h2 {
  margin-top: 8px;
}

.auth-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  background: #eef2f7;
  border-radius: 8px;
}

.auth-tab {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4b5563;
  padding: 8px 14px;
}

.auth-tab.active {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.tool-panel {
  margin-bottom: 18px;
}

.tool-panel.compact {
  display: grid;
  gap: 10px;
}

.screen {
  max-width: 1120px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.detail-header {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
}

.feature-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #dbe1ea;
  margin-bottom: 16px;
}

.feature-tab {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #4b5563;
  padding: 10px 14px;
  font-weight: 600;
}

.feature-tab.active {
  border-color: #2563eb;
  color: #1d4ed8;
}

.list {
  display: grid;
  gap: 12px;
}

.item p {
  margin: 0 0 10px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.recording-item {
  display: grid;
  gap: 14px;
}

.recording-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.recording-video {
  display: block;
  width: 100%;
  max-height: 520px;
  border-radius: 8px;
  background: #111827;
}

.waiting-panel {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.waiting-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.waiting-student {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.waiting-student span {
  flex: 1;
  min-width: 120px;
}

.toast-msg {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #111827;
  color: #fff;
  border-radius: 6px;
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}

.jitsi-overlay {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #f8fafc;
}

.jitsi-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid #dbe1ea;
  background: #fff;
}

.jitsi-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.jitsi-container {
  min-height: 0;
}

.jitsi-container iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.waiting-room-overlay {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f8fafc;
}

.waiting-room-card {
  width: min(460px, 100%);
  padding: 32px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  text-align: center;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .14);
}

.waiting-room-avatar {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 24px;
  font-weight: 700;
}

.waiting-room-card h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.waiting-room-card .btn {
  margin-top: 20px;
}

.student-waiting-list-wrap {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  text-align: left;
}

.student-waiting-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #111827;
  font-size: 14px;
}

.student-waiting-list-head span {
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.student-waiting-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.student-waiting-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px;
  border-radius: 8px;
  background: #f9fafb;
}

.student-waiting-initial {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.student-waiting-name {
  min-width: 0;
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-backdrop-lite {
  position: fixed;
  inset: 0;
  z-index: 1070;
  display: grid;
  place-items: start end;
  padding: 86px 20px 20px;
  background: rgba(15, 23, 42, .28);
}

.waiting-popup {
  width: min(420px, calc(100vw - 40px));
  max-height: calc(100vh - 112px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}

.waiting-popup-head,
.waiting-popup-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.waiting-popup-head {
  justify-content: space-between;
}

.waiting-popup-head h2 {
  margin: 0;
}

.waiting-popup-list {
  min-height: 90px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
}

.waiting-popup-row {
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.waiting-popup-row span {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}

.compact-empty {
  padding: 14px;
}

@media (max-width: 800px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    width: 100%;
  }

  .main-panel {
    padding: 18px;
  }

  .jitsi-bar,
  .jitsi-actions,
  .recording-head,
  .waiting-popup-row {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-backdrop-lite {
    place-items: end stretch;
    padding: 20px;
  }

}
