/**
 * ============================================================================
 * PRYASKAY ABDY — INSIDE APP DARK MODE (NOCTURNAL EMERALD-OBSIDIAN & GOLD)
 * Loaded AFTER app-heritage.css so every html.dark selector strictly wins
 * over light parchment rules across the entire inside application.
 * ============================================================================
 */

/* 1. GLOBAL APP VIEWPORT, LOBBY & CHAT CANVAS */
html.dark #mainApp,
html.dark #classroomChatStage,
html.dark #messagesContainer,
html.dark #chatMessagesArea,
body.dark-theme #mainApp,
body.dark-theme #classroomChatStage,
body.dark-theme #messagesContainer,
body.dark-theme #chatMessagesArea,
body.dark-mode #mainApp,
body.dark-mode #classroomChatStage,
body.dark-mode #messagesContainer,
body.dark-mode #chatMessagesArea {
  background-color: #0e1713 !important;
  background-image:
    url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22180%22%20height%3D%22180%22%20viewBox%3D%220%200%20180%20180%22%20fill%3D%22none%22%3E%20%3Cg%20stroke%3D%22%23fbbf24%22%20stroke-width%3D%220.75%22%20opacity%3D%220.102%22%3E%20%3Ccircle%20cx%3D%2290%22%20cy%3D%2290%22%20r%3D%2214%22%20stroke-dasharray%3D%222%202%22%2F%3E%20%3Ccircle%20cx%3D%2290%22%20cy%3D%2290%22%20r%3D%227.5%22%2F%3E%20%3Ccircle%20cx%3D%2290%22%20cy%3D%2290%22%20r%3D%222%22%20fill%3D%22%23fbbf24%22%2F%3E%20%3Cpath%20d%3D%22M90%2068v-5M90%20117v-5M68%2090h-5M117%2090h-5M74.4%2074.4l-3.5-3.5M109.1%20109.1l-3.5-3.5M105.6%2074.4l3.5-3.5M70.9%20109.1l3.5-3.5M82.5%2070l-1.5-4.5M99%20114.5l-1.5-4.5M110%2082.5l4.5-1.5M65.5%2099l4.5-1.5%22%2F%3E%20%3C%2Fg%3E%20%3Cg%20stroke%3D%22%23fbbf24%22%20stroke-width%3D%220.8%22%20opacity%3D%220.119%22%3E%20%3Cpath%20d%3D%22M40%2024a12%2012%200%201%200%2011%2016.5A9.5%209.5%200%201%201%2040%2024Z%22%20fill%3D%22%23fbbf24%22%20fill-opacity%3D%220.05%22%2F%3E%20%3Cpath%20d%3D%22M52%2024l1.2%203.2%203.2%201.2-3.2%201.2-1.2%203.2-1.2-3.2-3.2-1.2%203.2-1.2Z%22%2F%3E%20%3C%2Fg%3E%20%3Cg%20stroke%3D%22%23fbbf24%22%20stroke-width%3D%220.75%22%20opacity%3D%220.102%22%3E%20%3Ccircle%20cx%3D%22139%22%20cy%3D%22139%22%20r%3D%226.5%22%20fill%3D%22%23fbbf24%22%20fill-opacity%3D%220.14%22%2F%3E%20%3Ccircle%20cx%3D%22139%22%20cy%3D%22139%22%20r%3D%223%22%20fill%3D%22%23fbbf24%22%20fill-opacity%3D%220.35%22%2F%3E%20%3Ccircle%20cx%3D%22139%22%20cy%3D%22139%22%20r%3D%2210%22%20stroke-dasharray%3D%221.8%202.2%22%2F%3E%20%3Cpath%20d%3D%22M139%20124v-4M139%20158v-4M124%20139h-4M158%20139h-4M128.4%20128.4l-2.8-2.8M152.4%20152.4l-2.8-2.8M149.6%20128.4l2.8-2.8M125.6%20152.4l2.8-2.8%22%2F%3E%20%3C%2Fg%3E%20%3Cg%20stroke%3D%22%23fbbf24%22%20stroke-width%3D%220.7%22%20opacity%3D%220.102%22%3E%20%3Cpath%20d%3D%22M142%2030l2%206%206%202-6%202-2%206-2-6-6-2%206-2Z%22%2F%3E%20%3Ccircle%20cx%3D%22142%22%20cy%3D%2238%22%20r%3D%2213%22%20stroke-dasharray%3D%221.5%203.5%22%2F%3E%20%3C%2Fg%3E%20%3Cg%20stroke%3D%22%23fbbf24%22%20stroke-width%3D%220.75%22%20opacity%3D%220.119%22%3E%20%3Cpath%20d%3D%22M44%20134a10%2010%200%201%201-9.5%2013.5%208%208%200%201%200%209.5-13.5Z%22%2F%3E%20%3Cpath%20d%3D%22M29%20144l1%202.6%202.6%201-2.6%201-1%202.6-1-2.6-2.6-1%202.6-1Z%22%2F%3E%20%3C%2Fg%3E%20%3Cg%20stroke%3D%22%23fbbf24%22%20stroke-width%3D%220.55%22%20opacity%3D%220.068%22%3E%20%3Cpath%20d%3D%22M90%200v14M90%20166v14M0%2090h14M166%2090h14%22%20stroke-dasharray%3D%222%203%22%2F%3E%20%3Cpath%20d%3D%22M0%200l16%2016M180%200l-16%2016M0%20180l16-16M180%20180l-16-16%22%20stroke-dasharray%3D%221.5%203%22%2F%3E%20%3Ccircle%20cx%3D%2290%22%20cy%3D%2220%22%20r%3D%221.5%22%2F%3E%20%3Ccircle%20cx%3D%2290%22%20cy%3D%22160%22%20r%3D%221.5%22%2F%3E%20%3Ccircle%20cx%3D%2220%22%20cy%3D%2290%22%20r%3D%221.5%22%2F%3E%20%3Ccircle%20cx%3D%22160%22%20cy%3D%2290%22%20r%3D%221.5%22%2F%3E%20%3Cpath%20d%3D%22M22%2058l.9%202.1%202.1.9-2.1.9-.9%202.1-.9-2.1-2.1-.9%202.1-.9Z%22%2F%3E%20%3Cpath%20d%3D%22M158%2064l.9%202.1%202.1.9-2.1.9-.9%202.1-.9-2.1-2.1-.9%202.1-.9Z%22%2F%3E%20%3Cpath%20d%3D%22M64%20162l.9%202.1%202.1.9-2.1.9-.9%202.1-.9-2.1-2.1-.9%202.1-.9Z%22%2F%3E%20%3Cpath%20d%3D%22M118%2018l.9%202.1%202.1.9-2.1.9-.9%202.1-.9-2.1-2.1-.9%202.1-.9Z%22%2F%3E%20%3C%2Fg%3E%20%3C%2Fsvg%3E"),
    radial-gradient(ellipse 85% 55% at 50% 0%, rgba(16, 185, 129, 0.08) 0%, transparent 65%),
    radial-gradient(ellipse 90% 60% at 50% 100%, rgba(4, 15, 10, 0.7) 0%, transparent 60%) !important;
  background-size: 180px 180px, 100% 100%, 100% 100% !important;
  background-repeat: repeat, no-repeat, no-repeat !important;
  color: #fff8eb !important;
}

