/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #133327;
  --primary-dark: #0d2319;
  --success: #27AE60;
  --danger: #E74C3C;
  --warning: #F39C12;
  --info: #3498DB;
  --gray-50: #F8F9FA;
  --gray-100: #F1F3F5;
  --gray-200: #E9ECEF;
  --gray-300: #DEE2E6;
  --gray-400: #CED4DA;
  --gray-500: #ADB5BD;
  --gray-600: #868E96;
  --gray-700: #495057;
  --gray-800: #343A40;
  --gray-900: #212529;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

/* === Navbar === */
.navbar {
  background: white;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
}

.nav-brand img {
  height: 32px;
  width: auto;
}

.nav-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-user {
  color: var(--gray-600);
  font-size: 0.9rem;
}

/* === Container === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* === Auth Pages === */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(135deg, #133327 0%, #1a4a36 100%);
}

.auth-card {
  background: white;
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.auth-card-wide {
  max-width: 560px;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  color: var(--primary);
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.auth-header p {
  color: var(--gray-500);
  font-size: 0.9rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* === Forms === */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.65rem 0.75rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
  background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(19, 51, 39, 0.15);
}

.form-row {
  display: flex;
  gap: 1rem;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gray-300);
  color: var(--gray-700);
}

.btn-outline:hover {
  border-color: var(--gray-500);
  background: var(--gray-50);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-full {
  width: 100%;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #219653;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #C0392B;
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-warning:hover {
  background: #E67E22;
}

/* === Alerts === */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.alert-error {
  background: #FDECEA;
  color: var(--danger);
  border: 1px solid #F5C6CB;
}

.alert-success {
  background: #D4EDDA;
  color: #155724;
  border: 1px solid #C3E6CB;
}

/* === Page Title === */
.page-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--gray-800);
}

/* === Dashboard Grid === */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    flex-direction: column;
  }
}

/* === Cards === */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: 1.05rem;
  color: var(--gray-800);
}

.card-body {
  padding: 1.25rem;
}

/* === Badges === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--gray-200);
  color: var(--gray-600);
}

.badge-new {
  background: var(--danger);
  color: white;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* === Class List & Cards === */
.class-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.class-card {
  display: block;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--gray-50);
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
  border: 1.5px solid transparent;
}

.class-card:hover {
  background: white;
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.class-card.class-inactive {
  opacity: 0.6;
}

.class-card-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.class-card-info strong {
  font-size: 0.95rem;
}

.class-card-meta {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

/* === Dropzone === */
.dropzone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--gray-50);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  background: rgba(19, 51, 39, 0.05);
}

.dropzone.dragover {
  transform: scale(1.01);
}

.dropzone-icon {
  font-size: 2.5rem;
  color: var(--gray-400);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.dropzone p {
  color: var(--gray-600);
  font-size: 0.9rem;
}

.dropzone-hint {
  color: var(--gray-500) !important;
  font-size: 0.8rem !important;
  margin-top: 0.25rem;
}

/* === Upload Progress === */
.upload-progress {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s;
  animation: progress-indeterminate 1.5s infinite;
}

@keyframes progress-indeterminate {
  0% { width: 0%; margin-left: 0; }
  50% { width: 60%; margin-left: 20%; }
  100% { width: 0%; margin-left: 100%; }
}

.progress-text {
  font-size: 0.8rem;
  color: var(--gray-600);
  white-space: nowrap;
}

/* === Upload Result === */
.upload-result {
  margin-top: 0.75rem;
}

.result-item {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.result-success {
  background: #D4EDDA;
  color: #155724;
}

.result-error {
  background: #FDECEA;
  color: var(--danger);
}

/* === File List === */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  background: var(--gray-50);
  transition: background 0.2s;
}

.file-item:hover {
  background: var(--gray-100);
}

.file-item.file-new {
  background: #EBF5FB;
  border-left: 3px solid var(--info);
}

.file-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.file-name {
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  word-break: break-all;
}

.file-date {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.dot-new {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--info);
  display: inline-block;
  flex-shrink: 0;
}

/* === Drive-style File Row (used in admin-class, student-class, admin-files) === */
.drive-list {
  display: flex;
  flex-direction: column;
}

.drive-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  cursor: default;
  transition: background 0.12s;
  border-bottom: 1px solid var(--gray-100);
  position: relative;
}
.drive-row:last-child { border-bottom: none; }
.drive-row:hover {
  background: #f3f6fa;
}
.drive-row.drive-row-new {
  background: #EBF5FB;
}
.drive-row.drive-row-new:hover {
  background: #dceefb;
}

