:root {
  --teacher-primary: #8f000f;
  --teacher-primary-bright: #b30012;
  --teacher-primary-soft: #f8e9eb;
  --teacher-ink: #22252a;
  --teacher-muted: #626972;
  --teacher-border: #d9dde3;
  --teacher-surface: #ffffff;
  --teacher-background: #f5f6f8;
  --teacher-focus: #ffbf47;
}

.teacher-portal-page {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--teacher-ink);
  background: var(--teacher-background);
  overflow-x: hidden;
}

.teacher-portal-page [hidden] {
  display: none !important;
}

.teacher-skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1100;
  padding: 0.65rem 0.9rem;
  color: #ffffff;
  background: #20242a;
  border-radius: 0.35rem;
  transform: translateY(-160%);
}

.teacher-skip-link:focus {
  color: #ffffff;
  transform: translateY(0);
}

.teacher-brand-header {
  color: #ffffff;
  background: linear-gradient(135deg, var(--teacher-primary), var(--teacher-primary-bright));
}

.teacher-brand-inner {
  min-height: 6.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.teacher-brand-home {
  flex: 0 0 auto;
  border-radius: 0.4rem;
}

.teacher-brand-logo {
  display: block;
  width: auto;
  height: 4.5rem;
  max-width: 100%;
  object-fit: contain;
}

.teacher-university-name,
.teacher-portal-name,
.teacher-footer p,
.teacher-page-heading p {
  margin: 0;
}

.teacher-university-name {
  font-size: clamp(1rem, 3vw, 1.5rem);
  font-weight: 750;
  line-height: 1.25;
}

.teacher-portal-name {
  margin-top: 0.25rem;
  color: #f7e9eb;
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
}

.teacher-utility-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--teacher-border);
}

.teacher-utility-inner {
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.teacher-utility-link {
  padding: 0.75rem 0;
  color: var(--teacher-primary);
  font-weight: 650;
  text-decoration: none;
}

.teacher-utility-link:hover,
.teacher-utility-link:focus-visible {
  color: var(--teacher-primary-bright);
  text-decoration: underline;
}

.teacher-main {
  flex: 1 0 auto;
  padding: clamp(2rem, 5vw, 4rem) 0;
}

.teacher-login-container {
  max-width: 38rem;
}

.teacher-page-intro,
.teacher-page-heading {
  margin-bottom: 1.5rem;
}

.teacher-page-intro h1,
.teacher-page-heading h1 {
  color: var(--teacher-primary);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 750;
}

.teacher-page-intro p,
.teacher-card > p,
.teacher-muted {
  color: var(--teacher-muted);
}

.teacher-intro-icon,
.teacher-success-icon {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--teacher-primary-bright);
  font-size: 2.75rem;
}

/* ==========================================================================
   Teacher Portal Layout & Left Sidebar Navigation
   ========================================================================== */
.teacher-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  width: 100%;
}

@media (max-width: 991px) {
  .teacher-dashboard-layout {
    grid-template-columns: 1fr;
  }
}

#teacher-sidebar,
.teacher-sidebar {
  background-color: #fdf2f4; /* Soft, light crimson tint */
  border: 1px solid rgba(163, 0, 0, 0.12);
  border-right: 1px solid rgba(163, 0, 0, 0.16);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 4rem);
  width: 260px;
  padding: 1.25rem 1rem;
  position: sticky;
  top: 1.25rem;
  box-shadow: 0 4px 18px rgba(163, 0, 0, 0.04);
}

@media (max-width: 991px) {
  #teacher-sidebar,
  .teacher-sidebar {
    width: 100%;
    min-height: auto;
    position: static;
  }
}

#teacher-sidebar .sidebar-brand-logo {
  max-height: 42px;
  width: auto;
  object-fit: contain;
}

#teacher-sidebar .nav-link {
  color: #4a151b;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.15s ease-in-out;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