html.dark #mainApp #classroomsLobbyView,
html.dark #mainApp #chatView,
html.dark #classroomsLobbyView,
html.dark #chatView,
body.dark-theme #classroomsLobbyView,
body.dark-theme #chatView,
body.dark-mode #classroomsLobbyView,
body.dark-mode #chatView {
  background-color: transparent !important;
  background: transparent !important;
  color: #fff8eb !important;
}

/* 2. INSIDE APP TOP HEADER (#mainApp > header) */
html.dark #mainApp > header,
body.dark-theme #mainApp > header,
body.dark-mode #mainApp > header {
  background: rgba(14, 23, 18, 0.95) !important;
  border-bottom: 1px solid rgba(245, 158, 11, 0.24) !important;
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 10px 26px -10px rgba(0, 0, 0, 0.72) !important;
  color: #fff8eb !important;
}

html.dark #mainApp > header img[alt*="پریاسکە"],
body.dark-theme #mainApp > header img[alt*="پریاسکە"] {
  background: #14221a !important;
  border: 1.5px solid rgba(245, 158, 11, 0.45) !important;
}

html.dark #mainApp > header h2,
html.dark #mainApp > header #headerFullName,
body.dark-theme #mainApp > header h2,
body.dark-theme #mainApp > header #headerFullName {
  color: #fff8eb !important;
  -webkit-text-fill-color: #fff8eb !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8) !important;
}

html.dark #mainApp > header #onlineCountText,
body.dark-theme #mainApp > header #onlineCountText {
  color: #6ee7b7 !important;
}

html.dark #mainApp > header #backToClassroomsLobbyBtn,
html.dark #mainApp > header #headerActiveRoomBadge,
html.dark #mainApp > header #dreamAdminNavBtn,
html.dark #mainApp > header #topExecutiveHubBtn,
html.dark #mainApp > header #btnThemeToggle,
html.dark #mainApp > header #pushNotificationBtn,
html.dark #mainApp > header #mainMenuBtn,
html.dark #mainApp > header div[onclick="openMyProfile()"],
body.dark-theme #mainApp > header #backToClassroomsLobbyBtn,
body.dark-theme #mainApp > header #headerActiveRoomBadge,
body.dark-theme #mainApp > header #dreamAdminNavBtn,
body.dark-theme #mainApp > header #topExecutiveHubBtn,
body.dark-theme #mainApp > header #btnThemeToggle,
body.dark-theme #mainApp > header #pushNotificationBtn,
body.dark-theme #mainApp > header #mainMenuBtn,
body.dark-theme #mainApp > header div[onclick="openMyProfile()"] {
  background: linear-gradient(145deg, rgba(24, 39, 31, 0.96) 0%, rgba(16, 27, 21, 0.96) 100%) !important;
  border: 1px solid rgba(245, 158, 11, 0.34) !important;
  color: #fef3c7 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 3px 10px -2px rgba(0, 0, 0, 0.45) !important;
}

html.dark #mainApp > header #backToClassroomsLobbyBtn:hover,
html.dark #mainApp > header #dreamAdminNavBtn:hover,
html.dark #mainApp > header #topExecutiveHubBtn:hover,
html.dark #mainApp > header #btnThemeToggle:hover,
html.dark #mainApp > header #pushNotificationBtn:hover,
html.dark #mainApp > header #mainMenuBtn:hover,
html.dark #mainApp > header div[onclick="openMyProfile()"]:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%) !important;
  border-color: rgba(254, 243, 199, 0.5) !important;
  color: #261204 !important;
}

html.dark #mainApp > header #backToClassroomsLobbyBtn i,
html.dark #mainApp > header #headerActiveRoomBadge i,
html.dark #mainApp > header #dreamAdminNavBtn i,
html.dark #mainApp > header #topExecutiveHubBtn i,
html.dark #mainApp > header #btnThemeToggle i,
html.dark #mainApp > header #pushNotificationBtn i,
html.dark #mainApp > header #mainMenuBtn i {
  color: #fbbf24 !important;
}

html.dark #mainApp > header #backToClassroomsLobbyBtn:hover i,
html.dark #mainApp > header #dreamAdminNavBtn:hover i,
html.dark #mainApp > header #topExecutiveHubBtn:hover i,
html.dark #mainApp > header #btnThemeToggle:hover i,
html.dark #mainApp > header #pushNotificationBtn:hover i,
html.dark #mainApp > header #mainMenuBtn:hover i,
html.dark #mainApp > header div[onclick="openMyProfile()"]:hover #headerFullName {
  color: #261204 !important;
  -webkit-text-fill-color: #261204 !important;
}

