/* ==========================================================================
   Educator Command Center Design Tokens & Layout System
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-dark: #0B0F19;
  --bg-card: rgba(21, 30, 46, 0.75);
  --border-card: rgba(34, 47, 71, 0.6);
  --text-primary: #F3F4F6;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  
  --primary: #6366F1;       /* Indigo Glow */
  --primary-hover: #4F46E5;
  --primary-light: rgba(99, 102, 241, 0.15);
  
  --secondary: #06B6D4;     /* Cyan Info */
  --secondary-light: rgba(6, 182, 212, 0.15);

  --success: #10B981;       /* Emerald Green */
  --success-light: rgba(16, 185, 129, 0.15);
  
  --warning: #F59E0B;       /* Amber Alert */
  --warning-light: rgba(245, 158, 11, 0.15);

  --danger: #EF4444;        /* Crimson Red */
  --danger-light: rgba(239, 68, 68, 0.15);

  --sidebar-width: 280px;
  --topbar-height: 80px;

  /* Typography */
  --font-display: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Reset & Base Elements */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
}

body.auth-mode {
  justify-content: center;
  align-items: center;
  background-image: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
                    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 45%);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
  background: var(--border-card);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Base Classes */
.bg-glass {
  background-color: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.w-65 { width: calc(65% - 12px); }
.w-35 { width: calc(35% - 12px); }
.border-none { border: none !important; }
.p-0 { padding: 0 !important; }

/* ==========================================================================
   AUTHENTICATION CARD STYLING
   ========================================================================== */

.login-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 20px;
  z-index: 1;
}

.login-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 60%);
  opacity: 0.15;
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
}

.login-card {
  background: rgba(21, 30, 46, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-logo {
  text-align: center;
  margin-bottom: 35px;
}

.logo-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 16px;
  font-size: 24px;
  color: white;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.login-logo h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.5px;
}

.login-logo p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.input-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.input-wrapper {
  position: relative;
}

.input-wrapper i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
  transition: color 0.3s;
}

.form-control,
.input-wrapper input {
  width: 100%;
  height: 48px;
  background-color: rgba(11, 15, 25, 0.6);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 0 16px;
  color: white;
  font-size: 14px;
  transition: all 0.3s;
}

.input-wrapper input {
  padding-left: 48px;
}

textarea.form-control {
  height: auto;
  padding: 12px 16px;
  resize: vertical;
}

.form-control:focus,
.input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  background-color: rgba(11, 15, 25, 0.9);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Button UI */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background-color: rgba(34, 47, 71, 0.4);
  color: var(--text-primary);
  border: 1px solid var(--border-card);
}

.btn-secondary:hover {
  background-color: rgba(34, 47, 71, 0.8);
  border-color: var(--text-muted);
}

.btn-danger {
  background-color: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background-color: var(--danger);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
}

/* Mode toggles */
.toggle-mode-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-card);
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.toggle-mode-label span {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.toggle-mode-label small {
  color: var(--text-secondary);
  font-size: 11px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border: 1px solid var(--border-card);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
}

.login-footer p {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   MAIN DASHBOARD WRAPPER LAYOUT
   ========================================================================== */

/* Splash Screen Styles */
.splash-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-dark);
  background-image: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
                    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 45%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.4s ease;
}

.splash-card {
  text-align: center;
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.splash-card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  margin-top: 20px;
}

.splash-card p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 8px;
}

.splash-spinner {
  margin-top: 30px;
  font-size: 32px;
  color: var(--primary);
}

/* Visibility toggling based on body classes */
body.loading-mode #splash-screen { display: flex; }
body.loading-mode #login-container { display: none; }
body.loading-mode #dashboard-layout { display: none; }

body.auth-mode #splash-screen { display: none; }
body.auth-mode #login-container { display: block; }
body.auth-mode #dashboard-layout { display: none; }

body:not(.auth-mode):not(.loading-mode) #splash-screen { display: none; }
body:not(.auth-mode):not(.loading-mode) #login-container { display: none; }
body:not(.auth-mode):not(.loading-mode) #dashboard-layout { display: flex; }


.dashboard-wrapper {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background-color: #080C14;
  border-right: 1px solid var(--border-card);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-card);
}

.sidebar-header .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: white;
}

.sidebar-header .logo i {
  color: var(--primary);
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5));
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  padding: 4px 8px;
  border-radius: 6px;
  margin-top: 12px;
}

.status-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--warning);
}

.status-badge .dot.live {
  background-color: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.status-badge .status-text {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex-grow: 1;
  padding: 20px 12px;
  overflow-y: auto;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.25s;
}

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.02);
  color: white;
}