#teacher-sidebar .nav-link:hover {
  background-color: rgba(163, 0, 0, 0.06);
  color: #8b0000;
}

#teacher-sidebar .nav-link.active {
  background-color: #8b0000;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(139, 0, 0, 0.25);
}

#teacher-sidebar .nav-link.active i {
  color: #ffffff;
}

.sidebar-teacher-profile {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(163, 0, 0, 0.12);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.teacher-avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #8b0000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(139, 0, 0, 0.2);
}

.teacher-navigation {
  padding: 0.5rem 0;
}

.teacher-future-list {
  display: grid;
  gap: 0.6rem;
}

.teacher-future-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--teacher-muted);
}

.portal-main-content,
.teacher-workspace {
  min-width: 0;
  display: grid;
  gap: 1.5rem;
}

/* Normalized Card Styling across all modules */
.teacher-card,
.teacher-profile-card,
.account-security-card,
.teacher-class-card,
.teacher-classes-card {
  min-width: 0;
  padding: 1.5rem;
  background: var(--teacher-surface);
  border: 1px solid var(--teacher-border);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.teacher-card + .teacher-card,
.teacher-dashboard-grid + .teacher-card {
  margin-top: 0;
}

.teacher-card h2 {
  color: var(--teacher-primary);
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  font-weight: 700;
}

.teacher-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
  padding: 0.8rem;
  background: #ffffff;
  border: 1px solid var(--teacher-border);
  border-radius: 0.6rem;
}

.teacher-section-nav a {
  padding: 0.55rem 0.7rem;
  color: var(--teacher-primary);
  border-radius: 0.35rem;
  font-weight: 650;
}

.teacher-section-nav a:hover,
.teacher-section-nav a:focus-visible {
  color: #ffffff;
  background: var(--teacher-primary-bright);
}

.teacher-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.teacher-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
}

.teacher-profile-grid > div {
  min-width: 0;
  padding: 0.85rem;
  background: #fafafb;
  border-radius: 0.45rem;
}