html.dark #mainApp > header #dreamAdminNavBtn #dreamUnreadBadge,
body.dark-theme #mainApp > header #dreamAdminNavBtn #dreamUnreadBadge {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid #091312 !important;
  box-shadow: 0 2px 10px rgba(244, 63, 94, 0.5) !important;
}

html.dark #mainApp > header #liveLessonNavBtn {
  background: rgba(159, 18, 57, 0.25) !important;
  border: 1px solid rgba(244, 63, 94, 0.45) !important;
  color: #fecdd3 !important;
}

html.dark #mainApp > header #headerRoleBadge {
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #fde68a !important;
}

/* 3. CLASSROOMS LOBBY (#classroomsLobbyView & .classroom-lobby-card) */
html.dark #classroomsLobbyView > div:first-child,
body.dark-theme #classroomsLobbyView > div:first-child {
  background: rgba(16, 27, 21, 0.94) !important;
  border-bottom: 1px solid rgba(245, 158, 11, 0.22) !important;
}

html.dark #classroomsLobbyView h2,
html.dark #classroomsLobbyView h3,
body.dark-theme #classroomsLobbyView h2,
body.dark-theme #classroomsLobbyView h3 {
  color: #fff8eb !important;
  -webkit-text-fill-color: #fff8eb !important;
}

html.dark #classroomsLobbyView p,
body.dark-theme #classroomsLobbyView p {
  color: #cbd5e1 !important;
}

html.dark #classroomsTotalCountBadge,
body.dark-theme #classroomsTotalCountBadge {
  background: rgba(245, 158, 11, 0.16) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  color: #fde68a !important;
}

html.dark #classroomsSearchInput,
html.dark #membersSearchInput,
body.dark-theme #classroomsSearchInput,
body.dark-theme #membersSearchInput {
  background: #16241c !important;
  border: 1px solid rgba(245, 158, 11, 0.32) !important;
  color: #fff8eb !important;
}

html.dark #classroomsSearchInput::placeholder,
html.dark #membersSearchInput::placeholder {
  color: #86a394 !important;
}

html.dark #classroomsLobbyView #classroomsGridContainer > div.classroom-lobby-card,
html.dark #classroomsLobbyView .classroom-lobby-card,
html.dark .classroom-lobby-card,
html.dark #classroomsLobbyView .grid > div,
body.dark-theme #classroomsLobbyView .classroom-lobby-card,
body.dark-theme .classroom-lobby-card {
  background: linear-gradient(165deg, rgba(20, 35, 27, 0.96) 0%, rgba(13, 24, 18, 0.98) 100%) !important;
  border: 1px solid rgba(245, 158, 11, 0.28) !important;
  border-radius: 1rem !important;
  box-shadow: 0 10px 24px -6px rgba(0, 0, 0, 0.55) !important;
  color: #cbd5e1 !important;
  overflow: hidden !important;
}

html.dark .classroom-lobby-card:hover,
body.dark-theme .classroom-lobby-card:hover {
  background: linear-gradient(165deg, rgba(25, 44, 34, 0.98) 0%, rgba(16, 30, 22, 0.99) 100%) !important;
  border-color: rgba(251, 191, 36, 0.55) !important;
  box-shadow: 0 14px 28px -6px rgba(0, 0, 0, 0.72), 0 0 18px rgba(245, 158, 11, 0.16) !important;
}

html.dark .classroom-lobby-card h3,
html.dark .classroom-lobby-card .font-black,
body.dark-theme .classroom-lobby-card h3,
body.dark-theme .classroom-lobby-card .font-black {
  color: #fff8eb !important;
  -webkit-text-fill-color: #fff8eb !important;
}

html.dark .classroom-lobby-card:hover h3,
body.dark-theme .classroom-lobby-card:hover h3 {
  color: #fde68a !important;
  -webkit-text-fill-color: #fde68a !important;
}

html.dark .classroom-lobby-card span,
body.dark-theme .classroom-lobby-card span {
  color: #e2e8f0 !important;
}

html.dark .classroom-lobby-card .text-amber-300,
html.dark .classroom-lobby-card .text-amber-300\/80,
html.dark .classroom-lobby-card .text-amber-300\/80 span,
body.dark-theme .classroom-lobby-card .text-amber-300,
body.dark-theme .classroom-lobby-card .text-amber-300\/80,
body.dark-theme .classroom-lobby-card .text-amber-300\/80 span {
  color: #fcd34d !important;
}

html.dark .classroom-lobby-card .text-slate-400,
html.dark .classroom-lobby-card .text-slate-400\/80,
html.dark .classroom-lobby-card .text-slate-500,
html.dark .classroom-lobby-card p,
body.dark-theme .classroom-lobby-card .text-slate-400,
body.dark-theme .classroom-lobby-card .text-slate-400\/80,
body.dark-theme .classroom-lobby-card .text-slate-500,
body.dark-theme .classroom-lobby-card p {
  color: #cbd5e1 !important;
}

html.dark .classroom-lobby-card span.bg-amber-400\/20,
body.dark-theme .classroom-lobby-card span.bg-amber-400\/20 {
  background: rgba(16, 185, 129, 0.18) !important;
  border: 1px solid rgba(52, 211, 153, 0.36) !important;
  color: #6ee7b7 !important;
}

html.dark .classroom-lobby-card .pryaska-card-actions {
  border-top: none !important;
}

html.dark .classroom-lobby-card .pryaska-enter-arrow,
html.dark .classroom-lobby-card button[onclick*="openCreateClassroomModal"],
html.dark .classroom-lobby-card button[onclick*="deleteClassroom"] {
  background: rgba(26, 44, 34, 0.94) !important;
  border: 1px solid rgba(245, 158, 11, 0.32) !important;
  color: #fde68a !important;
}

html.dark .classroom-lobby-card:hover .pryaska-enter-arrow {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%) !important;
  color: #261204 !important;
}