.drive-row-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--gray-200);
}
.drive-row-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
.drive-row-icon.icon-pdf { color: #e74c3c; }
.drive-row-icon.icon-img { color: #16a085; }
.drive-row-icon.icon-doc { color: #2563eb; }
.drive-row-icon.icon-default,
.drive-row-icon.icon-file { color: #6b7280; }
.drive-row-icon.icon-folder { color: #f59e0b; }
.drive-folder-row { cursor: pointer; }
.drive-folder-row .drive-row-main { font-weight: 600; }

.drive-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  cursor: pointer;
}
.drive-row-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-800, #111827);
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.drive-row-name input.rename-input {
  width: 100%;
  padding: 0.25rem 0.5rem;
  border: 1.5px solid #2563eb;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  outline: none;
  box-sizing: border-box;
}
.drive-row-meta {
  font-size: 0.74rem;
  color: var(--gray-500);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.drive-row-meta .meta-sep {
  color: var(--gray-400, #9ca3af);
}

.drive-row-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.12s;
}
.drive-row:hover .drive-row-actions,
.drive-row:focus-within .drive-row-actions {
  opacity: 1;
}
@media (max-width: 768px) {
  /* Mobile: always show */
  .drive-row-actions { opacity: 1; }
}

.drive-action-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--gray-600);
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  padding: 0;
}
.drive-action-btn:hover {
  background: rgba(0,0,0,0.07);
  color: var(--gray-800, #111827);
}
.drive-action-btn.danger:hover {
  background: #fee2e2;
  color: #dc2626;
}
.drive-action-btn svg {
  width: 18px;
  height: 18px;
}

/* Drive-style trailing badge (e.g. download remaining count) */
.drive-row-badge {
  font-size: 0.7rem;
  color: var(--gray-500);
  padding: 0.15rem 0.5rem;
  background: var(--gray-100);
  border-radius: 999px;
  flex-shrink: 0;
}
.drive-row-badge.warn {
  background: #fef3c7;
  color: #92400e;
}

/* Inline file preview overlay (shared across pages) */
.file-preview-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1500;
  align-items: center;
  justify-content: center;
}
.file-preview-overlay.show { display: flex; }
.file-preview-modal {
  background: #fff;
  border-radius: 12px;
  max-width: 92vw;
  max-height: 92vh;
  width: 900px;
  height: 92vh;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.file-preview-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.file-preview-title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-800, #111827);
  word-break: break-all;
}
.file-preview-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--gray-600);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-preview-close:hover { background: var(--gray-100); }
.file-preview-body {
  flex: 1;
  background: #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.file-preview-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}
.file-preview-body img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}
@media (max-width: 640px) {
  .file-preview-modal {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
}

/* === Tables === */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.9rem;
}

.table th {
  font-weight: 600;
  color: var(--gray-600);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--gray-50);
}

.table tbody tr:hover {
  background: var(--gray-50);
}

/* === Misc === */
.empty-message {
  text-align: center;
  color: var(--gray-500);
  padding: 2rem;
  font-size: 0.9rem;
}

.upload-info {
  background: var(--gray-50);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--gray-600);
}

.upload-info code {
  background: var(--gray-200);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: 'Consolas', monospace;
  font-size: 0.85rem;
}

