@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700;900&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-color: #fafbfc; /* Creamy off-white background */
  --panel-bg: #ffffff;
  --glass-bg: #ffffff;
  --glass-border: #e8ecef;
  --glass-hover: #f5f7fa;
  --glass-active: #e8ecef;
  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --text-muted: #a0aec0;
  
  /* Macaron pastel palette */
  --primary: #a2d2ff; /* Macaron blue */
  --primary-glow: rgba(162, 210, 255, 0.2);
  --secondary: #bdb2ff; /* Macaron lavender */
  --secondary-glow: rgba(189, 178, 255, 0.2);
  --success: #bcead5; /* Macaron mint green */
  --success-glow: rgba(188, 234, 213, 0.2);
  --warning: #ffd6a5; /* Macaron peach/orange */
  --danger: #ffadad; /* Macaron pink/coral */
  
  --font-family: 'Outfit', 'Noto Sans TC', sans-serif;
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-lg: 16px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
  --box-shadow-soft: 0 4px 20px -2px rgba(148, 163, 184, 0.08), 0 2px 8px -1px rgba(148, 163, 184, 0.05);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background Glowing Orbs (Soft pastel tones for light theme) */
body::before, body::after {
  content: '';
  position: fixed;
  width: 40vw;
  height: 40vw;
  border-radius: 50%;
  z-index: -2;
  filter: blur(140px);
  pointer-events: none;
  opacity: 0.12;
}

body::before {
  top: -10vw;
  left: -10vw;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}

body::after {
  bottom: -10vw;
  right: -10vw;
  background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* General Layouts */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Glassmorphism Panel styles (Modified for light theme) */
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-soft);
}

.glass-card {
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(148, 163, 184, 0.15);
}

/* --- LOGIN PAGE --- */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  padding: 20px;
  background-color: #f1f5f9;
}

.login-card {
  width: 100%;
  max-width: 480px;
  padding: 40px;
  text-align: center;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(148, 163, 184, 0.2);
}

.logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 16px;
  margin: 0 auto 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.25);
}

.logo-icon svg {
  fill: #fff;
  width: 32px;
  height: 32px;
}

.login-card h1 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.login-card p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-field {
  width: 100%;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 15px;
  transition: var(--transition-smooth);
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-primary {
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  border-radius: var(--border-radius-md);
  color: #1e293b;
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
  filter: brightness(1.05);
}

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

.login-divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 15px;
}

.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

.login-divider span {
  padding: 0 12px;
}

.btn-secondary {
  width: 100%;
  padding: 12px 20px;
  background: #f8fafc;
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-secondary.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.btn-secondary.active:hover {
  background: var(--primary);
  filter: brightness(1.05);
}

/* --- MAIN DASHBOARD LAYOUT --- */
.sidebar {
  width: 280px;
  min-height: 100vh;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--glass-border);
  background: #ffffff;
  box-shadow: 4px 0 20px rgba(148, 163, 184, 0.05);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sidebar-logo svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  margin-bottom: 24px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  font-size: 22px !important;
  color: #fff !important;
}

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

.user-name {
  font-size: 22px !important;
  font-weight: 800 !important;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 18px !important;
  color: var(--primary);
  font-weight: 700 !important;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  color: #1e293b;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke: #1e293b;
  fill: none;
  stroke-width: 2.2;
  transition: var(--transition-smooth);
}

.nav-item:hover {
  background: var(--glass-hover);
  color: #1e293b;
}

.nav-item:hover svg {
  stroke: #1e293b;
}

.nav-item.active {
  background: rgba(2, 132, 199, 0.08);
  color: #1e293b;
}

.nav-item.active svg {
  stroke: #1e293b;
}

.sidebar-footer {
  margin-top: auto;
}

.main-content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.header-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 48px; /* space between title and selectors */
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 20px;
}

.page-title h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.page-title p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Term and Course selectors in Header */
.selector-group-header {
  display: flex;
  gap: 18px; /* wider gap between selectors */
  align-items: center;
}

.header-select {
  padding: 10px 16px; /* larger padding */
  font-size: 15px; /* larger font-size */
  font-weight: 700;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  min-width: 130px; /* larger minimum width */
}

#header-select-course {
  min-width: 170px; /* wider course selector */
}

.header-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* Tab-buttons */
.tabs-container {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 10px;
}

.tab-btn {
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-smooth);
}

.tab-btn:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--glass-hover);
  color: var(--primary);
}

/* Dashboard Views Control */
.view-section {
  display: none;
  animation: fadeIn 0.3s ease-out forwards;
}