/* 4. MEMBERS SIDEBAR (#membersSidebar & #classroomMembersSidebar) */
html.dark #membersSidebar,
html.dark #classroomMembersSidebar,
body.dark-theme #membersSidebar,
body.dark-theme #classroomMembersSidebar {
  background: linear-gradient(180deg, rgba(16, 27, 21, 0.98) 0%, rgba(11, 19, 15, 0.98) 100%) !important;
  border-color: rgba(245, 158, 11, 0.24) !important;
  color: #fff8eb !important;
}

html.dark #membersSidebar h3,
html.dark #membersSidebar h4 {
  color: #fff8eb !important;
}

html.dark #membersSidebarCount {
  background: rgba(245, 158, 11, 0.16) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  color: #fde68a !important;
}

html.dark #membersSidebar .border-b {
  border-color: rgba(245, 158, 11, 0.20) !important;
}

html.dark #membersSidebar #tabMemberAll,
html.dark #membersSidebar #tabMemberStudents,
html.dark #membersSidebar #tabMemberAdmins,
html.dark #membersSidebar .bg-slate-950\/60,
html.dark #membersSidebar .bg-slate-950\/40,
html.dark #membersSidebar .bg-slate-800\/90 {
  background: rgba(22, 36, 28, 0.94) !important;
  border: 1px solid rgba(245, 158, 11, 0.25) !important;
  color: #fef3c7 !important;
}

html.dark #membersSidebar #tabMemberAll.bg-indigo-600,
html.dark #membersSidebar #tabMemberStudents.bg-indigo-600,
html.dark #membersSidebar #tabMemberAdmins.bg-indigo-600 {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  border-color: rgba(254, 243, 199, 0.4) !important;
  color: #261204 !important;
}

html.dark #membersListContainer > div {
  background: rgba(22, 36, 28, 0.94) !important;
  border: 1px solid rgba(245, 158, 11, 0.24) !important;
  color: #fff8eb !important;
}

html.dark #membersListContainer > div:hover {
  background: rgba(28, 46, 36, 0.98) !important;
  border-color: rgba(245, 158, 11, 0.48) !important;
}

html.dark #membersListContainer > div .font-bold,
html.dark #membersListContainer > div .font-black {
  color: #fff8eb !important;
}

html.dark #membersListContainer > div .text-slate-400,
html.dark #membersListContainer > div .text-slate-500 {
  color: #a7bfae !important;
}

html.dark .badge-student {
  background: rgba(16, 185, 129, 0.16) !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
  color: #6ee7b7 !important;
}

html.dark .badge-student-girl {
  background: rgba(244, 63, 94, 0.16) !important;
  border-color: rgba(251, 113, 133, 0.35) !important;
  color: #fda4af !important;
}

html.dark .star-badge {
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: rgba(245, 158, 11, 0.38) !important;
  color: #fde68a !important;
}

/* 5. PODIUM, BANNERS, CHAT BUBBLES, POLLS & INPUT BAR */
html.dark #topPodiumWidget,
html.dark #notificationPermissionBanner,
html.dark #nightCurfewBanner,
html.dark #chatSearchBar,
html.dark #chatSearchResultsDropdown,
html.dark #recordingBar,
html.dark #dreamVoiceRecordingBar,
html.dark #privateRecordingBar,
html.dark #imagePreviewBar,
html.dark #chatLockBanner,
html.dark #chatReplyPreviewBar {
  background: rgba(16, 27, 21, 0.96) !important;
  background-image: none !important;
  border-color: rgba(245, 158, 11, 0.25) !important;
  color: #fff8eb !important;
}

html.dark #togglePodiumBtn,
html.dark #topPodiumWidget button[onclick="openLeaderboardModal()"] {
  background: rgba(24, 39, 31, 0.95) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #fde68a !important;
}

html.dark #topPodiumWidget #podiumItems,
html.dark #topPodiumWidget #podiumItems span,
html.dark #notificationPermissionBanner p,
html.dark #nightCurfewBanner span {
  color: #e2e8f0 !important;
}

html.dark #chatSearchInput,
html.dark #chatInputBar input,
html.dark #chatInputBar textarea,
html.dark #messageInput,
html.dark #customGroupTextInput {
  background: #16241c !important;
  border-color: rgba(245, 158, 11, 0.34) !important;
  color: #fff8eb !important;
}

html.dark #messageInput::placeholder,
html.dark #customGroupTextInput::placeholder,
html.dark #chatSearchInput::placeholder {
  color: #86a394 !important;
}

html.dark #chatInputBar,
html.dark #customGroupInputBar,
html.dark [id$="ChatInputBar"] {
  background: rgba(14, 23, 18, 0.96) !important;
  background-image: none !important;
  border-top: 1px solid rgba(245, 158, 11, 0.24) !important;
  color: #fff8eb !important;
}

html.dark #chatInputBar form,
html.dark #customGroupInputBar form {
  background: rgba(22, 36, 28, 0.98) !important;
  border: 1.5px solid rgba(245, 158, 11, 0.34) !important;
}

html.dark #chatInputBar #publicChatToolsBtn,
html.dark #customGroupToolsBtn {
  background: rgba(28, 46, 36, 0.95) !important;
  border: 1px solid rgba(245, 158, 11, 0.38) !important;
  color: #fbbf24 !important;
}

html.dark #publicChatToolsMenu,
html.dark #customGroupToolsMenu,
html.dark [id^="reaction-picker-"] {
  background: rgba(18, 29, 23, 0.98) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  color: #fff8eb !important;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.8) !important;
}

html.dark #publicChatToolsMenu button,
html.dark #customGroupToolsMenu button {
  color: #fef3c7 !important;
}

