html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
  padding-bottom: 50px;
  background-color: #f8f9fa;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > .container {
  flex: 1 0 auto;
}

body > footer {
  flex-shrink: 0;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Stat Cards */
.stat-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  background: #fff;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 1rem 1rem 0 0;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04) !important;
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card-primary::before { background: linear-gradient(90deg, #0d6efd, #6ea8fe); }
.stat-card-info::before    { background: linear-gradient(90deg, #0dcaf0, #6edff6); }
.stat-card-success::before { background: linear-gradient(90deg, #198754, #479f76); }
.stat-card-purple::before  { background: linear-gradient(90deg, #6f42c1, #a78bfa); }
.stat-card-warning::before { background: linear-gradient(90deg, #ffc107, #ffda6a); }

.stat-card-clickable {
  cursor: pointer;
}

.stat-card-clickable:hover {
  border: 1px solid rgba(13, 110, 253, 0.2) !important;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.stat-icon::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 1rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.stat-card:hover .stat-icon::after {
  opacity: 1;
}

.stat-icon.bg-primary-subtle { background: rgba(13, 110, 253, 0.1); color: #0d6efd; }
.stat-icon.bg-primary-subtle::after { background: rgba(13, 110, 253, 0.06); }
.stat-icon.bg-info-subtle    { background: rgba(13, 202, 240, 0.12); color: #0dcaf0; }
.stat-icon.bg-info-subtle::after { background: rgba(13, 202, 240, 0.06); }
.stat-icon.bg-success-subtle { background: rgba(25, 135, 84, 0.1); color: #198754; }
.stat-icon.bg-success-subtle::after { background: rgba(25, 135, 84, 0.06); }
.stat-icon.bg-warning-subtle { background: rgba(255, 193, 7, 0.15); color: #cc9a06; }
.stat-icon.bg-warning-subtle::after { background: rgba(255, 193, 7, 0.08); }
.stat-icon.bg-purple-subtle  { background: rgba(111, 66, 193, 0.1); color: #6f42c1; }
.stat-icon.bg-purple-subtle::after { background: rgba(111, 66, 193, 0.06); }

.stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #1a1a2e;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #6c757d;
  margin-top: 2px;
}

.stat-sublabel {
  font-size: 0.7rem;
  font-weight: 500;
  color: #adb5bd;
  margin-top: 2px;
  line-height: 1.3;
}

/* Welcome Header */
.welcome-section {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 70%, #1a3353 100%);
  border-radius: 1.25rem;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(15, 52, 96, 0.25);
}

.welcome-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
  border-radius: 50%;
}

.avatar-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.avatar-photo {
  object-fit: cover;
  background: none;
  backdrop-filter: none;
}

.welcome-separator {
  opacity: 0.5;
  font-size: 0.85rem;
}

/* Room Cards */
.room-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 0.75rem;
  overflow: hidden;
  border-left: 4px solid transparent;
}

.room-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1) !important;
}

.room-card.has-active-session {
  border-left-color: #198754;
}

.room-card .room-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.room-status-dot.active {
  background-color: #198754;
  box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.2);
  animation: pulse-dot 2s infinite;
}

.room-status-dot.inactive {
  background-color: #adb5bd;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.2); }
  50%      { box-shadow: 0 0 0 6px rgba(25, 135, 84, 0.08); }
}

/* Active Session Cards */
.session-card {
  border-radius: 0.75rem;
  border: 1px solid rgba(25, 135, 84, 0.15);
  background: linear-gradient(135deg, rgba(25, 135, 84, 0.03) 0%, rgba(25, 135, 84, 0.06) 100%);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.session-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(25, 135, 84, 0.1);
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #198754;
}

.live-indicator::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #198754;
  animation: pulse-dot 2s infinite;
}

/* Enhanced Checkbox Styles - Global */
.form-check-input {
  width: 1.15em;
  height: 1.15em;
  border: 2px solid #6c757d !important;
  background-color: #fff;
  cursor: pointer;
}

.form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd !important;
}

.form-check-input:hover {
  border-color: #495057 !important;
}

.form-check-input:disabled {
  background-color: #e9ecef;
  border-color: #adb5bd !important;
  cursor: not-allowed;
}

/* Directory Table */
.directory-table th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6c757d;
  white-space: nowrap;
}

.directory-table td {
  font-size: 0.875rem;
  vertical-align: middle;
}

/* Ensure dropdown menus are visible in tables with few rows */
.table-responsive {
  overflow: visible;
}

@media (max-width: 991.98px) {
  .table-responsive {
    overflow-x: auto;
  }
}

.dir-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #495057;
  flex-shrink: 0;
}

/* Section Headers */
.section-header {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #495057;
}

/* Quick Actions */
.quick-action-btn {
  border-radius: 0.75rem;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.quick-action-btn:hover {
  transform: translateY(-1px);
}

/* Auth Container */
.auth-container {
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.auth-container .row {
  width: 100%;
}

.auth-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Card enhancements */
.card {
  border-radius: 0.75rem;
}

/* Empty state */
.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #f0f2f5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

/* Table improvements */
.table th {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
}

/* Navbar customizations */
.navbar-dark .nav-link {
  transition: opacity 0.15s ease;
}

.navbar-dark .nav-link:hover {
  opacity: 1 !important;
}

/* Badge improvements */
.badge {
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Session Status Panel */
.session-status-panel {
  border: 1px solid;
  position: relative;
  overflow: hidden;
}

.session-status-whitelist {
  background: linear-gradient(135deg, rgba(25, 135, 84, 0.04) 0%, rgba(25, 135, 84, 0.08) 100%);
  border-color: rgba(25, 135, 84, 0.2);
}

.session-status-research {
  background: linear-gradient(135deg, rgba(13, 202, 240, 0.04) 0%, rgba(13, 202, 240, 0.08) 100%);
  border-color: rgba(13, 202, 240, 0.2);
}

.session-status-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.session-status-whitelist .session-status-icon {
  background: rgba(25, 135, 84, 0.12);
  color: #198754;
}

.session-status-research .session-status-icon {
  background: rgba(13, 202, 240, 0.12);
  color: #0dcaf0;
}

.session-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
  animation: session-pulse 2.5s ease-out infinite;
}

@keyframes session-pulse {
  0%   { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* Countdown Badge */
.session-countdown-badge {
  text-align: center;
  padding: 0.4rem 1rem;
  border-radius: 0.5rem;
  min-width: 100px;
  flex-shrink: 0;
}

.session-status-whitelist .session-countdown-badge {
  background: rgba(25, 135, 84, 0.1);
  border: 1px solid rgba(25, 135, 84, 0.2);
}

.session-status-research .session-countdown-badge {
  background: rgba(13, 202, 240, 0.1);
  border: 1px solid rgba(13, 202, 240, 0.2);
}

.session-countdown-value {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.session-status-whitelist .session-countdown-value { color: #198754; }
.session-status-research .session-countdown-value  { color: #0aa2c0; }

.session-countdown-value .countdown-sep {
  animation: blink-sep 1s step-end infinite;
}

@keyframes blink-sep {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

.session-countdown-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6c757d;
  line-height: 1;
}

.session-countdown-badge.session-countdown-unlimited .session-countdown-value {
  font-size: 1.5rem;
}

.session-countdown-badge.session-countdown-warning {
  background: rgba(255, 193, 7, 0.12) !important;
  border-color: rgba(255, 193, 7, 0.3) !important;
}

.session-countdown-badge.session-countdown-warning .session-countdown-value {
  color: #cc9a06 !important;
}

.session-countdown-badge.session-countdown-danger {
  background: rgba(220, 53, 69, 0.1) !important;
  border-color: rgba(220, 53, 69, 0.25) !important;
  animation: countdown-danger-pulse 1s ease-in-out infinite;
}

.session-countdown-badge.session-countdown-danger .session-countdown-value {
  color: #dc3545 !important;
}

@keyframes countdown-danger-pulse {
  0%, 100% { background: rgba(220, 53, 69, 0.08); }
  50%      { background: rgba(220, 53, 69, 0.16); }
}

/* Progress Track */
.session-progress-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.session-progress-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 1s linear;
}

.session-status-whitelist .session-progress-bar { background: #198754; }
.session-status-research .session-progress-bar  { background: #0dcaf0; }

.session-progress-bar.progress-warning { background: #ffc107 !important; }
.session-progress-bar.progress-danger  { background: #dc3545 !important; }

/* Alert enhancements */
.alert {
  border-radius: 0.5rem;
}

/* Room Detail Header */
.room-detail-header {
  background: #fff;
}

/* Room Detail Tabs */
.room-detail-tabs {
  gap: 0.5rem;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0;
  padding-left: 0;
  padding-right: 0;
}

.room-detail-tabs .nav-link {
  border-radius: 0.5rem 0.5rem 0 0;
  padding: 0.6rem 1.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: #6c757d;
  background: transparent;
  border: 2px solid transparent;
  border-bottom: none;
  margin-bottom: -2px;
  transition: all 0.15s ease;
}

.room-detail-tabs .nav-link:hover {
  color: #495057;
  background: #f8f9fa;
}

.room-detail-tabs .nav-link.active {
  color: #0d6efd;
  background: #fff;
  border-color: #e9ecef;
  border-bottom-color: #fff;
}

.room-detail-tabs .nav-link .badge {
  font-size: 0.7rem;
}

/* Tab content — inner cards merge into the outer wrapper */
#roomTabContent > .tab-pane > div > .card,
#roomTabContent > .tab-pane > .card {
  border: 0;
  box-shadow: none;
  background: transparent;
}

/* Session Mode Cards */
.session-mode-card {
  cursor: pointer;
  transition: all 0.2s ease;
  border-color: #dee2e6;
  background: #fff;
}

.session-mode-card:hover {
  border-color: #adb5bd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.session-mode-card.session-mode-selected-whitelist {
  border-color: #198754;
  background: linear-gradient(135deg, rgba(25, 135, 84, 0.04) 0%, rgba(25, 135, 84, 0.08) 100%);
  box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.1);
}

.session-mode-card.session-mode-selected-research {
  border-color: #0dcaf0;
  background: linear-gradient(135deg, rgba(13, 202, 240, 0.04) 0%, rgba(13, 202, 240, 0.08) 100%);
  box-shadow: 0 0 0 3px rgba(13, 202, 240, 0.1);
}

.session-mode-icon {
  width: 44px;
  height: 44px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.session-mode-check {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s ease;
}

.session-mode-selected-whitelist .session-mode-check {
  opacity: 1;
  transform: scale(1);
  background: #198754;
  color: #fff;
}

.session-mode-selected-research .session-mode-check {
  opacity: 1;
  transform: scale(1);
  background: #0dcaf0;
  color: #fff;
}

/* Session Start Button */
.session-start-btn {
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.875rem 1.5rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  border: none;
}

.session-start-btn-whitelist,
.session-start-btn:not(.session-start-btn-research) {
  background: linear-gradient(135deg, #198754 0%, #157347 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
}

.session-start-btn-whitelist:hover,
.session-start-btn:not(.session-start-btn-research):hover {
  background: linear-gradient(135deg, #157347 0%, #146c43 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(25, 135, 84, 0.4);
  color: #fff;
}

.session-start-btn-research {
  background: linear-gradient(135deg, #0dcaf0 0%, #0aa2c0 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(13, 202, 240, 0.35);
}

.session-start-btn-research:hover {
  background: linear-gradient(135deg, #0aa2c0 0%, #0891b2 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13, 202, 240, 0.4);
  color: #fff;
}

/* Session Lock Panel */
.session-lock-panel {
  background: #f8f9fa;
  border: 1px dashed #dee2e6 !important;
  transition: all 0.25s ease;
}

.session-lock-panel:hover {
  border-color: #ffc107 !important;
}

.session-lock-panel.session-lock-active {
  background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
  border: 1px solid #ffc107 !important;
  border-style: solid !important;
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.15);
}

.session-locked-badge {
  background: linear-gradient(135deg, #fff3cd 0%, #fde68a 100%);
  color: #92400e;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2em 0.55em;
  border-radius: 4px;
  border: 1px solid #fbbf24;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

/* Session Actions Panel (for active sessions) */
.session-actions-panel {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 1rem;
}

.session-action-card {
  transition: all 0.15s ease;
}

.session-action-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.session-action-end {
  border-color: rgba(220, 53, 69, 0.2);
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.02) 0%, rgba(220, 53, 69, 0.04) 100%);
}

.action-icon {
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Session Configuration Panel */
.session-config-panel {
  border-color: #e9ecef !important;
}

/* Duration Preset Picker */
.duration-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.duration-preset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: 2px solid #e9ecef;
  border-radius: 0.5rem;
  background: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  color: #495057;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 70px;
}

.duration-preset-btn:hover {
  border-color: #0d6efd;
  color: #0d6efd;
  background: rgba(13, 110, 253, 0.04);
}

.duration-preset-btn.active {
  border-color: #0d6efd;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.08) 0%, rgba(13, 110, 253, 0.12) 100%);
  color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.duration-preset-btn .duration-unit {
  font-size: 0.7rem;
  font-weight: 500;
  margin-left: 2px;
  opacity: 0.7;
}

.duration-custom-btn {
  min-width: 90px;
}

.custom-duration-panel {
  padding: 0.75rem;
  background: rgba(13, 110, 253, 0.04);
  border-radius: 0.5rem;
  border: 1px solid rgba(13, 110, 253, 0.15);
}

.selected-duration-display {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: rgba(13, 110, 253, 0.06);
  border-radius: 0.375rem;
}

/* Device Control Cards */
.device-control-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  background: #fff;
  border: 1px solid #e9ecef;
  border-left: 3px solid #e9ecef;
}

.device-control-card.device-blocked {
  border-left-color: #dc3545;
}

.device-control-card.device-allowed {
  border-left-color: #198754;
}

.device-control-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.device-control-icon {
  width: 44px;
  height: 44px;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.device-control-icon.blocked {
  background: rgba(220, 53, 69, 0.08);
  color: #dc3545;
}

.device-control-icon.allowed {
  background: rgba(25, 135, 84, 0.08);
  color: #198754;
}

.device-status-label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.device-status-label.blocked {
  color: #dc3545;
}

.device-status-label.allowed {
  color: #198754;
}

.device-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.device-status-label.blocked .device-status-dot {
  background: #dc3545;
}

.device-status-label.allowed .device-status-dot {
  background: #198754;
  box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.2);
}

/* Student list items */
.last-no-border:last-child {
  border-bottom: none !important;
}

/* Scene Cards */
.scene-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 0.75rem;
  overflow: hidden;
  border-left: 4px solid #6f42c1;
}

.scene-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1) !important;
}

.scene-card .scene-url-list {
  max-height: 100px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.scene-card .scene-url-list::-webkit-scrollbar {
  width: 4px;
}

.scene-card .scene-url-list::-webkit-scrollbar-thumb {
  background: #dee2e6;
  border-radius: 2px;
}

.scene-url-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 0.375rem;
  background: #f0f2f5;
  font-size: 0.78rem;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #495057;
  border: 1px solid #e9ecef;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-empty-state {
  padding: 3rem 1rem;
}

.scene-empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8e0f0, #f3eefa);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: #6f42c1;
}

.scene-url-table .btn-remove {
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.scene-url-table tr:hover .btn-remove {
  opacity: 1;
}

/* Footer */
.footer {
  background-color: #fff;
}

/* Analytics Dashboard Styles */
.analytics-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: 1rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.analytics-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
  border-radius: 50%;
}

.stat-trend {
  font-weight: 600;
}

.engagement-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: conic-gradient(
    #0d6efd calc(var(--percentage) * 1%),
    #e9ecef calc(var(--percentage) * 1%)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.engagement-circle::before {
  content: '';
  position: absolute;
  width: 60px;
  height: 60px;
  background: white;
  border-radius: 50%;
}

.engagement-value {
  position: relative;
  z-index: 1;
  font-weight: 700;
  font-size: 0.9rem;
}

.session-type-badge {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 0.5rem;
  min-width: 100px;
  border: 1px solid #e9ecef;
}

.activity-feed .activity-item {
  transition: background 0.15s ease;
}

.activity-feed .activity-item:hover {
  background: #f8f9fa;
}

.activity-feed .activity-item:last-child {
  border-bottom: none !important;
}

.quick-range {
  font-size: 0.75rem;
}

.chart-toggle.active {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}

.bg-primary-subtle { background-color: rgba(13, 110, 253, 0.12) !important; }
.bg-success-subtle { background-color: rgba(25, 135, 84, 0.12) !important; }
.bg-info-subtle { background-color: rgba(13, 202, 240, 0.15) !important; }
.bg-warning-subtle { background-color: rgba(255, 193, 7, 0.18) !important; }

.text-primary { color: #0d6efd !important; }
.text-success { color: #198754 !important; }

/* Navbar Dropdown Styles */
.navbar-dark .dropdown-menu-dark {
  background-color: #212529;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
  padding: 0.5rem 0;
  min-width: 200px;
}

.navbar-dark .dropdown-menu-dark .dropdown-item {
  color: rgba(255, 255, 255, 0.8);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  transition: all 0.15s ease;
}

.navbar-dark .dropdown-menu-dark .dropdown-item:hover,
.navbar-dark .dropdown-menu-dark .dropdown-item:focus {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.navbar-dark .dropdown-menu-dark .dropdown-item svg {
  opacity: 0.7;
}

.navbar-dark .dropdown-menu-dark .dropdown-item:hover svg {
  opacity: 1;
}

.navbar-dark .dropdown-menu-dark .dropdown-divider {
  border-color: rgba(255, 255, 255, 0.1);
  margin: 0.35rem 0;
}

.navbar-dark .dropdown-menu-dark .dropdown-header {
  color: rgba(255, 255, 255, 0.5);
  padding: 0.35rem 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.navbar .nav-link {
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem !important;
}

.navbar-dark .nav-link,
.navbar-dark .nav-link.dropdown-toggle {
  color: rgba(255, 255, 255, 0.75) !important;
}

.navbar-dark .nav-link:hover,
.navbar-dark .nav-link:focus,
.navbar-dark .nav-link.dropdown-toggle:hover,
.navbar-dark .nav-link.dropdown-toggle:focus {
  color: #fff !important;
}

.navbar-dark .nav-item.show .nav-link.dropdown-toggle {
  color: #fff !important;
}

.navbar .dropdown-toggle::after {
  margin-left: 0.35rem;
  vertical-align: 0.15em;
}

/* Student Data Refresh Timer */
.student-refresh-timer {
  padding: 0.35rem 0.75rem;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.06) 0%, rgba(13, 110, 253, 0.02) 100%);
  border: 1px solid rgba(13, 110, 253, 0.15);
  border-radius: 2rem;
  transition: all 0.3s ease;
}

.student-refresh-timer:hover {
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(13, 110, 253, 0.05) 100%);
  border-color: rgba(13, 110, 253, 0.25);
}

.student-refresh-timer.is-refreshing {
  background: linear-gradient(135deg, rgba(25, 135, 84, 0.1) 0%, rgba(25, 135, 84, 0.05) 100%);
  border-color: rgba(25, 135, 84, 0.3);
}

.student-refresh-timer.is-refreshing .refresh-timer-progress {
  stroke: #198754 !important;
  animation: refresh-spin 0.8s linear infinite;
}

.student-refresh-timer.refreshing-soon {
  animation: refresh-pulse 0.5s ease-in-out infinite;
}

@keyframes refresh-pulse {
  0%, 100% { background: linear-gradient(135deg, rgba(25, 135, 84, 0.08) 0%, rgba(25, 135, 84, 0.04) 100%); }
  50% { background: linear-gradient(135deg, rgba(25, 135, 84, 0.15) 0%, rgba(25, 135, 84, 0.08) 100%); }
}

@keyframes refresh-spin {
  from { transform: rotate(-90deg); }
  to { transform: rotate(270deg); }
}

.refresh-timer-ring {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.refresh-timer-ring svg {
  display: block;
}

.refresh-timer-bg {
  opacity: 1;
}

.refresh-timer-progress {
  transition: stroke-dashoffset 0.3s ease, stroke 0.3s ease;
  transform-origin: center center;
}

.refresh-timer-text {
  font-size: 9px;
  font-weight: 700;
  fill: #0d6efd;
  font-family: system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
}

.student-refresh-timer.is-refreshing .refresh-timer-text {
  fill: #198754;
}

.refresh-timer-label {
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Device Status Indicators */
.device-info-cell {
  min-width: 180px;
}

.device-info-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.device-not-found {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #6c757d;
  font-size: 0.85rem;
}

.device-serial {
  font-size: 0.8rem;
}

.device-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
}

.device-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-weight: 600;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.device-status-badge.online {
  background-color: rgba(25, 135, 84, 0.15);
  color: #198754;
}

.device-status-badge.idle {
  background-color: rgba(13, 202, 240, 0.15);
  color: #0aa2c0;
}

.device-status-badge.away {
  background-color: rgba(255, 193, 7, 0.2);
  color: #997404;
}

.device-status-badge.offline {
  background-color: rgba(108, 117, 125, 0.15);
  color: #6c757d;
}

.device-status-badge.unknown {
  background-color: rgba(108, 117, 125, 0.1);
  color: #adb5bd;
}

.device-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.device-status-dot.online {
  background-color: #198754;
  box-shadow: 0 0 0 2px rgba(25, 135, 84, 0.25);
  animation: device-pulse-online 2s infinite;
}

.device-status-dot.idle {
  background-color: #0dcaf0;
  box-shadow: 0 0 0 2px rgba(13, 202, 240, 0.25);
}

.device-status-dot.away {
  background-color: #ffc107;
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.25);
}

.device-status-dot.offline {
  background-color: #6c757d;
}

.device-status-dot.unknown {
  background-color: #adb5bd;
  border: 1px dashed #dee2e6;
}

@keyframes device-pulse-online {
  0%, 100% { box-shadow: 0 0 0 2px rgba(25, 135, 84, 0.25); }
  50%      { box-shadow: 0 0 0 5px rgba(25, 135, 84, 0.1); }
}

.device-last-seen {
  color: #6c757d;
}

/* Student View Toggle */
.student-view-toggle {
  padding: 0.35rem 0.6rem;
}

.student-view-toggle.active {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}

.student-view-toggle.active:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
  color: #fff;
}

/* Student Grid Cards */
.student-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 0.75rem;
  padding: 1rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.student-card:hover {
  border-color: #dee2e6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.student-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.student-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  overflow: hidden;
}

.student-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.student-card-menu .btn {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.student-card:hover .student-card-menu .btn {
  opacity: 1;
}

.student-card-body {
  flex: 1;
}

.student-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #212529;
  line-height: 1.3;
}

.student-email {
  font-size: 0.8rem;
  word-break: break-all;
}

.student-card-footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f3f4;
}

.device-info-grid {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.device-serial-grid code {
  font-size: 0.7rem;
}

.device-status-text {
  font-weight: 500;
}

.device-status-text.online {
  color: #198754;
}

.device-status-text.idle {
  color: #0aa2c0;
}

.device-status-text.away {
  color: #997404;
}

.device-status-text.offline {
  color: #6c757d;
}

/* Grid View Container */
.student-grid-view {
  background: #f8f9fa;
  border-radius: 0 0 0.5rem 0.5rem;
}

/* Settings Page — BambooHR-inspired layout */
.settings-page-title {
  font-weight: 700;
  color: #1a3353;
  font-size: 1.75rem;
  letter-spacing: -0.01em;
}

.settings-layout {
  display: flex;
  gap: 0;
  min-height: 600px;
}

.settings-layout-sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid #e9ecef;
  padding-right: 1.25rem;
}

.settings-layout-content {
  flex: 1;
  min-width: 0;
  padding-left: 2rem;
}

.settings-content-title {
  font-weight: 700;
  color: #1a3353;
  margin-bottom: 0.25rem;
}

/* Sidebar navigation */
.settings-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.6rem 0.875rem;
  border-radius: 0.5rem;
  color: #495057;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  border: 2px solid transparent;
}

.settings-sidebar-item:hover {
  background: #f8f9fa;
  color: #1a3353;
  text-decoration: none;
}

.settings-sidebar-item.active {
  color: #1a3353;
  background: #fff;
  border-color: #1a3353;
  font-weight: 600;
}

.settings-sidebar-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.settings-sidebar-item.active svg {
  opacity: 1;
}

/* Field groups — clean section dividers */
.settings-field-group {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e9ecef;
}

.settings-field-group:last-of-type {
  border-bottom: none;
}

.settings-field-group-title {
  font-weight: 700;
  color: #1a3353;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

/* Control list for toggle rows */
.settings-control-list {
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
  overflow: hidden;
}

.settings-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f0f2f5;
  transition: background 0.15s ease;
}

.settings-control-row:last-child {
  border-bottom: none;
}

.settings-control-row:hover {
  background: #fafbfc;
}

/* Keep existing icon utilities */
.settings-nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Responsive: stack sidebar on small screens */
@media (max-width: 768px) {
  .settings-layout {
    flex-direction: column;
  }

  .settings-layout-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e9ecef;
    padding-right: 0;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
  }

  .settings-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .settings-sidebar-item {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .settings-layout-content {
    padding-left: 0;
  }
}

/* ===== Dashboard Admin Monitoring Grid ===== */
.monitor-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.625rem;
  overflow: visible;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.monitor-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.monitor-screen {
  position: relative;
  background: #1a1a2e;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  border-radius: 0.625rem 0.625rem 0 0;
}

.monitor-screen-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  min-height: 140px;
  max-height: 180px;
}

.monitor-no-signal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 1.5rem;
  text-transform: uppercase;
}

.monitor-student-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: #fff;
}

.monitor-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.55rem;
  flex-shrink: 0;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
}

.monitor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.monitor-student-name {
  font-size: 0.75rem;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  line-height: 1.2;
  min-width: 0;
  letter-spacing: 0.01em;
}

.monitor-card-student-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
  margin-bottom: 0.125rem;
}

.monitor-session-badge {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
}

.monitor-tab-bar {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.35rem 0.5rem;
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  font-size: 0.68rem;
  min-width: 0;
  overflow: hidden;
}

.monitor-tab-url {
  color: #0d6efd;
  min-width: 0;
  display: block;
  font-size: 0.68rem;
}

.monitor-card-info {
  padding: 0.625rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.monitor-other-session-banner {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
  color: #664d03;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.3;
  border-bottom: 1px solid rgba(255, 193, 7, 0.35);
  border-radius: 0.625rem 0.625rem 0 0;
  z-index: 12;
  position: relative;
}

.monitor-other-session-banner svg {
  color: #cc8800;
  flex-shrink: 0;
}

.monitor-other-session-banner + .student-screen-area .monitor-screen {
  border-radius: 0;
}

.monitor-room-link {
  font-size: 0.8rem;
  color: #334155;
  min-width: 0;
}

.monitor-room-link:hover {
  color: #0d6efd;
}

.monitor-teacher-line {
  font-size: 0.68rem;
}

.monitor-campus-badge {
  font-size: 0.55rem !important;
  padding: 0.1rem 0.35rem;
}

.monitor-action-btn {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
}

.monitor-actions-menu {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.monitor-actions-menu .dropdown-menu {
  z-index: 1080;
  max-height: 400px;
  overflow-y: auto;
}

/* Ensure grid student cards don't clip dropdown menus */
.student-grid-view .monitor-card,
.student-grid-view .monitor-card-info,
.student-grid-view .monitor-screen,
.student-grid-view .student-screen-area {
  overflow: visible;
}

.student-grid-view .monitor-screen {
  border-radius: 0.625rem 0.625rem 0 0;
}

/* Allow dropdown to escape card boundaries in student grid */
.student-grid-view {
  overflow: visible;
}

/* Give every grid column an explicit stacking context so z-index elevation works */
.student-grid-view .col-sm-6,
.student-grid-view .col-md-4,
.student-grid-view .col-lg-3 {
  overflow: visible;
  position: relative;
  z-index: 1;
}

#students-pane .card,
#students-pane .card-body {
  overflow: visible;
}

.monitor-card:hover .monitor-actions-menu,
.monitor-card .monitor-actions-menu:has(.dropdown.show) {
  opacity: 1;
}

/* When a dropdown is open, remove the hover transform so it doesn't create
   an isolated stacking context that traps the menu's z-index. */
.student-grid-view .monitor-card:has(.dropdown.show) {
  transform: none !important;
}

/* Elevate the grid column when its dropdown is open so it renders above cards in the next row */
.student-grid-view .dropdown-col-elevated {
  z-index: 1080 !important;
}

/* =========================================
   Onboarding Checklist
   ========================================= */
.onboarding-card {
  border-radius: 1rem;
  background: linear-gradient(135deg, #f0f4ff 0%, #fff 60%);
  border-left: 4px solid #0d6efd !important;
}

.onboarding-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(13, 110, 253, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0d6efd;
  flex-shrink: 0;
}

.onboarding-progress {
  height: 8px;
  border-radius: 4px;
  background-color: #e9ecef;
}

.onboarding-progress .progress-bar {
  border-radius: 4px;
  transition: width 0.6s ease;
}

.onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.onboarding-step {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
}

.onboarding-step:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.onboarding-step:first-child {
  padding-top: 0;
}

.onboarding-step.active {
  background-color: transparent;
}

.onboarding-step.locked {
  opacity: 0.5;
}

.onboarding-step.completed .onboarding-step-content h6 {
  color: #6c757d !important;
}

.onboarding-step-indicator {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.onboarding-step-indicator .step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e9ecef;
  color: #495057;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboarding-step.active .onboarding-step-indicator .step-number {
  background: #0d6efd;
  color: #fff;
}

.onboarding-step-content {
  flex: 1;
  min-width: 0;
}

/* ===== Dark Mode Overrides ===== */
[data-bs-theme="dark"] body {
  background-color: #1a1d21;
  color: #dee2e6;
}

[data-bs-theme="dark"] .stat-card,
[data-bs-theme="dark"] .monitor-card {
  background: #212529;
  border-color: #343a40;
}

[data-bs-theme="dark"] .stat-number {
  color: #f8f9fa;
}

[data-bs-theme="dark"] .stat-label {
  color: #ced4da;
}

[data-bs-theme="dark"] .stat-sublabel {
  color: #9ea7b0;
}

[data-bs-theme="dark"] .welcome-section {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 40%, #0f3460 70%, #1a3353 100%);
}

[data-bs-theme="dark"] .room-card {
  background: #212529;
  border-color: #343a40;
  color: #dee2e6;
}

[data-bs-theme="dark"] .room-card .card-title {
  color: #f8f9fa;
}

[data-bs-theme="dark"] .room-card .text-muted {
  color: #9ea7b0 !important;
}

[data-bs-theme="dark"] .room-card .card-footer {
  color: #9ea7b0;
}

[data-bs-theme="dark"] .room-card .badge.bg-secondary-subtle {
  background-color: #3a3f44 !important;
  color: #dee2e6 !important;
}

[data-bs-theme="dark"] .session-card {
  background: #1a1d21;
  border-color: rgba(25, 135, 84, 0.25);
  margin-top: 20px;
}

[data-bs-theme="dark"] .card {
  background: #24282c;
  border-color: #3a3f44;
  color: #dee2e6;
}

[data-bs-theme="dark"] .card-header {
  background: #1e2226 !important;
  border-color: #3a3f44;
  color: #dee2e6;
}

[data-bs-theme="dark"] .card-body {
  color: #dee2e6;
}

[data-bs-theme="dark"] .table {
  --bs-table-bg: #24282c;
  --bs-table-striped-bg: #2c3034;
  --bs-table-hover-bg: #323539;
  color: #dee2e6;
}

[data-bs-theme="dark"] .table-light {
  --bs-table-bg: #2c3034;
  color: #dee2e6;
}

[data-bs-theme="dark"] .list-group-item {
  background-color: #24282c;
  border-color: #3a3f44;
  color: #dee2e6;
}

[data-bs-theme="dark"] .bg-light {
  background-color: #2c3034 !important;
  color: #dee2e6;
}

[data-bs-theme="dark"] .analytics-header {
  background: linear-gradient(135deg, #0d1117, #161b22);
}

[data-bs-theme="dark"] .settings-layout-sidebar {
  border-color: #3a3f44;
}

[data-bs-theme="dark"] .settings-sidebar-item {
  color: #ced4da;
}

[data-bs-theme="dark"] .settings-sidebar-item:hover,
[data-bs-theme="dark"] .settings-sidebar-item.active {
  background: #343a40;
  color: #fff;
}

/* Dark mode text visibility */
[data-bs-theme="dark"] .text-muted {
  color: #9ea7b0 !important;
}

[data-bs-theme="dark"] .text-dark {
  color: #000000 !important;
}

[data-bs-theme="dark"] .fw-bold,
[data-bs-theme="dark"] .fw-semibold,
[data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3, [data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5, [data-bs-theme="dark"] h6 {
  color: #f8f9fa;
}

[data-bs-theme="dark"] .form-label {
  color: #dee2e6;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: #2c3034;
  border-color: #495057;
  color: #dee2e6;
}

[data-bs-theme="dark"] .form-control::placeholder {
  color: #6c757d;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: #2c3034;
  border-color: #0d6efd;
  color: #f8f9fa;
}

[data-bs-theme="dark"] .input-group-text {
  background-color: #2c3034;
  border-color: #495057;
  color: #ced4da;
}

[data-bs-theme="dark"] .breadcrumb-item a {
  color: #6ea8fe;
}

[data-bs-theme="dark"] .breadcrumb-item.active {
  color: #9ea7b0;
}

[data-bs-theme="dark"] code {
  color: #e685b5;
}

[data-bs-theme="dark"] .border {
  border-color: #3a3f44 !important;
}

[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-bottom {
  border-color: #3a3f44 !important;
}

[data-bs-theme="dark"] .shadow-sm {
  box-shadow: 0 .125rem .25rem rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .alert-success {
  background-color: #0f2e1c;
  border-color: #1a5032;
  color: #75d4a0;
}

[data-bs-theme="dark"] .alert-danger {
  background-color: #2c1519;
  border-color: #4a2028;
  color: #ea868f;
}

[data-bs-theme="dark"] .alert-warning {
  background-color: #332701;
  border-color: #4d3a02;
  color: #ffda6a;
}

[data-bs-theme="dark"] .alert-info {
  background-color: #032830;
  border-color: #055160;
  color: #6edff6;
}

[data-bs-theme="dark"] .modal-content {
  background-color: #24282c;
  border-color: #3a3f44;
  color: #dee2e6;
}

[data-bs-theme="dark"] .modal-header {
  border-color: #3a3f44;
}

[data-bs-theme="dark"] .modal-footer {
  border-color: #3a3f44;
}

[data-bs-theme="dark"] .dropdown-menu {
  background-color: #24282c;
  border-color: #3a3f44;
}

[data-bs-theme="dark"] .dropdown-item {
  color: #dee2e6;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
  background-color: #343a40;
  color: #f8f9fa;
}

[data-bs-theme="dark"] .dropdown-divider {
  border-color: #3a3f44;
}

[data-bs-theme="dark"] .bg-white {
  background-color: #24282c !important;
}

[data-bs-theme="dark"] .bg-opacity-10 {
  --bs-bg-opacity: 0.15;
}

[data-bs-theme="dark"] .room-detail-header {
  background: #24282c;
}

[data-bs-theme="dark"] .room-detail-tabs {
  border-color: #3a3f44;
}

[data-bs-theme="dark"] .room-detail-tabs .nav-link {
  color: #9ea7b0;
}

[data-bs-theme="dark"] .room-detail-tabs .nav-link:hover {
  color: #dee2e6;
  background: #2c3034;
}

[data-bs-theme="dark"] .room-detail-tabs .nav-link.active {
  color: #6ea8fe;
  background: #24282c;
  border-color: #3a3f44;
  border-bottom-color: #24282c;
}

[data-bs-theme="dark"] .session-mode-card {
  background: #2c3034;
  border-color: #3a3f44;
  color: #dee2e6;
}

[data-bs-theme="dark"] .session-mode-card:hover {
  border-color: #6c757d;
}

[data-bs-theme="dark"] .badge.bg-light {
  background-color: #343a40 !important;
  color: #dee2e6 !important;
}

[data-bs-theme="dark"] .page-link {
  background-color: #2c3034;
  border-color: #3a3f44;
  color: #6ea8fe;
}

[data-bs-theme="dark"] .page-item.active .page-link {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}

[data-bs-theme="dark"] .monitor-card-info {
  color: #dee2e6;
}

[data-bs-theme="dark"] .card-footer {
  background-color: #1e2226 !important;
  border-color: #3a3f44;
}

/* Theme toggle icons */
[data-bs-theme="dark"] .theme-icon-light {
  display: none !important;
}
[data-bs-theme="dark"] .theme-icon-dark {
  display: inline-block !important;
}
[data-bs-theme="light"] .theme-icon-dark {
  display: none !important;
}
[data-bs-theme="light"] .theme-icon-light {
  display: inline-block !important;
}

/* ===== Global Loading Overlay ===== */
.global-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
}

.global-loader-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.global-loader-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem 2.5rem;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.global-loader-spinner {
  position: relative;
  width: 48px;
  height: 48px;
}

.global-loader-spinner .spinner-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid transparent;
  animation: loaderSpin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.global-loader-spinner .spinner-ring:nth-child(1) {
  border-top-color: #0d6efd;
  animation-delay: -0.3s;
}

.global-loader-spinner .spinner-ring:nth-child(2) {
  border-top-color: #6610f2;
  animation-delay: -0.15s;
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
}

.global-loader-spinner .spinner-ring:nth-child(3) {
  border-top-color: #0dcaf0;
  width: 60%;
  height: 60%;
  top: 20%;
  left: 20%;
}

@keyframes loaderSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.global-loader-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #495057;
  letter-spacing: 0.02em;
}

[data-bs-theme="dark"] .global-loader-content {
  background: #24282c;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .global-loader-text {
  color: #dee2e6;
}

[data-bs-theme="dark"] .global-loader-backdrop {
  background: rgba(0, 0, 0, 0.55);
}

/* ============================================
   Navbar layout & spacing
   ============================================ */

/* Tighten nav-link padding on large screens so everything fits */
@media (min-width: 992px) {
  .navbar .navbar-nav .nav-link {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    font-size: 0.875rem;
  }

  .navbar .navbar-brand {
    font-size: 0.95rem;
    margin-right: 0.75rem;
  }
}

/* Even tighter at exactly lg (992–1199) to prevent wrapping */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .navbar .navbar-nav .nav-link {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    font-size: 0.8125rem;
  }

  .navbar .navbar-brand {
    font-size: 0.875rem;
    margin-right: 0.5rem;
  }
}

/* Restore comfortable sizing on xl+ */
@media (min-width: 1200px) {
  .navbar .navbar-nav .nav-link {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
    font-size: 0.9rem;
  }

  .navbar .navbar-brand {
    font-size: 1rem;
    margin-right: 1rem;
  }
}

/* Right side nav items: tighter spacing, vertically centered */
.navbar-right-items .nav-item {
  display: flex;
  align-items: center;
}

@media (min-width: 992px) {
  .navbar-right-items .nav-link {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
  }
}

/* Navbar role indicator dot */
.navbar-role-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  cursor: default;
}

/* ============================================
   Student search box in navbar
   ============================================ */

.navbar-search-wrapper {
  flex: 0 1 260px;
  min-width: 0;
  margin-left: 0.75rem;
  margin-right: 0.75rem;
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .navbar-search-wrapper {
    flex: 0 1 200px;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }
}

@media (min-width: 1200px) {
  .navbar-search-wrapper {
    flex: 0 1 280px;
  }
}

/* On mobile the search box takes full width */
@media (max-width: 991.98px) {
  .navbar-search-wrapper {
    flex: 1 1 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

#studentSearchInput::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#studentSearchInput:focus {
  background-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 0 0 0.15rem rgba(255, 255, 255, 0.25);
}

#studentSearchResults {
  top: 100%;
  left: 0;
  z-index: 1050;
  position: absolute;
  padding: 0.25rem 0;
}

/* Individual search result item */
.student-search-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background-color 0.15s ease;
}

.student-search-item:last-child {
  border-bottom: none;
}

.student-search-item:hover,
.student-search-item.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Avatar column — fixed width so everything aligns */
.student-search-avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
}

.student-search-avatar img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: cover;
}

.student-search-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bs-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* Name + email column — fills remaining space */
.student-search-info {
  flex: 1 1 0;
  min-width: 0;
  line-height: 1.3;
}

.student-search-name {
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.92);
}

.student-search-email {
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.5);
}

.student-search-item:hover .student-search-email,
.student-search-item.active .student-search-email {
  color: rgba(255, 255, 255, 0.65);
}

/* Campus badge — right-aligned, fixed shrink */
.student-search-campus {
  flex: 0 0 auto;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.2em 0.55em;
  border-radius: 0.25rem;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}

/* ============================================
   Org unit searchable dropdown (Change OU modal)
   ============================================ */

.ou-dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1060;
  max-height: 280px;
  overflow-y: auto;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-top: none;
  border-radius: 0 0 0.375rem 0.375rem;
}

.ou-dropdown-item {
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--bs-border-color-translucent);
}

.ou-dropdown-item:last-child {
  border-bottom: none;
}

.ou-dropdown-item:hover,
.ou-dropdown-item.active {
  background-color: var(--bs-primary);
  color: #fff;
}

.ou-dropdown-item:hover .text-muted,
.ou-dropdown-item.active .text-muted {
  color: rgba(255, 255, 255, 0.75) !important;
}

.ou-dropdown-item-path {
  font-size: 0.875rem;
  font-family: var(--bs-font-monospace);
  word-break: break-all;
}

.ou-dropdown-item-name {
  font-size: 0.75rem;
}

.ou-dropdown-item mark {
  background-color: rgba(255, 193, 7, 0.35);
  padding: 0;
  border-radius: 2px;
}

.ou-dropdown-item.active mark,
.ou-dropdown-item:hover mark {
  background-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.ou-dropdown-empty {
  padding: 0.75rem;
  text-align: center;
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
}

/* ===== Schedule Timeline ===== */
.schedule-timeline-wrapper {
  overflow-x: auto;
  padding: 0 0 0.25rem;
}

.schedule-timeline {
  display: grid;
  grid-template-columns: 56px 1fr;
  min-width: 600px;
}

/* Corner cell (top-left) */
.tl-corner {
  border-bottom: 1px solid #e9ecef;
  background: #fafbfc;
}

/* Hour header row */
.tl-header {
  position: relative;
  height: 28px;
  border-bottom: 1px solid #e9ecef;
  background: #fafbfc;
}

.tl-hour-label {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: #868e96;
  line-height: 28px;
  white-space: nowrap;
  font-weight: 500;
}

/* Day label (left column) */
.tl-day-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  border-bottom: 1px solid #f1f3f5;
  background: #fafbfc;
  min-height: 44px;
}

.tl-day-abbr {
  font-size: 0.65rem;
  font-weight: 600;
  color: #868e96;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.tl-day-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: #495057;
  margin-top: 1px;
  line-height: 1;
}

.tl-today .tl-day-abbr {
  color: #4361ee;
}

.tl-today-badge {
  background: #4361ee;
  color: #fff !important;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

/* Day row (right column — the timeline area) */
.tl-day-row {
  position: relative;
  border-bottom: 1px solid #f1f3f5;
  min-height: 44px;
  background: #fff;
}

.tl-today-row {
  background: rgba(67, 97, 238, 0.03);
}

/* Hour grid lines */
.tl-grid-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #f1f3f5;
  pointer-events: none;
}

/* Now indicator */
.tl-now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e63946;
  z-index: 3;
  border-radius: 1px;
}

.tl-now-line::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  width: 8px;
  height: 8px;
  background: #e63946;
  border-radius: 50%;
}

/* Schedule block */
.tl-block {
  position: absolute;
  top: 4px;
  bottom: 4px;
  background: var(--block-color, #4361ee);
  border-radius: 6px;
  overflow: hidden;
  cursor: default;
  z-index: 2;
  display: flex;
  align-items: center;
  padding: 0 8px;
  opacity: 0.88;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tl-block:hover {
  opacity: 1;
  transform: scaleY(1.08);
  z-index: 4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.tl-block-text {
  font-size: 0.65rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ── Schedule Cards ── */
.sched-card {
  background: #fff;
  border-radius: 0.875rem;
  border: 1px solid #e9ecef;
  border-left: 4px solid var(--sched-accent, #4361ee);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sched-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
}

.sched-card-muted {
  opacity: 0.55;
}

.sched-card-muted:hover {
  opacity: 0.75;
}

.sched-card-body {
  padding: 1.25rem 1.25rem 1rem;
  flex: 1;
}

.sched-icon {
  width: 36px;
  height: 36px;
  border-radius: 0.625rem;
  background: color-mix(in srgb, var(--sched-accent) 10%, transparent);
  color: var(--sched-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sched-room-label {
  font-size: 0.72rem;
  color: #868e96;
  font-weight: 500;
  line-height: 1.2;
}

.sched-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2em 0.6em;
  border-radius: 50rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.sched-badge-active {
  background: rgba(25, 135, 84, 0.1);
  color: #198754;
}

.sched-badge-disabled {
  background: rgba(108, 117, 125, 0.1);
  color: #6c757d;
}

.sched-badge-expired {
  background: rgba(255, 193, 7, 0.15);
  color: #997404;
}

.sched-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
}

.sched-info-item {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.sched-info-icon {
  color: #adb5bd;
  margin-top: 1px;
  flex-shrink: 0;
}

.sched-info-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #adb5bd;
  line-height: 1;
  margin-bottom: 2px;
}

.sched-info-value {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #343a40;
  line-height: 1.3;
}

.sched-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.625rem;
}

.sched-meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: #495057;
  background: #f1f3f5;
  padding: 0.2em 0.55em;
  border-radius: 0.375rem;
}

.sched-last-run {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: #adb5bd;
  padding-top: 0.5rem;
  border-top: 1px solid #f1f3f5;
}

.sched-card-actions {
  display: flex;
  align-items: center;
  gap: 0;
  border-top: 1px solid #f1f3f5;
}

.sched-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 1;
  padding: 0.6rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #6c757d;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.sched-action-btn:hover {
  background: #f8f9fa;
}

.sched-action-btn + form,
.sched-action-btn + form + form {
  flex: 0;
}

.sched-action-edit { flex: 1; color: #4361ee; border-right: 1px solid #f1f3f5; }
.sched-action-edit:hover { background: rgba(67, 97, 238, 0.05); color: #3451d1; }

.sched-action-enable { flex: 1; color: #198754; border-right: 1px solid #f1f3f5; }
.sched-action-enable:hover { background: rgba(25, 135, 84, 0.05); color: #146c43; }

.sched-action-disable { flex: 1; color: #cc9a06; border-right: 1px solid #f1f3f5; }
.sched-action-disable:hover { background: rgba(255, 193, 7, 0.08); color: #997404; }

.sched-action-delete { flex: 0; min-width: 44px; color: #adb5bd; }
.sched-action-delete:hover { background: rgba(220, 53, 69, 0.06); color: #dc3545; }

/* ====== Unlimited-session badge (dashboard & room views) ====== */
.session-unlimited-badge {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff !important;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.35);
    text-transform: uppercase;
    line-height: 1;
}

.session-unlimited-badge svg {
    opacity: 0.95;
}