.view-section.active {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

/* --- STUDENT: SELF & PEER EVALUATION --- */
.eval-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
  gap: 20px;
}

.form-row-responsive {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .form-row-responsive {
    grid-template-columns: 1fr;
  }
}

.btn-rating-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  flex-shrink: 0;
}
.btn-rating-num:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: #fef2f2;
}
.btn-rating-num.active {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}
@media (max-width: 600px) {
  .btn-rating-num {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
}
@media (max-width: 375px) {
  .btn-rating-num {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
}

.eval-student-card {
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 2px 8px rgba(148, 163, 184, 0.05);
}

.eval-student-card.self-card {
  border-color: #c084fc;
  background: linear-gradient(180deg, #fdf8ff 0%, #ffffff 100%);
}

.eval-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.eval-target-name {
  font-size: 17px;
  font-weight: 700;
}

.eval-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 700;
}

.eval-badge.self {
  background: rgba(124, 58, 237, 0.1);
  color: var(--secondary);
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.eval-badge.peer {
  background: rgba(2, 132, 199, 0.1);
  color: var(--primary);
  border: 1px solid rgba(2, 132, 199, 0.2);
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
}

.slider-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.slider-val {
  color: var(--primary);
  font-weight: 800;
  font-size: 15px;
}

.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e2e8f0;
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
  transition: var(--transition-smooth);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  color: var(--text-muted);
  margin-top: -2px;
}

/* Comment Box */
.comment-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.text-area {
  width: 100%;
  height: 80px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 15px;
  resize: none;
  transition: var(--transition-smooth);
}

.text-area:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px var(--secondary-glow);
}

.eval-footer-bar {
  display: flex;
  justify-content: flex-end;
  padding: 16px 0;
  border-top: 1px solid var(--glass-border);
}

/* --- ANNOUNCEMENT SCREEN (STUDENT RESULT) --- */
.status-banner {
  padding: 20px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 15px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #b45309;
}

.status-banner.success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.student-result-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .student-result-grid {
    grid-template-columns: 1fr;
  }
}

.result-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.result-card-main {
  text-align: center;
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.radial-progress-container {
  width: 130px;
  height: 130px;
  position: relative;
  margin-bottom: 16px;
}

.circular-chart {
  display: block;
  margin: 10px auto;
  max-width: 100%;
  max-height: 100%;
}

.circle-bg {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 3.5;
}

.circle {
  fill: none;
  stroke-width: 2.8;
  stroke-linecap: round;
  transition: stroke-dasharray 0.8s ease;
}

.circle.score-primary {
  stroke: url(#gradient-cyan-purple);
}

.radial-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
}

.result-score-label {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
}

.result-sub-scores {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.sub-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #ffffff;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--glass-border);
}

.sub-score-title {
  font-size: 15px;
  color: var(--text-secondary);
}

.sub-score-value {
  font-size: 15px;
  font-weight: 700;
}

.sub-score-value.blue { color: var(--primary); }
.sub-score-value.purple { color: var(--secondary); }
.sub-score-value.green { color: var(--success); }

/* --- TEACHER DASHBOARD --- */
.teacher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* Stats Box */
.stat-box {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  background: #ffffff;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.stat-icon.primary {
  background: rgba(2, 132, 199, 0.1);
  color: var(--primary);
  border: 1px solid rgba(2, 132, 199, 0.15);
}

.stat-icon.secondary {
  background: rgba(124, 58, 237, 0.1);
  color: var(--secondary);
  border: 1px solid rgba(124, 58, 237, 0.15);
}

.stat-icon.success {
  background: rgba(5, 150, 105, 0.1);
  color: var(--success);
  border: 1px solid rgba(5, 150, 105, 0.15);
}

.stat-details h4 {
  font-size: 15px;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-details p {
  font-size: 22px;
  font-weight: 800;
}

/* Teacher Table style */
.table-container {
  overflow-x: auto;
  width: 100%;
}

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

.custom-table th {
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--glass-border);
  background-color: #f8fafc;
  letter-spacing: 0.5px;
}

.custom-table td {
  padding: 14px;
  font-size: 15px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-primary);
  vertical-align: middle;
}

.custom-table tbody tr {
  transition: var(--transition-smooth);
}

.custom-table tbody tr:hover {
  background: #f8fafc;
}

/* Badge colors */
.badge-group {
  padding: 4px 10px;
  border-radius: var(--border-radius-sm);
  font-size: 15px;
  font-weight: 700;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--text-primary);
  display: inline-block;
}