/* Others' & Teacher Chat Bubbles */
html.dark .chat-msg-item [id^="msg-bubble-"]:not(.from-indigo-600),
html.dark .chat-msg-item .bg-slate-800\/90,
html.dark .chat-msg-item .bg-slate-800,
html.dark .chat-msg-item .bg-slate-900\/95,
html.dark .chat-msg-item .bg-slate-900,
html.dark [id^="msg-"] .max-w-xl.rounded-3xl:not(.from-indigo-600) {
  background: linear-gradient(166deg, rgba(22, 36, 28, 0.98) 0%, rgba(15, 25, 20, 0.97) 100%) !important;
  border: 1px solid rgba(245, 158, 11, 0.28) !important;
  color: #f8fafc !important;
  box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.6) !important;
}

/* Poll, Alarm, Attendance, Question Cards */
html.dark div.poll-card,
html.dark div[id^="poll-card-"],
html.dark div.alarm-card,
html.dark div[id^="alarm-card-"],
html.dark .question-glow,
html.dark .revealed-answers-card,
html.dark .attendance-card,
html.dark [data-attendance-session] > div {
  background: linear-gradient(165deg, rgba(20, 34, 26, 0.98) 0%, rgba(14, 23, 18, 0.97) 100%) !important;
  border: 1px solid rgba(245, 158, 11, 0.34) !important;
  color: #fff8eb !important;
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.7) !important;
}

html.dark [id^="poll-card-"] h3,
html.dark [id^="poll-card-"] h4,
html.dark [id^="alarm-card-"] h3,
html.dark [id^="alarm-card-"] h4,
html.dark .question-glow h3,
html.dark .question-glow h4,
html.dark .revealed-answers-card h3 {
  color: #fff8eb !important;
}

html.dark [id^="poll-card-"] span,
html.dark [id^="poll-card-"] p,
html.dark [id^="alarm-card-"] span,
html.dark [id^="alarm-card-"] p,
html.dark .question-glow p,
html.dark .revealed-answers-card p {
  color: #e2e8f0 !important;
}

html.dark [id^="poll-card-"] .relative.overflow-hidden.rounded-2xl,
html.dark [id^="alarm-card-"] .bg-slate-950\/80,
html.dark [id^="alarm-timer-box-"] > div {
  background: rgba(14, 23, 18, 0.95) !important;
  border: 1px solid rgba(245, 158, 11, 0.28) !important;
  color: #fff8eb !important;
}

/* 6. MAIN MENU DRAWER PANEL (#mainMenuDrawerPanel) */
html.dark #mainMenuDrawerPanel,
body.dark-theme #mainMenuDrawerPanel,
body.dark-mode #mainMenuDrawerPanel {
  background: linear-gradient(180deg, rgba(16, 27, 21, 0.99) 0%, rgba(10, 18, 14, 0.99) 100%) !important;
  border-left: 1px solid rgba(245, 158, 11, 0.28) !important;
  color: #fff8eb !important;
}

html.dark #mainMenuDrawerPanel > div:first-child {
  background: rgba(12, 21, 16, 0.96) !important;
  border-bottom: 1px solid rgba(245, 158, 11, 0.22) !important;
}

html.dark #mainMenuDrawerPanel h3,
html.dark #mainMenuDrawerPanel h4,
html.dark #mainMenuDrawerPanel #drawerUserName {
  color: #fff8eb !important;
}

html.dark #mainMenuDrawerPanel p {
  color: #a7bfae !important;
}

html.dark #mainMenuDrawerPanel div[onclick*="openMyProfile"] {
  background: rgba(22, 36, 28, 0.94) !important;
  border: 1px solid rgba(245, 158, 11, 0.30) !important;
}

html.dark #drawerUserRoleBadge {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

html.dark #drawerUserRoleBadge:empty,
html.dark #headerRoleBadge:empty {
  display: none !important;
}

html.dark #drawerCustomGroupsSection,
body.dark-theme #drawerCustomGroupsSection,
body.dark-mode #drawerCustomGroupsSection {
  background: rgba(18, 30, 23, 0.88) !important;
  border: 1px solid rgba(245, 158, 11, 0.24) !important;
  border-radius: 1.1rem !important;
  padding: 0.8rem 0.85rem !important;
  box-shadow: none !important;
}

html.dark #drawerCustomGroupsSection > div:first-child > span,
html.dark #drawerCustomGroupsSection > div:first-child > span span,
body.dark-theme #drawerCustomGroupsSection > div:first-child > span {
  color: #fef3c7 !important;
}

html.dark #drawerCustomGroupsSection > div:first-child > span i {
  color: #fbbf24 !important;
}

html.dark #drawerCustomGroupsSection #drawerCreateGroupBtn,
body.dark-theme #mainMenuDrawerPanel .overflow-y-auto #drawerCreateGroupBtn {
  background: rgba(245, 158, 11, 0.16) !important;
  border: 1px solid rgba(245, 158, 11, 0.38) !important;
  color: #fde68a !important;
  border-radius: 0.85rem !important;
  padding: 0.35rem 0.75rem !important;
}

html.dark #drawerCustomGroupsSection #drawerCreateGroupBtn span,
html.dark #drawerCustomGroupsSection #drawerCreateGroupBtn i {
  color: #fde68a !important;
}

html.dark #drawerCustomGroupsList p {
  color: #a7bfae !important;
}

html.dark #mainMenuDrawerPanel button[onclick="closeMainMenuDrawer()"] {
  background: rgba(24, 39, 30, 0.94) !important;
  border: 1px solid rgba(245, 158, 11, 0.32) !important;
  color: #fef3c7 !important;
}

html.dark #mainMenuDrawerPanel .drawer-tool-btn,
html.dark #mainMenuDrawerPanel #drawerDreamAdminBtn,
html.dark #mainMenuDrawerPanel #drawerDreamPostsManageBtn,
html.dark #mainMenuDrawerPanel #drawerArticlesAdminBtn,
html.dark #mainMenuDrawerPanel .overflow-y-auto button:not(#drawerCreateGroupBtn):not([onclick*="logout"]):not([onclick*="Logout"]) {
  background: rgba(22, 36, 28, 0.94) !important;
  background-image: none !important;
  border: 1px solid rgba(245, 158, 11, 0.26) !important;
  color: #fff8eb !important;
}