.teacher-profile-grid dt {
  color: var(--teacher-muted);
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.teacher-profile-grid dd {
  margin: 0.3rem 0 0;
  overflow-wrap: anywhere;
}

.teacher-placeholder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.teacher-section-heading,
.teacher-enrollment-form-row,
.teacher-form-actions,
.teacher-pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.teacher-section-heading {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.teacher-section-heading > div,
.teacher-enrollment-form-row > div {
  min-width: 0;
}

.teacher-class-create,
.teacher-class-list-panel,
.teacher-class-detail-panel {
  min-width: 0;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--teacher-border);
  border-radius: 0.65rem;
  background: #fafafb;
}

.teacher-class-create h3,
.teacher-class-list-panel h3,
.teacher-class-detail-panel h3,
.teacher-enrollment-panel h4 {
  color: var(--teacher-ink);
  font-weight: 700;
}

.teacher-class-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.teacher-class-description-field {
  grid-column: 1 / -1;
}

.teacher-form-actions {
  flex-wrap: wrap;
  margin-top: 1rem;
}

.teacher-class-workspace {
  display: grid;
  grid-template-columns: minmax(15rem, 0.8fr) minmax(0, 1.5fr);
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}

.teacher-class-list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.teacher-class-list .teacher-class-select-btn {
  width: 100%;
  min-width: 0;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: var(--teacher-ink);
  text-align: left;
  overflow-wrap: normal;
  word-break: normal;
}

.teacher-class-list .teacher-class-select-btn:hover,
.teacher-class-list .teacher-class-select-btn:focus-visible {
  background: transparent;
}

.class-card-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0.6rem 1rem 0.75rem 1rem !important;
  border-top: 1px solid var(--teacher-border, #e2e8f0) !important;
  background: #fafafb !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

.class-card-actions button,
.class-card-actions .btn {
  width: auto !important;
  min-width: auto !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.35rem 0.75rem !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.class-card-actions button:hover,
.class-card-actions .btn:hover {
  transform: translateY(-1px);
}

.teacher-class-list-title {
  display: block;
  margin-top: 0.2rem;
  font-weight: 700;
}

.teacher-class-list-meta {
  display: block;
  margin-top: 0.2rem;
  color: var(--teacher-muted);
  font-size: 0.85rem;
}

.teacher-pagination {
  flex-wrap: wrap;
  justify-content: space-between;
  margin-top: 1rem;
}

.teacher-class-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.teacher-class-detail-grid > div {
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--teacher-border);
  border-radius: 0.45rem;
  background: #ffffff;
}

.teacher-class-detail-grid dt {
  color: var(--teacher-muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.teacher-class-detail-grid dd {
  margin: 0.25rem 0 0;
  overflow-wrap: anywhere;
}

.teacher-class-detail-description {
  grid-column: 1 / -1;
}

.teacher-enrollment-panel {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--teacher-border);
}

.teacher-enrollment-form-row {
  align-items: end;
}

.teacher-enrollment-form-row > div {
  flex: 1 1 18rem;
}

.teacher-enrollment-form-row > button {
  flex: 0 0 auto;
  margin-bottom: 1.5rem;
}

.teacher-enrollment-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--teacher-border);
  border-radius: 0.45rem;
}

.teacher-enrollment-table {
  min-width: 38rem;
  margin: 0;
}

.teacher-enrollment-table td,
.teacher-enrollment-table th {
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.teacher-placeholder-card {
  height: 100%;
  border-top: 0.3rem solid var(--teacher-primary-bright);
}

.teacher-placeholder-label {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.3rem 0.55rem;
  color: #714b00;
  background: #fff1c2;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.teacher-password-actions,
.teacher-recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.teacher-footer {
  padding: 1.5rem 0;
  color: #ffffff;
  background: #72000b;
  text-align: center;
}

.teacher-footer a {
  color: #ffffff;
}

.teacher-portal-page :focus-visible {
  outline: 3px solid var(--teacher-focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 2px #20242a;
}

@media (max-width: 991.98px) {
  .teacher-placeholder-grid,
  .teacher-class-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .teacher-dashboard-grid,
  .teacher-profile-grid,
  .teacher-class-form-grid,
  .teacher-class-detail-grid {
    grid-template-columns: 1fr;
  }

  .teacher-class-description-field,
  .teacher-class-detail-description {
    grid-column: auto;
  }

  .teacher-section-heading,
  .teacher-enrollment-form-row {
    align-items: stretch;
    flex-direction: column;
  }

  .teacher-section-heading .btn,
  .teacher-enrollment-form-row > button {
    width: 100%;
    margin-bottom: 0;
  }

  .teacher-utility-inner {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 0.5rem;
    padding-bottom: 0.75rem;
  }
}

@media (max-width: 374.98px) {
  .teacher-card {
    padding: 1rem;
    border-radius: 0.5rem;
  }

  .teacher-brand-inner {
    align-items: flex-start;
  }

  .teacher-brand-logo {
    height: 3.6rem;
  }

  .teacher-form-actions,
  .teacher-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .teacher-form-actions .btn,
  .teacher-pagination .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .teacher-portal-page *,
  .teacher-portal-page *::before,
  .teacher-portal-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ==========================================================================
   Teacher Attendance Modal & Roll-Call Roster
   ========================================================================== */

.teacher-attendance-overlay {
  position: fixed;
  inset: 0;
  z-index: 1055;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.teacher-attendance-overlay[hidden] {
  display: none !important;
}

.teacher-attendance-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.teacher-attendance-dialog {
  position: relative;
  z-index: 1056;
  width: 100%;
  max-width: 1040px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.teacher-attendance-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--teacher-border);
  background: #fdfdfd;
}

.teacher-attendance-nav .nav-tabs .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--teacher-muted);
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  border-radius: 0;
}

.teacher-attendance-nav .nav-tabs .nav-link:hover {
  color: var(--teacher-ink);
}

.teacher-attendance-nav .nav-tabs .nav-link.active {
  color: #0d6efd;
  background: transparent;
  border-bottom-color: #0d6efd;
}

.teacher-attendance-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

.teacher-attendance-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--teacher-border);
  background: #fafafb;
}

.attendance-status-btn-group .btn-check:checked + .btn-outline-success {
  background-color: #198754;
  color: #ffffff;
  font-weight: 600;
}

.attendance-status-btn-group .btn-check:checked + .btn-outline-danger {
  background-color: #dc3545;
  color: #ffffff;
  font-weight: 600;
}

.attendance-status-btn-group .btn-check:checked + .btn-outline-warning {
  background-color: #ffc107;
  color: #000000;
  font-weight: 600;
}

.attendance-status-btn-group .btn-check:checked + .btn-outline-info {
  background-color: #0dcaf0;
  color: #000000;
  font-weight: 600;
}

.attendance-kpi-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border-radius: 0.35rem;
}