.upload-info p {
  margin-bottom: 0.25rem;
}

.upload-info p:last-child {
  margin-bottom: 0;
}

.student-list-scroll {
  max-height: 400px;
  overflow-y: auto;
}

.student-list-scroll::-webkit-scrollbar {
  width: 6px;
}

.student-list-scroll::-webkit-scrollbar-track {
  background: var(--gray-100);
}

.student-list-scroll::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 3px;
}

/* === Student Link === */
.student-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.student-link:hover {
  text-decoration: underline;
}

/* === Page Header Row === */
.page-header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* === Student Info Grid === */
.student-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  font-size: 0.9rem;
}

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

/* === Add Class Row === */
.add-class-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.add-class-input {
  flex: 1;
  padding: 0.65rem 0.75rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.add-class-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(19, 51, 39, 0.15);
}

/* === Score Grid/Input === */
.score-input {
  width: 100%;
  padding: 0.4rem 0.25rem;
  border: 1.5px solid var(--gray-300);
  border-radius: 4px;
  font-size: 0.85rem;
  text-align: center;
}

.score-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(19, 51, 39, 0.15);
}

.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.score-input[type=number] {
  -moz-appearance: textfield;
}

.save-result {
  font-size: 0.85rem;
  font-weight: 600;
}

/* === Chart === */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* === Chart Legend Custom === */
.chart-legend-custom {
  margin-top: 0.75rem;
  text-align: center;
}

.chart-legend-items {
  display: inline-flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--gray-700);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-line {
  display: inline-block;
  width: 24px;
  height: 3px;
  border-radius: 2px;
}

.legend-line.legend-dashed {
  background: repeating-linear-gradient(
    90deg,
    currentColor 0px,
    currentColor 6px,
    transparent 6px,
    transparent 9px
  ) !important;
  background-color: transparent !important;
  color: #F39C12;
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.05rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-500);
  line-height: 1;
}

.modal-close:hover {
  color: var(--gray-800);
}

.modal-body {
  padding: 1.25rem;
}

.modal-body input,
.modal-body select {
  padding: 0.65rem 0.75rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.95rem;
  width: 100%;
}

.modal-body input:focus,
.modal-body select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(19, 51, 39, 0.15);
}

.modal-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* === Inactive class === */
.class-inactive {
  opacity: 0.6;
}

/* === Upcoming class === */
.class-upcoming {
  opacity: 0.8;
}

.badge-upcoming {
  background: #f59e0b;
  color: white;
}

/* === Calendar === */
.calendar-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 0.4rem;
}

.calendar-weekday.sun { color: var(--danger); }
.calendar-weekday.sat { color: var(--info); }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--gray-200);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.calendar-day {
  background: white;
  min-height: 90px;
  padding: 0.35rem;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  -webkit-user-select: none;
  user-select: none;
}

.calendar-day:hover {
  background: var(--gray-50);
}

.calendar-day.other-month {
  background: var(--gray-50);
}

.calendar-day.other-month .day-number {
  color: var(--gray-400);
}

.day-number {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
}

.day-number.sun { color: var(--danger); }
.day-number.sat { color: var(--info); }

.day-number.today {
  background: var(--primary);
  color: white !important;
}

.day-schedules {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow: hidden;
}

.schedule-tag {
  font-size: 0.7rem;
  padding: 1px 4px;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  font-weight: 500;
}

.schedule-tag:hover {
  filter: brightness(0.9);
}