html.dark #mainMenuDrawerPanel .drawer-tool-btn:hover,
html.dark #mainMenuDrawerPanel #drawerDreamAdminBtn:hover,
html.dark #mainMenuDrawerPanel #drawerDreamPostsManageBtn:hover,
html.dark #mainMenuDrawerPanel #drawerArticlesAdminBtn:hover {
  background: rgba(30, 48, 38, 0.98) !important;
  background-image: none !important;
  border-color: rgba(245, 158, 11, 0.55) !important;
}

html.dark #mainMenuDrawerPanel .drawer-tool-title {
  color: #fff8eb !important;
}

html.dark #mainMenuDrawerPanel .drawer-tool-icon-box {
  background: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(245, 158, 11, 0.30) !important;
  color: #fbbf24 !important;
}

html.dark #mainMenuDrawerPanel .drawer-tool-badge,
html.dark #drawerNotificationStatusBadge,
html.dark #drawerAllChatNotificationBadge {
  background: rgba(245, 158, 11, 0.16) !important;
  border: 1px solid rgba(245, 158, 11, 0.32) !important;
  color: #fde68a !important;
}

html.dark #drawerSettingsSection,
html.dark #drawerSettingsList,
html.dark #drawerSettingsSection .bg-slate-900\/60,
html.dark #drawerSettingsList .bg-slate-900\/60 {
  background: rgba(16, 27, 21, 0.95) !important;
  border-color: rgba(245, 158, 11, 0.24) !important;
}

html.dark #mainMenuDrawerPanel > div.border-t {
  background: rgba(12, 21, 16, 0.96) !important;
  border-top: 1px solid rgba(245, 158, 11, 0.22) !important;
}

html.dark #mainMenuDrawerPanel button[onclick*="handleLogout"] {
  background: rgba(190, 18, 60, 0.22) !important;
  border-color: rgba(244, 63, 94, 0.45) !important;
  color: #fecdd3 !important;
}
html.dark #mainMenuDrawerPanel button[onclick*="handleLogout"]:hover {
  background: #e11d48 !important;
  color: #ffffff !important;
}

/* 7. ALL INSIDE MODALS & SPLIT-PANEL CHATS IN DARK MODE */
html.dark div[id$="Modal"]:not(#authScreen):not(#imageZoomModal):not(#logoPopupModal) > div:not(.absolute.inset-0),
html.dark #authScreen .auth-royal-card,
html.dark #dreamDirectPromptModal > div,
html.dark #dreamChatModal > div {
  background: linear-gradient(166deg, rgba(19, 32, 25, 0.99) 0%, rgba(12, 21, 16, 0.98) 100%) !important;
  background-image: linear-gradient(166deg, rgba(19, 32, 25, 0.99) 0%, rgba(12, 21, 16, 0.98) 100%) !important;
  border-color: rgba(245, 158, 11, 0.34) !important;
  color: #fff8eb !important;
}

html.dark div[id$="Modal"] > div > div:first-child,
html.dark div[id$="Modal"] [class*="bg-gradient-to-r"][class*="border-b"],
html.dark #dreamChatModal > div > div:first-child {
  background: rgba(14, 23, 18, 0.96) !important;
  border-color: rgba(245, 158, 11, 0.24) !important;
  color: #fff8eb !important;
}

html.dark div[id$="Modal"] h2,
html.dark div[id$="Modal"] h3,
html.dark div[id$="Modal"] h4,
html.dark #authScreen h1,
html.dark #authScreen h2 {
  color: #fff8eb !important;
  -webkit-text-fill-color: #fff8eb !important;
}

html.dark div[id$="Modal"] p,
html.dark div[id$="Modal"] label,
html.dark #authScreen label,
html.dark #authScreen p {
  color: #cbd5e1 !important;
}

html.dark div[id$="Modal"] input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html.dark div[id$="Modal"] textarea,
html.dark div[id$="Modal"] select,
html.dark #authScreen input,
html.dark #dreamChatModal #dreamTextInput,
html.dark #dreamDirectPromptModal #directDreamerName {
  background: #16241c !important;
  border-color: rgba(245, 158, 11, 0.32) !important;
  color: #fff8eb !important;
}

html.dark #dreamChatModal #dreamMessagesContainer {
  background: #0e1713 !important;
}

html.dark #dreamAdminModal > div > div > aside,
html.dark #dreamAdminModal #dreamAdminSessionsSidebar,
html.dark #dreamSubmissionsSidebar,
html.dark #dreamSubmissionsSidebar > div,
html.dark #dreamAdminSessionsSidebar > div,
html.dark #libraryModal > div,
html.dark #recordedLessonsModal > div,
html.dark #liveLessonModal .bg-slate-950\/95,
html.dark #liveLessonModal #liveParticipantsList,
html.dark #liveLessonModal .live-action-dock {
  background: rgba(16, 27, 21, 0.98) !important;
  background-image: none !important;
  border-color: rgba(245, 158, 11, 0.26) !important;
  color: #fff8eb !important;
}

html.dark #dreamSessionsList > div,
html.dark .dream-session-item,
html.dark .dream-submission-card,
html.dark #aiSecurityModal .grid > div,
html.dark #activityDatabaseModal [class*="rounded-2xl"] {
  background: rgba(22, 36, 28, 0.95) !important;
  border-color: rgba(245, 158, 11, 0.26) !important;
  color: #fff8eb !important;
}

/* 8. COMPLETE HERITAGE-LIGHT-OVERRIDE COUNTERMEASURES FOR DARK MODE
   Covers every modal subcard, list item, split-panel chat, profile card,
   library, recorded lessons, leaderboard, questions bank & admin tabs! */