.badge-group.g1 { background: #ffadad; color: #78281f; border-color: #ffc6c6; }
.badge-group.g2 { background: #ffd6a5; color: #7e5109; border-color: #ffe5c9; }
.badge-group.g3 { background: #fdffb6; color: #7d6608; border-color: #ffffd0; }
.badge-group.g4 { background: #c1f0db; color: #0e6251; border-color: #daf5e9; }
.badge-group.g5 { background: #a8dadc; color: #1b4f72; border-color: #c9e9eb; }
.badge-group.g6 { background: #a2d2ff; color: #1b4f72; border-color: #c4e2ff; }
.badge-group.g7 { background: #ebdcfc; color: #5b21b6; border-color: #f3e8ff; }
.badge-group.g8 { background: #ffc6ff; color: #641e16; border-color: #ffdfff; }
.badge-group.g9 { background: #fae8ff; color: #701a75; border-color: #fdf4ff; }
.badge-group.g10 { background: #e8f8f5; color: #0e6251; border-color: #daf8f2; }
.badge-group.g11 { background: #ebf5fb; color: #1b4f72; border-color: #d6eaf8; }
.badge-group.g12 { background: #fdf2e9; color: #7e5109; border-color: #fbeee6; }

.badge-gender {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 700;
  display: inline-block;
}
.badge-gender.male { background-color: #e0f2fe; color: #0284c7; }
.badge-gender.female { background-color: #fce7f3; color: #db2777; }

/* Grading Inputs in table */
.score-input {
  width: 65px;
  padding: 6px 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-weight: 700;
  text-align: center;
}

.score-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.comment-input {
  width: 100%;
  min-width: 120px;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 15px;
}

.comment-input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 2px var(--secondary-glow);
}

/* --- GROUPING MANAGER (12 GROUPS GRID VIEW) --- */
.group-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  min-height: 450px;
}

.group-column {
  background: #ffffff;
  border: 3px solid #1e3a8a; /* Thick dark-blue border */
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(148, 163, 184, 0.03);
}

.group-column.unassigned-column {
  background: #fef8ec;
  border: 3px dashed #f59e0b !important;
}

.group-column.unassigned-column .group-column-title {
  color: #d97706 !important;
}

.group-column.unassigned-column .group-column-count {
  background: #fef3c7;
  color: #d97706;
}

.group-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 8px;
}

.group-column-title {
  font-size: 17px;
  font-weight: 800;
}

.group-column-count {
  font-size: 15px;
  color: var(--text-secondary);
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 10px;
}

.group-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
}

.student-drag-card {
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-sm);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: grab;
  transition: var(--transition-smooth);
}

.student-drag-card:active {
  cursor: grabbing;
}

.student-drag-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.student-card-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.student-card-name {
  font-size: 15.5px;
  font-weight: 800;
}

.student-card-id {
  font-size: 15px;
  color: var(--text-muted);
}

.move-student-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.move-student-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--primary);
}

/* Control buttons bar */
.controls-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.controls-bar button {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Switch styling for control panel */
.switch-container {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background-color: #ffffff;
}

.switch-label {
  font-weight: 600;
  font-size: 15px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

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

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 24px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked + .slider-round {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

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

input:checked + .slider-round:before {
  transform: translateX(24px);
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  width: 100%;
  max-width: 520px;
  padding: 28px;
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: scale(0.95);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
}

.close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Global Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--border-radius-md);
  background: #ffffff;
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(148, 163, 184, 0.15);
  transform: translateY(15px);
  opacity: 0;
  animation: slideIn 0.25s forwards cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

.toast.success {
  border-color: #a7f3d0;
  color: #047857;
  background-color: #ecfdf5;
}

.toast.error {
  border-color: #fecaca;
  color: #b91c1c;
  background-color: #fff5f5;
}

@keyframes slideIn {
  to { transform: translateY(0); opacity: 1; }
}

/* Gender elements styling */
.gender-radio-group {
  display: flex;
  gap: 16px;
  margin-top: 4px;
}

.gender-radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  cursor: pointer;
}

.gender-radio-label input {
  cursor: pointer;
}

/* --- PROJECTOR FULLSCREEN OVERLAY STYLE --- */
.projector-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #f8fafc;
  z-index: 99999;
  padding: 16px;
  overflow: hidden; /* Enforce NO scrolling */
  font-family: var(--font-family);
  box-sizing: border-box;
  flex-direction: column;
}

.projector-overlay.active {
  display: flex; /* Override to flex when active */
}

.projector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 3px solid #cbd5e1;
  padding-bottom: 8px;
  flex-shrink: 0;
}

.projector-title {
  font-size: 28px;
  font-weight: 900;
  color: #0f172a;
}

.projector-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 16px;
  flex: 1;
  min-height: 0; /* Let grid container shrink to fit inside flex container */
  box-sizing: border-box;
}

.projector-group-card {
  background: #ffffff;
  border: 2px solid #64748b;
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: fit-content;
  min-height: 0;
  width: 100%;
  max-width: 280px; /* Narrower width for compact visual */
  margin: 0 auto; /* Center inside grid columns */
}

.projector-group-title {
  font-size: 22px;
  font-weight: 900;
  color: #1e3a8a;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 4px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.projector-student-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow: hidden; /* Prevent overflow within group cards */
  justify-content: flex-start; /* Align items to the top */
}

.projector-student-item {
  font-size: 22px;
  font-weight: 800;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 0px;
  background: transparent; /* Remove heavy gray background */
  border: none;
  border-bottom: 1.5px solid #f1f5f9; /* Subtle divider line */
  box-sizing: border-box;
  flex: 1;
  min-height: 36px;
  max-height: 52px;
}

.projector-student-item:last-child {
  border-bottom: none; /* No bottom border for the last student */
}

.projector-student-item.leader {
  background: #fef08a;
  color: #854d0e;
  border: 1px solid #fde047;
  border-radius: 6px;
  padding: 6px 12px;
}

.projector-close-btn {
  background: #ef4444;
  color: white;
  border: none;
  font-size: 15px;
  font-weight: 800;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.4);
  transition: all 0.2s ease;
}

.projector-close-btn:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px -2px rgba(239, 68, 68, 0.5);
}

/* Leader Toggle Button Style */
.leader-toggle-btn {
  background: #f1f5f9; /* Muted gray background */
  border: 1px solid #cbd5e1; /* Muted gray border */
  font-size: 15px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
  filter: grayscale(1) opacity(0.5); /* Muted/Inactive but visible */
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.leader-toggle-btn:hover {
  filter: grayscale(0.5) opacity(0.7);
  background: #f1f5f9;
}

.leader-toggle-btn.is-leader {
  filter: none !important;
  opacity: 1 !important;
  background: #fef3c7 !important; /* Light yellow background */
  border: 1px solid #fcd34d !important;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.2);
}

/* Print-only layout styling */
@media print {
  @page {
    size: A4 landscape;
    margin: 0.4cm;
  }
  body > :not(#print-area-container) {
    display: none !important;
  }
  #print-area-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    background: white !important;
    color: black !important;
    display: block !important;
  }
  .print-page {
    page-break-after: always;
    page-break-inside: avoid;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
  }
  .print-page:last-child {
    page-break-after: avoid;
  }
  .print-grid {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px !important;
    margin-top: 12px !important;
  }
  .print-card {
    border: 2px solid #1e293b !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    box-sizing: border-box;
    background: #ffffff !important;
    page-break-inside: avoid;
  }
  .print-card-title {
    font-size: 16px !important;
    font-weight: 800 !important;
    border-bottom: 1.5px solid #1e293b !important;
    padding-bottom: 2px !important;
    margin-bottom: 4px !important;
  }
  .print-student-item {
    font-size: 13px !important;
    padding: 4px 0 !important;
    border-bottom: 1px dashed #cbd5e1 !important;
    line-height: 1.2 !important;
  }
}

/* Group Action Buttons Styling */
.btn-action-group {
  padding: 8px 14px !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto !important;
  height: 38px !important;
  color: #ffffff !important;
  white-space: nowrap !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-action-group:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.btn-action-group:active {
  transform: translateY(0);
}

/* Specific Macaron Gradients */
.btn-mac-green {
  background: linear-gradient(135deg, #aed4c2, #8fa89b) !important;
  box-shadow: 0 4px 12px rgba(143, 168, 155, 0.35);
}
.btn-mac-red {
  background: linear-gradient(135deg, #f29c9c, #d67a7a) !important;
  box-shadow: 0 4px 12px rgba(214, 122, 122, 0.35);
}
.btn-mac-purple {
  background: linear-gradient(135deg, #e3c7db, #c5a4bc) !important;
  box-shadow: 0 4px 12px rgba(197, 164, 188, 0.35);
}
.btn-mac-blue {
  background: linear-gradient(135deg, #aec8e6, #8da9cb) !important;
  box-shadow: 0 4px 12px rgba(141, 169, 203, 0.35);
}
.btn-mac-mint {
  background: linear-gradient(135deg, #caefdf, #a5deb9) !important;
  box-shadow: 0 4px 12px rgba(165, 222, 185, 0.35);
}

/* Drag & Drop Hover Highlights */
.group-column.drag-over {
  border-color: #10b981 !important;
  background-color: #f0fdf4 !important;
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.15), 0 8px 10px -6px rgba(16, 185, 129, 0.1) !important;
  transform: translateY(-2px) scale(1.01);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.group-column.drag-over.unassigned-column {
  border-color: #f59e0b !important;
  background-color: #fffbeb !important;
  box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.15), 0 8px 10px -6px rgba(245, 158, 11, 0.1) !important;
}

/* Term Capsule Pill Badge next to Import Title */
.term-pill-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  margin-left: 10px;
  vertical-align: middle;
}

.term-pill-badge.term-pill-114-2 {
  background: linear-gradient(135deg, #059669, #10b981) !important;
}

.term-pill-badge.term-pill-115-1 {
  background: linear-gradient(135deg, #0284c7, #38bdf8) !important;
}

.term-pill-badge.term-pill-115-2 {
  background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
}

.term-pill-badge.term-pill-default {
  background: linear-gradient(135deg, #475569, #64748b) !important;
}

/* Left 1 Sidebar Title: 30px and bold */
.sidebar-title {
  font-size: 30px !important;
  font-weight: bold !important;
}

/* Left 2 Page Titles (H1, current-view-title, page-title, login h1): 26px and bold */
h1, .h1, #page-title, .page-title, .login-card h1, #current-view-title {
  font-size: 26px !important;
  font-weight: bold !important;
}

/* All standard elements must have font-size exactly 20px and not bold */
body, p, li, a, td, th, label, input, select, textarea, button, .slider-val, .badge-role, .term-pill-badge, .btn-rating-num, h2:not(#current-view-title), h3, h4, .h2:not(#current-view-title), .h3, .h4, strong, b {
  font-size: 20px !important;
  font-weight: normal !important;
}

/* Ensure spans inside headers or buttons inherit parent size and weight instead of getting flattened */
h1 span, h2 span, h3 span, h4 span, button span, .h1 span, .h2 span, .h3 span, .h4 span, .sidebar-title span, .page-title span, #page-title span, #current-view-title span {
  font-size: inherit !important;
  font-weight: inherit !important;
}

/* Default divs containing text to 20px normal weight */
div {
  font-size: 20px;
  font-weight: normal;
}

/* Fix all buttons, selects, inputs to prevent text truncation/clipping at 20px */
select, button, input:not([type="checkbox"]):not([type="radio"]), textarea {
  height: auto !important;
  width: auto !important;
  min-height: 42px !important;
  min-width: 42px !important;
  line-height: 1.2 !important;
  padding: 7px 14px !important;
  box-sizing: border-box !important;
}

/* Specific styling for icon buttons and dropdowns inside tables/cards to keep them clean */
.leader-toggle-btn, .remove-student-btn, .projector-close-btn, .close-btn {
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 42px !important;
  height: 42px !important;
}

/* Allow selects in student drag cards to expand horizontally and vertically */
.student-drag-card select {
  min-width: 120px !important;
  max-width: none !important;
}

/* Restore student drag card spacing for 20px layout */
.student-drag-card {
  padding: 10px 14px !important;
  gap: 12px !important;
  align-items: center !important;
  flex-wrap: wrap !important;
}

/* Force details inside cards to match the 20px font size constraint */
.student-drag-details, .badge-role, .student-drag-info span {
  font-size: 20px !important;
}

/* Sidebar Header layout with hidden logo and badge-like title */
.sidebar-header {
  display: flex !important;
  margin-bottom: 32px !important;
  width: 100% !important;
}
.sidebar-logo {
  display: none !important; /* Hide logo as requested */
}
.sidebar-title {
  background: linear-gradient(135deg, #e0f2fe, #f3e8ff) !important; /* Beautiful light macaron blue-purple gradient */
  border: 1.5px solid #dbeafe !important;
  padding: 12px 18px !important;
  border-radius: 12px !important;
  color: #000000 !important; /* Force black text */
  text-align: center !important;
  width: 100% !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
  line-height: 1.3 !important;
}
.sidebar {
  width: 300px !important;
}

/* Force all text in sidebar (Left 1) to black */
.sidebar, .sidebar *, .sidebar-title, .nav-item, .nav-item.active, .nav-item:hover, .user-name, .user-role {
  color: #000000 !important;
}
.sidebar svg, .sidebar svg * {
  stroke: #000000 !important;
}