/* Schedule-Driven Attendance Generator Styles */
.attendance-gen-card {
  border: 1px solid var(--teacher-border);
  border-radius: 0.65rem;
  background: #ffffff;
}

#attendance-gen-slots-container {
  background: #f8f9fa;
  border: 1px dashed #cbd5e1;
}

.attendance-gen-slot-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.attendance-gen-slot-badge i {
  color: #0d6efd;
}

#attendance-gen-result-card {
  border-left: 4px solid #198754;
}

/* ==========================================================================
   Teacher Assignments & Coursework Modal
   ========================================================================== */

.teacher-assignments-overlay {
  position: fixed;
  inset: 0;
  z-index: 1055;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.teacher-assignments-overlay[hidden] {
  display: none !important;
}

.teacher-assignments-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.teacher-assignments-dialog {
  position: relative;
  z-index: 1056;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.teacher-assignments-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--teacher-border);
  background: #fdfdfd;
}

.teacher-assignments-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

.teacher-assignments-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--teacher-border);
  background: #fafafb;
}

.teacher-assignment-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.teacher-assignment-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.teacher-assignment-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--teacher-ink);
  margin-bottom: 0.25rem;
}

.teacher-assignment-desc {
  font-size: 0.88rem;
  color: #64748b;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* ==========================================================================
   Teacher Inline Student Submission Grading Drawer
   ========================================================================== */

.teacher-grading-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: flex;
  justify-content: flex-end;
  padding: 0;
}

.teacher-grading-drawer-overlay[hidden] {
  display: none !important;
}

.teacher-grading-drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.teacher-grading-drawer-dialog {
  position: relative;
  z-index: 1061;
  width: 100%;
  max-width: 660px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.25);
  animation: teacherDrawerSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes teacherDrawerSlideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.teacher-grading-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--teacher-border);
  background: #fafafb;
}

.teacher-grading-drawer-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

.teacher-grading-drawer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--teacher-border);
  background: #fafafb;
}

.teacher-submission-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1.15rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.teacher-submission-content {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  padding: 0.75rem;
  font-size: 0.85rem;
  max-height: 140px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==========================================================================
   Teacher Schedule Manager Modal
   ========================================================================== */

.teacher-schedule-overlay {
  position: fixed;
  inset: 0;
  z-index: 1055;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.teacher-schedule-overlay[hidden] {
  display: none !important;
}

.teacher-schedule-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.teacher-schedule-dialog {
  position: relative;
  z-index: 1056;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.teacher-schedule-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--teacher-border);
  background: #fafafb;
}

.teacher-schedule-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

.teacher-schedule-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--teacher-border);
  background: #fafafb;
}

.teacher-schedule-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.teacher-schedule-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.teacher-schedule-time {
  font-weight: 700;
  font-size: 0.88rem;
  color: #0369a1;
  background: #e0f2fe;
  padding: 0.25rem 0.55rem;
  border-radius: 0.35rem;
}