html.dark div[id$="Modal"] :is(
  [class*="from-purple-950"],
  [class*="from-rose-950"],
  [class*="from-amber-950"],
  [class*="from-cyan-950"],
  [class*="from-sky-950"],
  [class*="from-teal-950"],
  [class*="from-indigo-950"],
  [class*="from-slate-9"],
  [class*="via-slate-9"],
  [class*="via-indigo-950"],
  [class*="via-amber-950"],
  [class*="via-rose-950"],
  [class*="via-teal-950"],
  [class*="bg-purple-950"],
  [class*="bg-sky-950"],
  [class*="bg-rose-950"],
  [class*="bg-cyan-950"]
):not(.fixed.inset-0):not(video):not([class*="bg-rose-6"]):not([class*="bg-emerald-6"]),
body.dark-theme div[id$="Modal"] :is(
  [class*="from-purple-950"],
  [class*="from-rose-950"],
  [class*="from-amber-950"],
  [class*="from-cyan-950"],
  [class*="from-sky-950"],
  [class*="from-teal-950"],
  [class*="from-indigo-950"],
  [class*="from-slate-9"],
  [class*="via-slate-9"],
  [class*="via-indigo-950"],
  [class*="via-amber-950"],
  [class*="via-rose-950"],
  [class*="via-teal-950"],
  [class*="bg-purple-950"],
  [class*="bg-sky-950"],
  [class*="bg-rose-950"],
  [class*="bg-cyan-950"]
):not(.fixed.inset-0):not(video):not([class*="bg-rose-6"]):not([class*="bg-emerald-6"]) {
  background-color: #13221a !important;
  background-image: linear-gradient(166deg, rgba(22, 36, 28, 0.98) 0%, rgba(13, 22, 17, 0.98) 100%) !important;
  border-color: rgba(245, 158, 11, 0.28) !important;
  color: #fff8eb !important;
}

/* Profile Modal Inner Cards & Badges */
html.dark #profRegularStatsGrid > div,
html.dark #profStarsBox,
html.dark #profPublishDreamPostContainer,
html.dark #profPublishPoemContainer,
html.dark #profStarsAdjustContainer,
html.dark #profSpecialBadgeAdminCard,
html.dark #profBadgesOverviewCard,
html.dark #profCoursesViewCard,
html.dark #profCoursesEditCard,
html.dark #profNotificationContainer,
html.dark #badgeBtnBlue,
html.dark #badgeBtnRed,
html.dark #badgeBtnPurple,
body.dark-theme #profRegularStatsGrid > div,
body.dark-theme #profStarsBox,
body.dark-theme #profPublishDreamPostContainer,
body.dark-theme #profPublishPoemContainer,
body.dark-theme #profStarsAdjustContainer,
body.dark-theme #profSpecialBadgeAdminCard,
body.dark-theme #profBadgesOverviewCard,
body.dark-theme #profCoursesViewCard,
body.dark-theme #profCoursesEditCard,
body.dark-theme #profNotificationContainer,
body.dark-theme #badgeBtnBlue,
body.dark-theme #badgeBtnRed,
body.dark-theme #badgeBtnPurple {
  background: linear-gradient(166deg, rgba(22, 36, 28, 0.96) 0%, rgba(14, 24, 18, 0.96) 100%) !important;
  background-image: linear-gradient(166deg, rgba(22, 36, 28, 0.96) 0%, rgba(14, 24, 18, 0.96) 100%) !important;
  border-color: rgba(245, 158, 11, 0.28) !important;
  color: #fff8eb !important;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.55) !important;
}

html.dark #userProfileModalDialog .prof-section-card span,
html.dark #userProfileModalDialog .prof-inset-tile span,
html.dark #userProfileModalDialog .prof-stat-tile span,
html.dark #profCoursesRowsList > div {
  color: #fef3c7 !important;
}

html.dark #userProfileModalDialog .prof-section-card .opacity-75,
html.dark #userProfileModalDialog .prof-inset-tile .opacity-75 {
  color: #cbd5e1 !important;
  opacity: 0.9 !important;
}

/* Admin Panel Sub-Tabs & User Lists */
html.dark .admin-subtab-tile,
html.dark #adminModal .admin-subtab-tile,
html.dark #pendingUsersList > div,
html.dark #allUsersList > div,
html.dark #profileChangesList > div,
html.dark #passwordResetsList > div,
html.dark #adminBackupsList > div,
body.dark-theme .admin-subtab-tile,
body.dark-theme #adminModal .admin-subtab-tile,
body.dark-theme #pendingUsersList > div,
body.dark-theme #allUsersList > div,
body.dark-theme #profileChangesList > div,
body.dark-theme #passwordResetsList > div,
body.dark-theme #adminBackupsList > div {
  background: linear-gradient(166deg, rgba(22, 36, 28, 0.96) 0%, rgba(14, 24, 18, 0.96) 100%) !important;
  border-color: rgba(245, 158, 11, 0.28) !important;
  color: #fff8eb !important;
}

html.dark .admin-subtab-tile:hover,
html.dark #adminModal .admin-subtab-tile:hover {
  background: rgba(30, 48, 38, 0.98) !important;
  border-color: rgba(245, 158, 11, 0.52) !important;
  color: #fde68a !important;
}

html.dark .admin-subtab-tile.active,
html.dark #adminModal .admin-subtab-tile.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #261204 !important;
}
html.dark .admin-subtab-tile.active *,
html.dark .admin-subtab-tile.active .admin-tile-label {
  color: #261204 !important;
  -webkit-text-fill-color: #261204 !important;
}

/* Library, Recorded Lessons, Leaderboard, Questions Archive */
html.dark #libraryModal .library-book-card,
html.dark #recordedLessonsModal .lesson-card,
html.dark #recordedLessonsModal .folder-card,
html.dark #leaderboardList > div,
html.dark #questionsArchiveList > div,
body.dark-theme #libraryModal .library-book-card,
body.dark-theme #recordedLessonsModal .lesson-card,
body.dark-theme #recordedLessonsModal .folder-card,
body.dark-theme #leaderboardList > div,
body.dark-theme #questionsArchiveList > div {
  background: linear-gradient(166deg, rgba(22, 36, 28, 0.96) 0%, rgba(14, 24, 18, 0.96) 100%) !important;
  border-color: rgba(245, 158, 11, 0.28) !important;
  color: #fff8eb !important;
}