.nav-item.active {
  background-color: var(--primary-light);
  color: white;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.nav-item.active i {
  color: var(--primary);
}

.sidebar-footer {
  padding: 20px 16px;
  border-top: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(0, 0, 0, 0.15);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 180px;
}

.user-profile .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
}

.user-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-meta .user-name {
  font-size: 13px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta .user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-logout {
  background-color: transparent;
  color: var(--text-secondary);
  border: none;
}

.btn-logout:hover {
  color: var(--danger);
  background-color: rgba(239, 68, 68, 0.08);
}

/* Content Canvas Area */
.content-canvas {
  flex-grow: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  padding: 0 40px;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background-color: #090E17;
}

.topbar-search {
  position: relative;
  width: 360px;
}

.topbar-search i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.topbar-search input {
  width: 100%;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding-left: 44px;
  padding-right: 16px;
  color: white;
  font-size: 13px;
}

.topbar-search input:focus {
  outline: none;
  border-color: var(--primary);
  background-color: rgba(255, 255, 255, 0.04);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.time-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-card);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Views Switches */
.content-view {
  display: none;
  flex-grow: 1;
  padding: 40px;
  overflow-y: auto;
  animation: fadeIn 0.4s ease-out;
}

.content-view.active {
  display: block;
}

.view-header {
  margin-bottom: 30px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.view-header h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: white;
}

.view-header p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.metric-card {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 22px;
}

.color-indigo { background-color: var(--primary-light); color: var(--primary); }
.color-cyan { background-color: var(--secondary-light); color: var(--secondary); }
.color-rose { background-color: var(--danger-light); color: var(--danger); }
.color-amber { background-color: var(--warning-light); color: var(--warning); }
.color-green { background-color: var(--success-light); color: var(--success); }

.metric-data {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: white;
  margin: 4px 0;
}

.metric-delta {
  font-size: 11px;
  color: var(--text-muted);
}

.metric-delta.positive {
  color: var(--success);
}

/* Charts */
.charts-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.chart-container {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.chart-header {
  margin-bottom: 20px;
}

.chart-header h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.chart-header p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.chart-wrapper {
  flex-grow: 1;
  position: relative;
  min-height: 220px;
  display: flex;
  align-items: center;
}

/* Tables Styling */
.data-table-container {
  overflow: hidden;
  padding: 24px 0;
}

.table-header {
  padding: 0 24px 16px;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-header h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-info { background-color: var(--secondary-light); color: var(--secondary); }
.badge-success { background-color: var(--success-light); color: var(--success); }
.badge-warning { background-color: var(--warning-light); color: var(--warning); }
.badge-danger { background-color: var(--danger-light); color: var(--danger); }

.table-actions {
  padding: 0 24px 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.table-actions .search-bar {
  position: relative;
  max-width: 320px;
  width: 100%;
}

.table-actions .search-bar i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.table-actions .search-bar input {
  width: 100%;
  height: 38px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding-left: 38px;
  padding-right: 14px;
  color: white;
  font-size: 12px;
}

.table-actions select {
  height: 38px;
  background-color: rgba(21, 30, 46, 0.85);
  border: 1px solid var(--border-card);
  color: white;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 14px 24px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.data-table th {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background-color: rgba(0, 0, 0, 0.1);
}

.data-table tbody tr {
  transition: background-color 0.2s;
}

.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.01);
}

.student-row-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.student-row-profile .avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.student-row-profile .info {
  display: flex;
  flex-direction: column;
}

.student-row-profile .name {
  font-weight: 600;
  color: white;
}

.student-row-profile .joined {
  font-size: 10px;
  color: var(--text-muted);
}

.action-row-buttons {
  display: flex;
  gap: 8px;
}

.btn-mini {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  height: auto;
}

/* ==========================================================================
   CHAT MODERATION SPLIT VIEW
   ========================================================================== */

.moderation-split-panel {
  display: flex;
  gap: 20px;
  height: calc(100vh - 240px);
}

.mod-batches-list {
  width: 280px;
  height: 100%;
  overflow-y: auto;
  padding: 16px 0;
  flex-shrink: 0;
}

.notice-composer {
  width: 380px;
  height: 100%;
  overflow-y: auto;
  padding: 24px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.notice-composer .panel-header {
  padding: 0 0 14px 0;
  border-bottom: 1px solid var(--border-card);
  margin-bottom: 15px;
}

.notice-composer form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.notices-table-wrapper {
  overflow-y: auto;
  flex-grow: 1;
  padding: 16px 20px;
}


.panel-header {
  padding: 0 20px 14px;
  border-bottom: 1px solid var(--border-card);
  margin-bottom: 12px;
}

.panel-header h4 {
  font-family: var(--font-display);
  font-weight: 600;
}

.interactive-list {
  list-style: none;
}

.interactive-list li {
  padding: 12px 20px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.interactive-list li:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.interactive-list li.active {
  background-color: var(--primary-light);
  border-left-color: var(--primary);
}

.interactive-list .list-title {
  font-size: 13px;
  font-weight: 600;
  color: white;
}

.interactive-list .list-sub {
  font-size: 10px;
  color: var(--text-secondary);
}

.mod-chat-viewport {
  flex-grow: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.chat-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
}

.chat-logs-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-empty-state {
  margin: auto;
  text-align: center;
  max-width: 320px;
  color: var(--text-muted);
}

.chat-empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.05);
}

.chat-empty-state p {
  font-size: 13px;
}

/* Bubble Moderation card style */
.mod-message-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: background-color 0.2s;
}

.mod-message-card:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.mod-message-card.teacher-message {
  border-left: 3px solid var(--primary);
  background-color: rgba(99, 102, 241, 0.03);
}

.mod-message-card .msg-meta {
  flex-grow: 1;
}

.mod-message-card .msg-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.mod-message-card .msg-user {
  font-size: 12px;
  font-weight: 700;
  color: white;
}

.mod-message-card .msg-time {
  font-size: 10px;
  color: var(--text-muted);
}

.mod-message-card .msg-content {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

.btn-mod-delete {
  background-color: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  align-self: center;
  transition: all 0.2s;
}

.btn-mod-delete:hover {
  color: var(--danger);
  background-color: var(--danger-light);
}

/* ==========================================================================
   COURSES CATALOG GRID
   ========================================================================== */

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.course-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.course-banner {
  height: 140px;
  background-color: rgba(0, 0, 0, 0.3);
  background-size: cover;
  background-position: center;
  position: relative;
}

.course-price-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: var(--success);
  color: white;
  font-weight: 800;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.course-info {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.course-info h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: white;
  margin-bottom: 6px;
}

.course-info p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 14px;
  flex-grow: 1;
}

.course-stats-line {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.course-actions {
  display: flex;
  gap: 8px;
}

.course-actions button {
  flex-grow: 1;
}

/* ==========================================================================
   MODAL WINDOW DIALOGS
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  background: rgba(21, 30, 46, 0.95);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  animation: modalEnter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-close-modal:hover {
  color: white;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-card);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: rgba(0, 0, 0, 0.15);
}

.input-with-button {
  display: flex;
  gap: 10px;
}

.input-with-button input {
  flex-grow: 1;
}

.student-info-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-card);
  padding: 12px 16px;
  border-radius: 12px;
}

.student-info-summary .avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.student-info-summary h4 {
  font-size: 14px;
  font-weight: 600;
}

.student-info-summary p {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ==========================================================================
   TOAST SYSTEM
   ========================================================================== */

.toast-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
  width: 100%;
}

.toast {
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  background-color: #1E293B;
  color: white;
  border-left: 4px solid var(--primary);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success { border-left-color: var(--success); }
.toast.danger { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

.toast-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-size: 14px;
}

.toast-close:hover { color: white; }

/* ==========================================================================
   KEYFRAME TRANSITIONS & ANIMATIONS
   ========================================================================== */

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

/* ==========================================================================
   RESPONSIVE DESIGN & ADAPTIVITY
   ========================================================================== */

/* Large Tablets and Small Desktops (max-width: 1024px) */
@media screen and (max-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .charts-row {
    flex-direction: column;
    gap: 24px;
  }
  
  .chart-container.w-65,
  .chart-container.w-35 {
    width: 100%;
  }

  .moderation-split-panel {
    flex-direction: column;
    height: auto;
    gap: 20px;
  }

  .mod-batches-list {
    width: 100%;
    height: 220px;
    border: 1px solid var(--border-card);
    border-radius: 12px;
  }

  .mod-chat-viewport {
    width: 100%;
    height: 500px;
  }

  .notice-composer {
    width: 100%;
    height: auto;
  }

  .notices-table-wrapper {
    padding: 10px 12px;
  }
}

/* Medium Tablets & Mobile Devices (max-width: 768px) */
@media screen and (max-width: 768px) {
  #btn-toggle-sidebar {
    display: inline-flex !important;
  }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    z-index: 999;
    height: 100%;
    width: 280px;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }

  body.sidebar-open .sidebar {
    left: 0;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(8, 12, 20, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 998;
  }

  body.sidebar-open .sidebar-overlay {
    display: block;
  }

  .topbar {
    padding: 0 20px;
    gap: 12px;
  }

  .topbar-search {
    width: 200px;
  }

  .content-view {
    padding: 24px 20px;
  }

  .view-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .view-header .btn {
    width: 100%;
  }

  /* Table Horizontal Scrolling to prevent layout breakage */
  .data-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 650px;
  }

  .modal-card {
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
  }

  .modal-body {
    overflow-y: auto;
    flex-grow: 1;
  }
}

/* Small Mobile Devices (max-width: 576px) */
@media screen and (max-width: 576px) {
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .topbar-search {
    display: none; /* Hide search bar on very small viewports to leave space for metrics/profile buttons */
  }

  .topbar-actions {
    margin-left: auto;
  }

  .time-widget {
    padding: 6px 10px;
    font-size: 11px;
  }

  .login-card {
    padding: 24px;
    border-radius: 20px;
  }

  .login-logo h1 {
    font-size: 22px;
  }

  .logo-icon {
    width: 52px;
    height: 52px;
    font-size: 20px;
  }

  .btn {
    height: 40px;
    font-size: 13px;
  }
}

/* ==========================================================================
   ENTERPRISE COMMAND CENTER STYLING
   ========================================================================== */

/* Quick Actions Panel */
.quick-actions-panel {
  margin-top: 20px;
}
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 20px;
}
.btn-quick-action {
  height: 50px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  border-radius: 12px !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  background-color: rgba(34, 47, 71, 0.3) !important;
  border: 1px solid var(--border-card) !important;
}
.btn-quick-action:hover {
  transform: translateY(-2px) !important;
  background-color: var(--primary-light) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25) !important;
}