.teacher-schedule-day-badge {
  font-weight: 700;
  font-size: 0.82rem;
  color: #1e293b;
}

.teacher-schedule-room-info {
  font-size: 0.85rem;
  color: #475569;
}

/* ==========================================================================
   Teacher Course Materials & Textbooks Modal
   ========================================================================== */

.teacher-materials-overlay {
  position: fixed;
  inset: 0;
  z-index: 1055;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.teacher-materials-overlay[hidden] {
  display: none !important;
}

.teacher-materials-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.teacher-materials-dialog {
  position: relative;
  z-index: 1056;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.teacher-materials-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--teacher-border);
  background: #fafafb;
}

.teacher-materials-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

.teacher-materials-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--teacher-border);
  background: #fafafb;
}

.teacher-material-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.teacher-material-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.teacher-material-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--teacher-ink);
}

.teacher-material-desc {
  font-size: 0.88rem;
  color: #475569;
}

/* ==========================================================================
   Modern 3-Column Recent Classes Card Grid & Class Hub
   ========================================================================== */
.classes-header-bar {
  margin-bottom: 1.25rem;
}

.classes-controls-bar {
  background: #fdf8f9;
  border: 1px solid rgba(163, 0, 0, 0.08);
  border-radius: 10px;
}

.class-filter-btn {
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
  font-weight: 600;
  font-size: 0.825rem;
  transition: all 0.15s ease;
}

.class-filter-btn.active {
  background-color: #8b0000 !important;
  color: #ffffff !important;
  border-color: #8b0000 !important;
}

.teacher-recent-classes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  width: 100%;
}

@media (max-width: 1199px) {
  .teacher-recent-classes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .teacher-recent-classes-grid {
    grid-template-columns: 1fr;
  }
}

.teacher-class-card-modern {
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 270px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  cursor: pointer;
}

.teacher-class-card-modern:hover {
  transform: translateY(-3px);
  border-color: #8b0000;
  box-shadow: 0 8px 24px rgba(139, 0, 0, 0.09);
}

.teacher-class-card-modern .card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.teacher-class-card-modern .course-code-badge {
  font-weight: 700;
  font-size: 0.825rem;
  letter-spacing: 0.03em;
  background: #fdf2f4;
  color: #8b0000;
  border: 1px solid rgba(139, 0, 0, 0.2);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}

.teacher-class-card-modern .status-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
}

.teacher-class-card-modern .class-title-modern {
  font-size: 1.05rem;
  font-weight: 700;
  color: #212529;
  line-height: 1.35;
  margin-bottom: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.7rem;
}

.teacher-class-card-modern .class-meta-text {
  font-size: 0.8rem;
  color: #6c757d;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.teacher-class-card-modern .class-info-badges {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #495057;
  padding: 0.6rem 0.75rem;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 0.85rem;
}

.teacher-class-card-modern .class-info-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-class-card-modern .class-card-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f3f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.teacher-class-card-modern .open-class-btn {
  font-weight: 600;
  font-size: 0.825rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.teacher-class-card-modern:hover .open-class-btn {
  background-color: #8b0000;
  color: #ffffff;
  border-color: #8b0000;
}

.view-all-classes-banner {
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  transition: border-color 0.15s ease;
}

.view-all-classes-banner:hover {
  border-color: #8b0000;
}

.teacher-hub-action-bar {
  background: #fcf6f7;
  border-bottom: 1px solid rgba(139, 0, 0, 0.1);
}

/* Class Deletion Actions */
#btn-delete-class-trigger {
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.15s ease-in-out;
}

#btn-delete-class-trigger:hover {
  background-color: #dc3545;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.35);
}

.class-card-actions [data-action="delete-class"] {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.class-card-actions [data-action="delete-class"]:hover {
  background-color: #dc3545;
  color: #ffffff;
}