html.dark #libraryModal .library-book-card *,
html.dark #recordedLessonsModal .lesson-card *,
html.dark #recordedLessonsModal .folder-card *,
html.dark #leaderboardList > div *,
html.dark #questionsArchiveList > div * {
  border-color: rgba(245, 158, 11, 0.20);
}

/* Split-Panel Chats, Voice Bars & Live Lesson Stage */
html.dark #customGroupMessagesContainer,
html.dark #privateChatMessagesContainer,
html.dark #dreamAdminMessagesContainer,
html.dark #aiAdvisorMessagesContainer,
body.dark-theme #customGroupMessagesContainer,
body.dark-theme #privateChatMessagesContainer,
body.dark-theme #dreamAdminMessagesContainer,
body.dark-theme #aiAdvisorMessagesContainer {
  background: #0e1713 !important;
}

html.dark #dreamSessionsList > div.bg-purple-950\/70,
html.dark #dreamSessionsList > div.ring-1 {
  background: linear-gradient(145deg, rgba(30, 50, 39, 0.98) 0%, rgba(20, 34, 26, 0.98) 100%) !important;
  border-color: rgba(251, 191, 36, 0.6) !important;
  color: #fff8eb !important;
}

html.dark #customGroupVoiceRecordSection,
html.dark #dreamAdminVoiceBar,
html.dark #customGroupAdvisorTyping {
  background: rgba(22, 36, 28, 0.96) !important;
  border-top-color: rgba(245, 158, 11, 0.28) !important;
  color: #fde68a !important;
}

html.dark #liveLessonModal #liveParticipantsList,
html.dark #liveLessonModal .flex-1.bg-slate-950\/95 {
  background-color: #0b1410 !important;
  background-image: none !important;
  color: #fff8eb !important;
}

/* Executive Hub, Complaints, Activity DB, Poems Modal */
html.dark #executiveHubModal .bg-slate-800,
html.dark #executiveHubModal .bg-slate-800\/50,
html.dark #executiveHubModal .bg-slate-900\/80,
html.dark #complaintsModal .bg-slate-800\/60,
html.dark #activityDatabaseModal .bg-slate-800\/60 {
  background: linear-gradient(166deg, rgba(22, 36, 28, 0.96) 0%, rgba(14, 24, 18, 0.96) 100%) !important;
  border-color: rgba(245, 158, 11, 0.28) !important;
  color: #fff8eb !important;
}

/* Members Sidebar Segmented Tab Bar & Controls in Dark Mode */
html.dark #membersSidebar > div:nth-child(2) {
  background: rgba(14, 23, 18, 0.92) !important;
  border-color: rgba(245, 158, 11, 0.24) !important;
}

html.dark #membersSidebar > div:first-child {
  background: rgba(14, 23, 18, 0.95) !important;
  border-bottom-color: rgba(245, 158, 11, 0.22) !important;
}

html.dark #membersListContainer > div .w-9.h-9.rounded-xl {
  background: linear-gradient(145deg, #1b2f24 0%, #111f17 100%) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #fbbf24 !important;
}

/* Modal Close Buttons & Header Buttons in Dark Mode */
html.dark div[id$="Modal"] button[onclick*="close"]:not([class*="from-amber-"]):not([class*="from-emerald-"]):not([class*="from-rose-"]) {
  background: rgba(24, 39, 30, 0.92) !important;
  border-color: rgba(245, 158, 11, 0.30) !important;
  color: #fde68a !important;
}

/* Top Podium Ribbon in Dark Mode */
html.dark #topPodiumWidget {
  background: linear-gradient(180deg, rgba(16, 27, 21, 0.98) 0%, rgba(12, 21, 16, 0.98) 100%) !important;
  border-bottom-color: rgba(245, 158, 11, 0.24) !important;
  color: #fff8eb !important;
}

/* Ensure modals with hardcoded light bg-[#fbf7f0] / text-amber-950 stay readable in Dark Mode */
html.dark div[id$="Modal"] .bg-\[\#fbf7f0\],
html.dark div[id$="Modal"] .bg-\[\#f5ead9\],
html.dark div[id$="Modal"] .bg-\[\#f4e9d8\] {
  background: rgba(22, 36, 28, 0.96) !important;
  color: #fff8eb !important;
}

html.dark div[id$="Modal"] .text-\[\#361c0c\],
html.dark div[id$="Modal"] .text-\[\#54371f\],
html.dark div[id$="Modal"] .text-amber-950,
html.dark div[id$="Modal"] .text-slate-900,
html.dark div[id$="Modal"] .text-slate-950 {
  color: #fff8eb !important;
}

/* Dream Management Top Header in Dark Mode */
html.dark #dreamAdminModalHeader {
  background: linear-gradient(165deg, rgba(16, 27, 21, 0.98) 0%, rgba(11, 19, 15, 0.98) 100%) !important;
  border-bottom: 1px solid rgba(245, 158, 11, 0.24) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45) !important;
}

html.dark #dreamAdminModalHeader #dreamDownloadAllAudioBtn,
html.dark #dreamAdminModalHeader #dreamPublicPostsLinkBtn,
html.dark #dreamAdminModalHeader #dreamAdminCloseBtn {
  background: rgba(24, 39, 31, 0.95) !important;
  border: 1px solid rgba(245, 158, 11, 0.30) !important;
  color: #fef3c7 !important;
}

html.dark #dreamAdminModalHeader #dreamPublicPostsLinkBtn i,
html.dark #dreamAdminModalHeader #dreamDownloadAllAudioBtn i {
  color: #fbbf24 !important;
}

html.dark #dreamAdminModalHeader #dreamAdminCloseBtn:hover {
  background: rgba(239, 68, 68, 0.20) !important;
  border-color: rgba(248, 113, 113, 0.45) !important;
  color: #fecaca !important;
}