/* Dashboard Dual Columns */
.dashboard-dual-row {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}
.schedule-card {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.schedule-card:hover {
  background-color: rgba(255, 255, 255, 0.04);
  transform: translateX(4px);
  border-color: var(--secondary);
}
.schedule-title {
  font-size: 13px;
  font-weight: 700;
  color: white;
}
.schedule-time {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.schedule-teacher {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Three-Panel Moderation Grid */
.moderation-split-panel.three-panel {
  display: grid;
  grid-template-columns: 240px 1fr 300px;
  gap: 20px;
  height: calc(100vh - 240px);
}
.mod-flagged-list {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.flagged-item-card {
  background: rgba(239, 68, 68, 0.04);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  transition: all 0.25s;
}
.flagged-item-card:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.35);
}
.flagged-sender {
  font-weight: 700;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.flagged-text {
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-word;
}
.flagged-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

/* Commerce Sub-Tabs & Form */
.sub-tabs-bar {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border-card);
  margin-bottom: 20px;
  padding-bottom: 8px;
}
.sub-tab-btn {
  height: 36px !important;
  padding: 0 16px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
  background-color: transparent !important;
  color: var(--text-secondary) !important;
  border: 1px solid transparent !important;
  font-weight: 500 !important;
}
.sub-tab-btn:hover {
  color: white !important;
  background-color: rgba(255, 255, 255, 0.02) !important;
}
.sub-tab-btn.active {
  background-color: var(--primary-light) !important;
  color: white !important;
  border-color: rgba(99, 102, 241, 0.3) !important;
  font-weight: 600 !important;
}
.subview-container {
  display: none;
}
.subview-container.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

/* Glowing Badges & Tags */
.badge-danger-glow {
  background-color: rgba(239, 68, 68, 0.12);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}
.badge-warning-glow {
  background-color: rgba(245, 158, 11, 0.12);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}
.tag-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 4px;
  margin-right: 4px;
  text-transform: uppercase;
}

/* Responsive Overrides for new elements */
@media screen and (max-width: 1200px) {
  .moderation-split-panel.three-panel {
    grid-template-columns: 220px 1fr;
  }
  .mod-flagged-list {
    display: none; /* Hide flagged queue to preserve chat viewport width */
  }
}
@media screen and (max-width: 1024px) {
  .moderation-split-panel.three-panel {
    grid-template-columns: 1fr;
    height: auto;
  }
  .mod-batches-list, .mod-chat-viewport {
    width: 100% !important;
    height: 400px !important;
  }
  .dashboard-dual-row {
    flex-direction: column;
  }
  .dashboard-dual-row .w-65, .dashboard-dual-row .w-35 {
    width: 100%;
  }
}