/* Default green (single class pages) */
.schedule-tag { background: #d1e7dd; color: #133327; }

/* 10 distinct color variations for dashboard (per-class colors) */
.tag-class-0 { background: #d1e7dd; color: #0f5132; }
.tag-class-1 { background: #cfe2ff; color: #084298; }
.tag-class-2 { background: #f8d7da; color: #842029; }
.tag-class-3 { background: #fff3cd; color: #664d03; }
.tag-class-4 { background: #e2d9f3; color: #432874; }
.tag-class-5 { background: #d3e5ef; color: #0c5460; }
.tag-class-6 { background: #fde2d4; color: #8b3e16; }
.tag-class-7 { background: #f0d6e8; color: #7c1e5b; }
.tag-class-8 { background: #e0e0e0; color: #3a3a3a; }
.tag-class-9 { background: #d4edda; color: #3d6b4e; }

.schedule-more {
  font-size: 0.65rem;
  color: var(--gray-500);
  cursor: pointer;
  padding: 0 2px;
}

/* (Color picker removed - unified green colors) */

/* Repeat row */
.repeat-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--gray-700);
}

.repeat-row input {
  padding: 0.4rem 0.25rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.repeat-hint {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
  display: block;
}

/* Schedule time display on tags */
.schedule-tag .tag-time {
  font-size: 0.6rem;
  opacity: 0.8;
}

/* Dashboard Schedule Overview */
.schedule-tab-nav {
  display: flex;
  gap: 0.35rem;
}

.schedule-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.dash-schedule-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dash-schedule-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  background: var(--gray-50);
  transition: background 0.15s;
  -webkit-user-select: none;
  user-select: none;
}

.dash-schedule-item:hover {
  background: var(--gray-100);
}

.dash-schedule-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* 10 distinct dot colors for dashboard */
.dash-schedule-dot.dot-class-0 { background: #0f5132; }
.dash-schedule-dot.dot-class-1 { background: #084298; }
.dash-schedule-dot.dot-class-2 { background: #842029; }
.dash-schedule-dot.dot-class-3 { background: #664d03; }
.dash-schedule-dot.dot-class-4 { background: #432874; }
.dash-schedule-dot.dot-class-5 { background: #0c5460; }
.dash-schedule-dot.dot-class-6 { background: #8b3e16; }
.dash-schedule-dot.dot-class-7 { background: #7c1e5b; }
.dash-schedule-dot.dot-class-8 { background: #3a3a3a; }
.dash-schedule-dot.dot-class-9 { background: #3d6b4e; }

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

.dash-schedule-title {
  font-size: 0.95rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
}

.dash-schedule-meta {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.dash-schedule-date {
  font-size: 0.8rem;
  color: var(--gray-600);
  font-weight: 600;
  white-space: nowrap;
}

.dash-date-header {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600);
  padding: 0.4rem 0.75rem;
  background: var(--gray-100);
  border-radius: var(--radius);
}

/* Weekly timetable view */
.week-timetable-wrapper {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

.week-timetable {
  display: grid;
  grid-template-columns: 48px repeat(7, 1fr);
  min-width: 600px;
}

/* Time column */
.tt-time-col {
  border-right: 1px solid var(--gray-200);
}

.tt-header-spacer {
  height: 44px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.tt-time-body {
  position: relative;
}

.tt-time-label {
  position: absolute;
  width: 100%;
  text-align: right;
  padding-right: 6px;
  font-size: 0.65rem;
  color: var(--gray-500);
  line-height: 1;
  padding-top: 2px;
}

/* Day columns */
.tt-day-col {
  border-right: 1px solid var(--gray-100);
}

.tt-day-col:last-child {
  border-right: none;
}

.tt-day-today {
  background: rgba(46, 125, 50, 0.04);
}

.tt-day-today .tt-day-header {
  background: rgba(46, 125, 50, 0.08);
}

.tt-day-today .tt-day-name {
  color: var(--primary);
}

.tt-day-header {
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
  user-select: none;
}

.tt-day-header.sat { color: var(--info); }
.tt-day-header.sun { color: var(--danger); }

.tt-day-name {
  font-weight: 700;
  font-size: 0.8rem;
}

.tt-day-date {
  font-size: 0.65rem;
  color: var(--gray-500);
}

.tt-day-header.sat .tt-day-date,
.tt-day-header.sun .tt-day-date { color: inherit; opacity: 0.7; }

.tt-day-body {
  position: relative;
}

.tt-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid var(--gray-100);
  height: 0;
}

/* Schedule blocks */
.tt-block {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 0.7rem;
  overflow: hidden;
  z-index: 1;
  transition: filter 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.tt-block:hover {
  filter: brightness(0.9);
  z-index: 2;
}

.tt-block-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.tt-block-time {
  font-size: 0.6rem;
  opacity: 0.8;
}

.tt-block-desc {
  font-size: 0.6rem;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile timetable */
@media (max-width: 768px) {
  .week-timetable {
    grid-template-columns: 36px repeat(7, 1fr);
    min-width: 480px;
  }

  .tt-block-name { font-size: 0.6rem; }
  .tt-block-time { font-size: 0.55rem; }
  .tt-block-desc { display: none; }
}

/* Schedule view modal (student) */
.schedule-view-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.schedule-view-label {
  font-weight: 600;
  color: var(--gray-600);
  min-width: 60px;
}

/* Calendar responsive */
@media (max-width: 768px) {
  .calendar-day {
    min-height: 50px;
    padding: 0.2rem;
  }

  .day-number {
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
  }

  .schedule-tag {
    font-size: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    padding: 0;
    display: inline-block;
  }

  .day-schedules {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 3px;
  }

  .schedule-more {
    font-size: 0;
    width: 8px;
    height: 8px;
    background: var(--gray-400);
    border-radius: 50%;
    display: inline-block;
  }

  .calendar-nav {
    gap: 0.25rem;
  }

  #calTitle {
    font-size: 0.85rem !important;
    min-width: 90px !important;
  }
}

/* ===========================
   Student Sidebar Layout
   =========================== */
.student-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.student-sidebar {
  width: 260px;
  min-width: 260px;
  background: #133327;
  color: #d1e7dd;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
}

.student-sidebar::-webkit-scrollbar {
  width: 4px;
}

.student-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
}

.sidebar-header {
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
}

.sidebar-logo img {
  height: 36px;
  width: auto;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

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

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0;
}

.sidebar-section {
  padding: 0 0.5rem;
  margin-bottom: 0.25rem;
}

.sidebar-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.4);
  padding: 0.75rem 0.75rem 0.35rem;
  font-weight: 600;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.88rem;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

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

.sidebar-nav-item.active {
  background: rgba(255,255,255,0.12);
  color: white;
}

.sidebar-icon {
  font-size: 1.05rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-arrow {
  margin-left: auto;
  font-size: 0.6rem;
  transition: transform 0.2s;
  opacity: 0.5;
}

.sidebar-toggle.active .sidebar-arrow {
  transform: rotate(0deg);
}

.sidebar-toggle:not(.active) .sidebar-arrow {
  transform: rotate(-90deg);
}

.sidebar-external {
  margin-left: auto;
  font-size: 0.75rem;
  opacity: 0.4;
}

/* Submenu */
.sidebar-submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.sidebar-submenu.open {
  max-height: 500px;
}

.sidebar-submenu-item {
  display: block;
  padding: 0.45rem 0.75rem 0.45rem 2.6rem;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.82rem;
  border-radius: 4px;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-submenu-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.sidebar-submenu-item.active {
  background: rgba(255,255,255,0.15);
  color: white;
  font-weight: 600;
}

.sidebar-submenu-empty {
  padding: 0.4rem 0.75rem 0.4rem 2.6rem;
  color: rgba(255,255,255,0.35);
  font-size: 0.8rem;
  font-style: italic;
}

.sidebar-icon-white {
  filter: grayscale(1) brightness(10);
}

/* Sidebar brand icons (external links) */
.sidebar-brand-icon {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  vertical-align: middle;
  object-fit: contain;
}

/* Sidebar classes unified item */
.sidebar-toggle-classes {
  display: flex;
  align-items: center;
  padding: 0.55rem 0.75rem;
  color: rgba(255,255,255,0.7);
  border-radius: 6px;
  cursor: default;
}

.sidebar-toggle-classes.active {
  background: rgba(255,255,255,0.12);
}

.sidebar-classes-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
  flex: 1;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: inherit;
}

.sidebar-classes-link:hover {
  color: white;
}

.sidebar-arrow-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 0.6rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  transition: all 0.2s;
  margin-left: auto;
}

.sidebar-arrow-btn:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.sidebar-arrow-btn.open {
  transform: rotate(0deg);
}

.sidebar-arrow-btn:not(.open) {
  transform: rotate(-90deg);
}

/* Subgroup inside classes submenu */
.sidebar-subgroup {
  list-style: none;
}

.sidebar-subgroup-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.35rem 0.75rem 0.35rem 2rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sidebar-subgroup-toggle:hover {
  color: rgba(255,255,255,0.8);
}

.sidebar-subgroup-toggle .sidebar-arrow {
  font-size: 0.55rem;
}

.sidebar-subgroup-toggle.active .sidebar-arrow {
  transform: rotate(0deg);
}

.sidebar-subgroup-toggle:not(.active) .sidebar-arrow {
  transform: rotate(-90deg);
}

.sidebar-subgroup .sidebar-submenu .sidebar-submenu-item {
  padding-left: 3rem;
}

/* Classes page — 3-column layout */
.classes-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: start;
}

.classes-column {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.classes-column-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.classes-column-header h3 {
  margin: 0;
  font-size: 0.9rem;
}

.classes-column-body {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.classes-col-card {
  display: block;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  border: 1px solid transparent;
}

.classes-col-card:hover {
  background: var(--gray-50);
  border-color: var(--gray-200);
}

.classes-col-card-name {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.classes-col-card-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--gray-500);
}

.classes-col-card-teacher {
  font-size: 0.73rem;
  color: var(--gray-400);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bulk edit mode */
.bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.bulk-toolbar-count {
  font-size: 0.85rem;
  font-weight: 600;
  margin-right: 0.5rem;
  color: var(--gray-600);
}

.bulk-toolbar .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.bulk-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.bulk-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.classes-col-card-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
}

.classes-col-card-wrap .bulk-checkbox {
  padding-top: 0.65rem;
  padding-left: 0.4rem;
}

.classes-col-card-wrap .classes-col-card {
  flex: 1;
  min-width: 0;
}

.classes-col-card-wrap.bulk-selected {
  background: #dbeafe;
  border-radius: 6px;
}

.bulk-edit-mode .classes-col-card {
  pointer-events: none;
}

@media (max-width: 768px) {
  .classes-columns {
    grid-template-columns: 1fr;
  }
  .bulk-toolbar {
    gap: 0.35rem;
  }
  .bulk-toolbar .btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
  }
}

/* Divider */
.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 0.5rem 1rem;
}

/* Footer */
.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: auto;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.sidebar-user-info {
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
}

.sidebar-logout {
  display: block;
  text-align: center;
  padding: 0.45rem;
  border-radius: 6px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.8rem;
  transition: all 0.15s;
}

.sidebar-logout:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

/* Overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
}

/* Main content area */
.student-main {
  flex: 1;
  margin-left: 260px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.student-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: white;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  font-size: 1.15rem;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hamburger-btn {
  display: none;
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--gray-700);
  line-height: 1;
}

.hamburger-btn:hover {
  background: var(--gray-50);
}

.student-content {
  padding: 1.5rem;
  max-width: 1200px;
  width: 100%;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .student-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .student-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: block;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .student-main {
    margin-left: 0;
  }

  .hamburger-btn {
    display: block;
  }
}

/* ===========================
   Schedule Page Builder
   =========================== */

/* Slot Grid (List page) */
.sp-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.sp-slot-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  position: relative;
  min-height: 160px;
  display: flex;
  flex-direction: column;
}

.sp-slot-number {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.sp-slot-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.sp-slot-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.sp-status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}

.sp-status-published {
  background: #D4EDDA;
  color: #155724;
}

.sp-status-draft {
  background: #FFF3CD;
  color: #664D03;
}

.sp-slug {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-family: monospace;
}

.sp-slot-owner {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-bottom: 0.5rem;
}

.sp-slot-actions {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sp-slot-empty {
  border: 2px dashed var(--gray-300);
  background: var(--gray-50);
  box-shadow: none;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.sp-slot-empty:hover {
  border-color: var(--primary);
  background: rgba(19, 51, 39, 0.03);
}

.sp-slot-empty-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--gray-400);
  font-size: 0.9rem;
}

.sp-slot-plus {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.sp-slot-link {
  position: absolute;
  inset: 0;
}

/* Editor sections */
.se-section {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  overflow: hidden;
}

.se-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.25rem;
  border: none;
  background: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--gray-800);
  font-family: inherit;
}

.se-section-toggle:hover {
  background: var(--gray-50);
}

.se-arrow {
  font-size: 0.6rem;
  transition: transform 0.2s;
  opacity: 0.5;
}

.se-section-toggle.active .se-arrow {
  transform: rotate(0deg);
}

.se-section-toggle:not(.active) .se-arrow {
  transform: rotate(-90deg);
}

.se-section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 1.25rem;
}

.se-section-body.open {
  max-height: 9999px;
  padding: 0 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Dynamic list items */
.se-list-section {
  margin: 0;
}

.se-list-section > label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.se-list-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.se-list-item input,
.se-list-item textarea {
  flex: 1;
  padding: 0.45rem 0.65rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-family: inherit;
}

.se-list-item input:focus,
.se-list-item textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(19, 51, 39, 0.1);
}

.se-list-remove {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.se-list-remove:hover {
  color: var(--danger);
}

/* Days checkboxes */
.se-days-check {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.se-days-check label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Block Grid (column-based schedule editor) */
.se-block-grid {
  overflow-x: auto;
}

.se-block-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.5rem;
  min-width: 400px;
}

.se-block-col {
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.se-block-col-header {
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.6rem 0.5rem;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  border-radius: var(--radius) var(--radius) 0 0;
  color: var(--gray-700);
}

.se-block-col-body {
  flex: 1;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.se-block-card {
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.se-block-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.se-block-card-subj {
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.se-block-card-time {
  font-size: 0.7rem;
  color: var(--gray-500);
}

.se-block-add {
  display: block;
  width: 100%;
  padding: 0.5rem;
  border: none;
  background: none;
  color: var(--gray-400);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border-top: 1px dashed var(--gray-300);
  transition: all 0.15s;
  font-family: inherit;
}

.se-block-add:hover {
  color: var(--primary);
  background: rgba(19, 51, 39, 0.03);
}

/* Multi-schedule cards */
.se-schedule-card {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--gray-50);
}

.se-schedule-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.se-sched-title {
  flex: 1;
  font-weight: 600;
  font-size: 1rem;
  min-width: 0;
}

.se-sched-title input {
  width: 100%;
  padding: 0.35rem 0.6rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
}

.se-sched-title input:focus {
  outline: none;
  border-color: var(--primary);
}

.se-sched-date-range {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.85rem;
}

.se-sched-date-range input[type="date"] {
  padding: 0.3rem 0.5rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-family: inherit;
}

.se-sched-date-range input[type="date"]:focus {
  outline: none;
  border-color: var(--primary);
}

.se-sched-remove {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.se-sched-remove:hover {
  color: var(--danger);
}

.se-schedule-card .se-days-check {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.se-schedule-card .se-days-check label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Profile image preview */
.se-profile-preview {
  margin-bottom: 0.75rem;
}

.se-profile-preview img {
  max-width: 300px;
  max-height: 420px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

/* Cell popup */
.se-cell-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.se-cell-popup-inner {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem;
  width: 380px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.se-popup-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--gray-800);
}

.se-cell-popup-inner input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.se-cell-popup-inner input:focus {
  outline: none;
  border-color: var(--primary);
}

.se-color-swatches {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.se-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
}

.se-swatch:hover {
  transform: scale(1.15);
}

.se-swatch.active {
  border-color: var(--gray-800);
  box-shadow: 0 0 0 2px white, 0 0 0 4px var(--gray-400);
}

/* Syllabus tabs */
.se-syllabus-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.se-syllabus-tab {
  padding: 0.4rem 1rem;
  border: 1.5px solid var(--gray-300);
  border-radius: 20px;
  background: white;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.se-syllabus-tab:hover {
  border-color: var(--primary);
}

.se-syllabus-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.se-subj-panel {
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.se-subj-panel > div:last-child {
  margin-top: 0;
}

/* Subject Registry */
.se-subject-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.se-subject-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

.se-subject-item input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-family: inherit;
}

.se-subject-item input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
}

.se-subject-block-count {
  font-size: 0.75rem;
  color: var(--gray-500);
  white-space: nowrap;
  flex-shrink: 0;
}

.se-subject-remove {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.se-subject-remove:hover {
  color: var(--danger);
}

/* Block popup subject dropdown */
.se-block-subject-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  background: white;
}

.se-block-subject-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* === Section list (분반 목록) === */
.se-section-list {
  margin-bottom: 0.75rem;
}

.se-section-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  margin-bottom: 0.35rem;
  background: #fff;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
}

.se-section-card:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.se-section-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.se-section-card-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.se-section-card-slots {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

/* Slot row in section popup */
.se-slot-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.se-slot-row select {
  padding: 0.3rem 0.4rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-family: inherit;
}

.se-slot-row input[type="time"] {
  padding: 0.3rem 0.4rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-family: inherit;
  width: 110px;
}

.se-slot-row select:focus,
.se-slot-row input[type="time"]:focus {
  outline: none;
  border-color: var(--primary);
}

.se-slot-remove {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.2rem;
  line-height: 1;
}

.se-slot-remove:hover {
  color: var(--danger);
}

/* === Schedule List Tabs (Admin) === */
.sp-tab-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.sp-tab-nav .sp-tab-btn {
  padding: 0.5rem 1.25rem;
  border: 1.5px solid var(--gray-300);
  border-radius: 20px;
  background: white;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--gray-700);
  font-family: inherit;
}

.sp-tab-nav .sp-tab-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.sp-tab-nav .sp-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.sp-pending-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 0.25rem;
  line-height: 1;
}

.sp-tab-content {
  display: none;
}

.sp-tab-content.active {
  display: block;
}

/* Pending status badge */
.sp-status-pending {
  background: #E8D5F5;
  color: #6C3483;
}

/* Private status badge */
.sp-status-private {
  background: #E9ECEF;
  color: #495057;
}

/* Teacher submissions list */
.sp-teacher-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sp-teacher-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sp-teacher-card-info {
  flex: 1;
  min-width: 0;
}

.sp-teacher-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.sp-teacher-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sp-teacher-card-owner {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.sp-teacher-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Owner info in editor */
.se-owner-info {
  padding: 0.6rem 1rem;
  background: #EBF5FB;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--gray-700);
  margin-bottom: 1rem;
  border-left: 3px solid var(--info);
}

/* Language toggle in editor */
.se-lang-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-radius: 20px;
  overflow: hidden;
  border: 1.5px solid var(--gray-300);
  width: fit-content;
}

.se-lang-btn {
  padding: 0.35rem 1rem;
  border: none;
  background: white;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--gray-600);
  font-family: inherit;
  letter-spacing: 0.03em;
}

.se-lang-btn:first-child {
  border-right: 1px solid var(--gray-300);
}

.se-lang-btn.active {
  background: var(--primary);
  color: white;
}

.se-lang-btn:hover:not(.active) {
  background: var(--gray-50);
}

@media (max-width: 768px) {
  .sp-teacher-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .sp-teacher-card-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
