/* NetLab Suite - Moodle / Modern LMS Academic Theme */
:root {
  /* Paleta Académica Moodle Institucional - Limpia, Serena y Libre de Sobrecarga */
  --bg-gradient: #F8FAFC;
  --bg-canvas: #F8FAFC;
  --surface-dark: #FFFFFF;
  --surface-card: #FFFFFF;
  --surface-hover: #F1F5F9;
  --border-subtle: #E2E8F0;
  --border-card: #CBD5E1;
  --border-focus: #0F6CBD;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --brand-primary: #0F6CBD;        /* Azul Clásico Moodle */
  --brand-primary-hover: #095697;  /* Azul Profundo Moodle */
  --brand-primary-light: #EFF6FF;  /* Fondo selección */
  --brand-primary-border: #BFDBFE;
  --accent-indigo: #0F6CBD;
  --accent-indigo-hover: #095697;
  --accent-lilac: #4F46E5;
  --accent-lilac-hover: #4338CA;
  --accent-emerald: #10B981;
  --accent-amber: #D97706;
  --accent-rose: #EF4444;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background: var(--bg-canvas);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .brand-title, .modal-content h3 {
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text-primary);
}

/* Numerals and data tables formatting */
.tabular-nums, .badge, .teacher-course-kpi-val, .analytics-kpi-tile .kpi-val, table td, code, .dist-bar-count, .grade-chip {
  font-variant-numeric: tabular-nums;
}

/* Texture Layer deshabilitada para una apariencia limpia estilo LMS */
.bg-texture {
  display: none !important;
}

.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Clean Card (Estilo Moodle/Canvas) */
.glass-card {
  background: #FFFFFF !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03) !important;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-family: var(--font-family);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.16s ease;
  border: 1px solid transparent;
  outline: none;
  text-decoration: none;
  user-select: none;
}

.btn:active, .btn-course-primary:active, .btn-course-sub:active, .grade-chip:active, .penalty-chip:active {
  transform: scale(0.98) !important;
}

.btn:focus-visible, .input-glass:focus, input:focus, select:focus, textarea:focus {
  outline: none !important;
  border-color: #0F6CBD !important;
  box-shadow: 0 0 0 3px rgba(15, 108, 189, 0.2) !important;
}

.btn-primary {
  background: var(--brand-primary) !important;
  border: 1px solid var(--brand-primary) !important;
  color: #FFFFFF !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08) !important;
}

.btn-primary:hover {
  background: var(--brand-primary-hover) !important;
  border-color: var(--brand-primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(15, 108, 189, 0.2) !important;
}

.btn-shimmer {
  animation: none !important;
  background-size: auto !important;
}

.btn-lilac {
  background: #8B5CF6;
  border-color: #7C3AED;
  color: #FFFFFF !important;
}

.btn-lilac:hover {
  background: #7C3AED;
}

.btn-teal {
  background: #0D9488;
  border-color: #0F766E;
  color: #FFFFFF !important;
}

.btn-teal:hover {
  background: #0F766E;
}

.btn-glass {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.btn-glass:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}

.btn-danger {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: #DC2626 !important;
}

.btn-danger:hover {
  background: #DC2626;
  color: #FFFFFF !important;
}

.btn-success {
  background: #DCFCE7;
  border-color: #86EFAC;
  color: #166534 !important;
}

.btn-success:hover {
  background: #16A34A;
  color: #FFFFFF !important;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-glass {
  width: 100%;
  height: 42px;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 0 14px;
  font-size: 14px;
  font-family: var(--font-family);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.input-glass:focus {
  border-color: var(--border-focus);
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

/* Home Screen */
.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.home-card {
  width: 100%;
  max-width: 820px;
  padding: 50px 45px;
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  box-shadow: 0 20px 40px -15px rgba(139, 92, 246, 0.15), 0 10px 20px -10px rgba(13, 148, 136, 0.1);
}

.brand-icon {
  width: 90px;
  height: 90px;
  margin-bottom: 16px;
  filter: drop-shadow(0 8px 16px rgba(13, 148, 136, 0.25));
}

.brand-title {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #7C3AED 0%, #0D9488 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.brand-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 35px;
}

.action-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.action-btn {
  height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 17px;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.action-btn:hover {
  transform: translateY(-3px);
  border-color: #8B5CF6;
  box-shadow: 0 12px 24px rgba(139, 92, 246, 0.15);
}

.action-btn .emoji {
  font-size: 34px;
}

.home-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
}

.link-subtle {
  color: #7C3AED;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  transition: color 0.2s;
}

.link-subtle:hover {
  color: #0D9488;
  text-decoration: underline;
}

/* Modals - 100% Responsive & Overflow-Safe */
body.modal-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden;
}

.modal-overlay.active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.modal-content {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 24px 20px;
  transform: scale(0.96) translateY(12px);
  opacity: 0;
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease-out;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Modal Sub-Structure Helpers */
.modal-header-fixed {
  flex-shrink: 0;
}

.modal-body-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.modal-footer-sticky {
  flex-shrink: 0;
}

.modal-submit-dialog {
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #FFFFFF;
}

.grades-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Student & Teacher Dashboards */
.dashboard-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  margin: 20px 28px 0 28px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
}

.dashboard-layout {
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: 24px;
}

/* Teacher View with Sidebar */
.teacher-container {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #FFFFFF;
  border-right: 1px solid var(--border-subtle);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-btn {
  justify-content: flex-start;
  height: 46px;
  padding: 0 16px;
  font-size: 14px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-weight: 600;
  border-radius: 8px;
}

.sidebar-btn:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.sidebar-btn.active {
  background: #EFF6FF !important;
  color: #0F6CBD !important;
  border: 1px solid #BFDBFE !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}

.teacher-main {
  padding: 30px 35px;
  overflow-y: auto;
  max-height: 100vh;
}

/* Lists & Tables */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: all 0.2s;
}

.file-item:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.file-icon {
  font-size: 22px;
}

.file-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.file-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-entregado {
  background: #EFF6FF;
  color: #2563EB;
  border: 1px solid #BFDBFE;
}

.badge-revisado {
  background: #FEF3C7;
  color: #D97706;
  border: 1px solid #FDE68A;
}

.badge-aprobado {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

.badge-grade-high {
  background: #CCFBF1;
  color: #0F766E;
  border: 1px solid #5EEAD4;
  font-weight: 800;
}

.badge-grade-low {
  background: #FEE2E2;
  color: #DC2626;
  border: 1px solid #FCA5A5;
  font-weight: 800;
}

/* Quick grade chips */
.grade-chip {
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  color: var(--text-primary);
  transition: all 0.15s;
}

.grade-chip:hover {
  background: #8B5CF6;
  color: #FFFFFF;
  border-color: #7C3AED;
  transform: translateY(-1px);
}

/* Penalty chips */
.penalty-chip {
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid #FECACA;
  background: #FEF2F2;
  color: #DC2626;
  transition: all 0.15s;
}

.penalty-chip:hover {
  background: #DC2626;
  color: #FFFFFF;
  border-color: #B91C1C;
  transform: translateY(-1px);
}

.penalty-chip-danger {
  border-color: #EF4444;
  background: #FEE2E2;
  color: #B91C1C;
}

.penalty-chip-danger:hover {
  background: #991B1B;
  color: #FFFFFF;
}

.penalty-chip-reset {
  border-color: #CBD5E1;
  background: #F1F5F9;
  color: #475569;
}

.penalty-chip-reset:hover {
  background: #475569;
  color: #FFFFFF;
}

/* Tab Navigation Pills */
.nav-tab-pill {
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.nav-tab-pill:hover {
  background: #F1F5F9;
  color: var(--text-primary);
}

.nav-tab-pill.active {
  background: #EFF6FF !important;
  color: #0F6CBD !important;
  border-color: #BFDBFE !important;
  box-shadow: none !important;
  font-weight: 700;
}

/* Student Pending Assignments & Evaluations Tabs */
.student-pending-tabs-bar,
.student-qeval-tabs-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
  padding-bottom: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
}

.student-pending-tabs-bar::-webkit-scrollbar,
.student-qeval-tabs-bar::-webkit-scrollbar {
  display: none;
}

.student-pending-tab-btn {
  flex: 0 0 auto;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid var(--border-subtle);
  background: #FFFFFF;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  white-space: nowrap;
  box-sizing: border-box;
}

.student-pending-tab-btn:hover {
  background: #F8FAFC;
  color: #0F172A;
}

.tab-badge-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.08);
  color: #475569;
  line-height: 1;
}

.student-pending-tab-btn.active-tab {
  background: #0F6CBD !important;
  color: #FFFFFF !important;
  border-color: #0F6CBD !important;
  box-shadow: 0 1px 3px rgba(15, 108, 189, 0.25);
}

.student-pending-tab-btn.active-tab .tab-badge-pill {
  background: rgba(255, 255, 255, 0.28) !important;
  color: #FFFFFF !important;
}

.student-pending-tab-btn.expired-active {
  background: #DC2626 !important;
  color: #FFFFFF !important;
  border-color: #DC2626 !important;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}

.student-pending-tab-btn.expired-active .tab-badge-pill {
  background: rgba(255, 255, 255, 0.28) !important;
  color: #FFFFFF !important;
}

/* Student Collapsible Task Cards */
.student-task-collapsible-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
  margin-bottom: 10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.student-task-collapsible-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.student-task-collapsible-card.task-card-expanded {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
  border-color: #94A3B8;
  background: #FFFFFF;
}

.student-task-header {
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  background: #FFFFFF;
  transition: background 0.15s ease;
}

.student-task-header:hover {
  background: #F8FAFC;
}

.student-task-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.student-task-toggle-btn:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.student-task-body {
  padding: 0 14px 14px 14px;
  animation: fadeInTaskDetails 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInTaskDetails {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Subject Gradebook Cards */
.subject-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.subject-header {
  padding: 16px 20px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.subject-grade-badge {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Student Feedback Component */
.student-grades-table td.cell-feedback {
  min-width: 250px;
  max-width: 320px;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.student-feedback-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-left: 3.5px solid #0D9488;
  border-radius: 8px;
  padding: 8px 10px;
  box-sizing: border-box;
  text-align: left;
  transition: all 0.2s ease;
  width: 100%;
}

.student-feedback-box:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
  border-left-color: #0D9488;
}

.student-feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.student-feedback-intro {
  font-size: 11.5px;
  color: #1E293B;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.student-feedback-intro.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.student-feedback-expanded {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #CBD5E1;
}

.student-feedback-criterion-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
  margin-bottom: 4px;
}

/* DOCX Preview */
.docx-viewer-host {
  background: #64748B;
  overflow-y: auto;
  overflow-x: auto;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  box-sizing: border-box;
}

.docx-wrapper {
  background: transparent !important;
  padding: 0 !important;
}

.docx-wrapper > section.docx {
  background: #FFFFFF !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
  margin-bottom: 24px !important;
  border-radius: 2px !important;
  color: #0F172A !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #F1F5F9;
}

::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Responsive */
@media (max-width: 900px) {
  .dashboard-layout {
    grid-template-columns: 1fr !important;
  }
  .teacher-container {
    grid-template-columns: 1fr !important;
  }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .action-cards {
    grid-template-columns: 1fr;
  }
}

/* ================= 100% MOBILE RESPONSIVE STYLES (360px - 768px) ================= */
@media (max-width: 768px) {
  html, body {
    font-size: 13px;
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    -webkit-text-size-adjust: 100%;
  }

  .app-container {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  /* Safe inputs: Prevent iOS Safari auto-zoom on focus and provide touch-friendly hitboxes */
  input[type="text"],
  input[type="password"],
  input[type="datetime-local"],
  input[type="number"],
  select,
  textarea,
  .input-glass {
    font-size: 16px !important;
    min-height: 42px;
    box-sizing: border-box;
  }

  .btn {
    min-height: 38px;
    touch-action: manipulation;
  }

  /* Home Portal */
  .home-container {
    padding: 16px 12px;
    justify-content: flex-start;
    padding-top: 30px;
    width: 100%;
  }

  .home-card {
    padding: 24px 16px;
    border-radius: 12px;
    width: 100%;
    max-width: 100%;
  }

  .brand-icon {
    width: 58px;
    height: 58px;
    margin-bottom: 8px;
  }

  .brand-title {
    font-size: 30px;
    margin-bottom: 4px;
  }

  .brand-subtitle {
    font-size: 12.5px;
    margin-bottom: 20px;
  }

  .action-cards {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 18px;
  }

  .action-btn {
    height: auto;
    min-height: 72px;
    flex-direction: row;
    justify-content: flex-start;
    padding: 12px 16px;
    gap: 14px;
    font-size: 14px;
    text-align: left;
  }

  .action-btn .emoji {
    font-size: 26px;
    flex-shrink: 0;
  }

  .home-links {
    flex-direction: column;
    gap: 10px;
    width: 100%;
    align-items: center;
  }

  /* Student & Teacher Topbar */
  .dashboard-topbar,
  .dashboard-topbar.student-topbar {
    margin: 8px 10px 0 10px !important;
    padding: 14px 12px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    border-radius: 12px !important;
  }

  .topbar-user-block {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
  }

  .topbar-user-block h2 {
    font-size: 17px !important;
  }

  .topbar-buttons-block {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .topbar-buttons-block .btn {
    flex: 1 1 calc(50% - 6px) !important;
    min-height: 38px !important;
    font-size: 12px !important;
    justify-content: center !important;
    padding: 6px 10px !important;
  }

  .topbar-buttons-block .btn-danger {
    flex: 1 1 100% !important;
  }

  /* Student Sub-Navigation Tabs */
  .student-subnav-container {
    margin: 8px 10px 10px 10px !important;
    padding: 5px !important;
    gap: 6px !important;
    display: flex !important;
  }

  .student-subnav-container .nav-tab-pill {
    flex: 1 1 calc(50% - 4px) !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 9px 4px !important;
    font-size: 12px !important;
    min-height: 40px !important;
  }

  /* Student Workspace Layout */
  .dashboard-layout,
  .student-workspace-layout.dashboard-layout {
    display: flex !important;
    flex-direction: column !important;
    padding: 6px 10px 20px 10px !important;
    gap: 14px !important;
    width: 100% !important;
  }

  .glass-card.student-workspace-card,
  .student-workspace-sidebar .glass-card {
    padding: 14px 12px !important;
    border-radius: 12px !important;
    width: 100% !important;
  }

  .student-sidebar-col {
    gap: 14px !important;
    width: 100% !important;
  }

  .enroll-form-row {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .enroll-form-row button {
    width: 100% !important;
    min-height: 42px !important;
  }

  .student-pending-tabs-bar,
  .student-qeval-tabs-bar {
    gap: 6px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    flex-wrap: nowrap !important;
    padding-bottom: 8px !important;
    margin-bottom: 12px !important;
  }

  .student-pending-tab-btn {
    flex: 0 0 auto !important;
    padding: 7px 12px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    min-height: 35px !important;
    border-radius: 9999px !important;
  }

  /* Responsive Task Cards */
  .student-task-collapsible-card {
    border-radius: 12px !important;
    margin-bottom: 12px !important;
  }

  .student-task-header {
    padding: 12px 10px !important;
  }

  .student-task-header-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .student-task-info {
    width: 100% !important;
  }

  .student-task-actions {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    gap: 8px !important;
    padding-top: 8px !important;
    border-top: 1px dashed #E2E8F0 !important;
  }

  .student-task-actions .badge {
    max-width: 60% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 10.5px !important;
  }

  .student-task-actions-btns {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  /* Student Files Card Item on Mobile */
  .file-item {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px 10px !important;
    border-radius: 10px !important;
  }

  .file-item .file-info {
    width: 100% !important;
  }

  .file-name {
    max-width: 100% !important;
    font-size: 13.5px !important;
    word-break: break-all !important;
  }

  .file-item-actions {
    display: flex !important;
    width: 100% !important;
    gap: 6px !important;
  }

  .file-item-actions .btn {
    flex: 1 !important;
    min-height: 38px !important;
    font-size: 12px !important;
    justify-content: center !important;
    padding: 6px 4px !important;
  }

  /* Pending Task Footer */
  .pending-task-footer {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .pending-task-footer .btn {
    width: 100% !important;
    min-height: 40px !important;
    justify-content: center !important;
  }

  /* Mobile Student Focus Mode: Cuando se abre Calificaciones o Evaluaciones, esa sección prima por completo */
  #view-student.student-focus-mode .student-topbar {
    display: none !important;
  }

  #view-student.student-focus-mode .student-subnav-container {
    margin: 6px 10px 10px 10px !important;
    padding: 6px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 90 !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
  }

  .student-section-back-bar {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Student Grades Section */
  .student-grades-section {
    padding: 0 10px 20px 10px !important;
    width: 100% !important;
  }

  .student-grades-summary-card {
    padding: 14px 12px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .student-grades-badges-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .student-grade-stat-box {
    min-width: 0 !important;
    padding: 10px 6px !important;
  }

  .student-grades-refresh-btn {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-height: 42px !important;
    justify-content: center !important;
  }

  .subject-card {
    border-radius: 10px !important;
    margin-bottom: 14px !important;
    overflow: hidden;
  }

  .subject-header {
    padding: 12px 10px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .subject-header > div:last-child {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  /* Transform Grades Table into Mobile Cards */
  .grades-table-wrap {
    overflow-x: visible !important;
    width: 100% !important;
  }

  .student-grades-table,
  .student-grades-table tbody,
  .student-grades-table tr,
  .student-grades-table td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .student-grades-table thead {
    display: none !important;
  }

  .student-grades-table tr {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 10px !important;
    padding: 12px 10px !important;
    margin-bottom: 10px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03) !important;
  }

  .student-grades-table td {
    padding: 6px 0 !important;
    border: none !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 12.5px !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    text-align: right !important;
    border-bottom: 1px dashed #F1F5F9 !important;
  }

  .student-grades-table td:last-child {
    border-bottom: none !important;
  }

  .student-grades-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-align: left;
    flex-shrink: 0;
  }

  .student-grades-table td[data-label="Retroalimentación"],
  .student-grades-table td.cell-feedback {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    text-align: left !important;
    width: 100% !important;
    padding: 8px 0 !important;
  }

  .student-grades-table td[data-label="Retroalimentación"]::before,
  .student-grades-table td.cell-feedback::before {
    text-align: left !important;
    margin-bottom: 4px !important;
    font-size: 11px !important;
    color: #0D9488 !important;
  }

  .student-grades-table td.cell-actions {
    display: flex !important;
    justify-content: stretch !important;
    gap: 6px !important;
    margin-top: 8px !important;
    padding-top: 8px !important;
    border-top: 1px solid #E2E8F0 !important;
    border-bottom: none !important;
    width: 100% !important;
  }

  .student-grades-table td.cell-actions::before {
    display: none !important;
  }

  .student-grades-table td.cell-actions .btn {
    flex: 1 !important;
    min-height: 38px !important;
    font-size: 11.5px !important;
    justify-content: center !important;
    padding: 6px 4px !important;
  }

  /* Submission History Modal Items */
  .sub-history-file-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .sub-history-btn-group {
    width: 100% !important;
    display: flex !important;
    gap: 6px !important;
  }

  .sub-history-btn-group .btn {
    flex: 1 !important;
    min-height: 38px !important;
    font-size: 11.5px !important;
    justify-content: center !important;
    padding: 6px 4px !important;
  }

  /* Modals on Mobile Devices (Bottom sheet mode on mobile phones) */
  .modal-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
    justify-content: center !important;
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    overflow: hidden !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    background: #FFFFFF !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .modal-submit-dialog {
    width: 100% !important;
    max-width: 100% !important;
    height: 90vh !important;
    height: 90dvh !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    padding: 0 !important;
    border-radius: 20px 20px 0 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: #FFFFFF !important;
  }

  .modal-submit-dialog .modal-header-fixed {
    flex-shrink: 0 !important;
    padding: 14px 16px 12px 16px !important;
    background: #FFFFFF !important;
    border-bottom: 1px solid #E2E8F0 !important;
  }

  .modal-submit-dialog .modal-body-scroll {
    flex: 1 1 auto !important;
    padding: 14px 16px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    min-height: 0 !important;
  }

  .modal-submit-dialog .modal-footer-sticky {
    flex-shrink: 0 !important;
    padding: 10px 16px 16px 16px !important;
    background: #F8FAFC !important;
    border-top: 1px solid #E2E8F0 !important;
    border-radius: 0 !important;
  }

  #modal-student-preview .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 14px 12px !important;
    max-height: 96vh !important;
    max-height: 96dvh !important;
    border-radius: 20px 20px 0 0 !important;
  }

  #student-preview-container {
    min-height: 280px !important;
    height: 52vh !important;
  }

  #modal-submit-assignment .modal-content {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Teacher Sidebar -> Horizontal Scroll on Mobile */
  .teacher-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .sidebar {
    padding: 14px 12px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    gap: 10px;
  }

  .sidebar > div:first-child > div:first-child {
    margin-bottom: 12px !important;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-btn {
    height: 38px;
    padding: 0 12px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .teacher-main {
    padding: 14px 10px;
    max-height: none;
    overflow-y: visible;
  }

  /* Tables with horizontal scroll */
  .table-responsive-wrapper,
  .grades-table-responsive-container {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Responsive Grid on forms and stats */
  #teacher-courses-grid {
    grid-template-columns: 1fr !important;
  }

  .new-course-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  #new-course-form > div {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Teacher header areas */
  .teacher-tab-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .teacher-new-course-btn {
    width: 100% !important;
  }

  /* Submissions filter bar */
  .teacher-submissions-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .teacher-sub-filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .teacher-filter-group {
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }

  .teacher-filter-group select,
  .teacher-filter-group .input-glass {
    flex: 1 !important;
    min-width: 0 !important;
  }

  .teacher-excel-btn {
    width: 100% !important;
  }

  /* Sidebar logout: show mobile button, hide desktop one */
  .sidebar-logout-mobile-btn {
    display: block !important;
  }

  .sidebar-logout-desktop-btn {
    display: none !important;
  }

  /* Admin stats grid: 2 columns on mobile */
  .admin-stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .admin-container {
    padding: 14px 10px !important;
  }

  .admin-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .admin-header > div:last-child {
    display: flex !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .admin-header > div:last-child .btn {
    flex: 1 !important;
  }

  /* Review modal: stack preview + grading vertically */
  #modal-review .modal-content {
    max-width: 100% !important;
    width: 100% !important;
    padding: 14px 10px !important;
    max-height: 96vh !important;
    align-items: stretch;
  }

  #modal-review div[style*="grid-template-columns: 1fr 350px"] {
    display: flex !important;
    flex-direction: column !important;
    min-height: unset !important;
    overflow: visible !important;
    gap: 12px !important;
  }

  #review-preview-container {
    min-height: 260px !important;
    height: 38vh !important;
  }

  #modal-review div[style*="grid-template-columns: 1fr 350px"] > div:last-child {
    overflow-y: visible !important;
    padding-right: 0 !important;
  }

  div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  /* Page-level & Layout Overflow Prevention on Mobile */
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .app-container, #view-student, .student-workspace-layout, .student-sidebar-col, .student-workspace-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* Student Task Cards & Container on Mobile */
  .student-tasks-scroll-list {
    max-height: none !important;
    overflow-y: visible !important;
    overflow-x: hidden !important;
    padding-right: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .student-task-collapsible-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .student-task-header {
    padding: 10px 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .student-task-header > div {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .student-task-header > div > div:last-child {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    border-top: 1px dashed #F1F5F9 !important;
    padding-top: 6px !important;
    margin-top: 2px !important;
  }

  .student-task-instructions-full,
  .student-task-instructions-scroll {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Student Evaluations Hub Cards on Mobile */
  #student-evaluations-hub-list > div {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 14px 12px !important;
    gap: 12px !important;
  }
  #student-evaluations-hub-list > div > div:first-child {
    min-width: 0 !important;
    width: 100% !important;
  }
  #student-evaluations-hub-list > div > div:last-child {
    min-width: 0 !important;
    width: 100% !important;
    align-items: stretch !important;
  }
  #student-evaluations-hub-list > div > div:last-child .btn {
    width: 100% !important;
    min-height: 40px !important;
    justify-content: center !important;
  }

  /* Student Live Alert Banner on Mobile */
  #student-live-alert-banner {
    margin: 8px 10px 10px 10px !important;
    padding: 12px 14px !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }
  #student-live-alert-banner button {
    width: 100% !important;
    min-height: 40px !important;
    justify-content: center !important;
  }

  /* Student Team Search and Classmates List */
  #submit-team-classmates-list {
    max-height: 120px !important;
  }
  #submit-team-classmates-list label {
    padding: 4px 6px !important;
    font-size: 11px !important;
  }
}

/* Extra small devices (<= 380px) */
@media (max-width: 380px) {
  body {
    font-size: 12.5px;
  }

  .dashboard-topbar,
  .dashboard-topbar.student-topbar {
    padding: 10px 8px !important;
    margin: 6px 6px 0 6px !important;
  }

  .topbar-buttons-block .btn {
    font-size: 11px !important;
    padding: 6px 6px !important;
  }

  .student-subnav-container .nav-tab-pill {
    font-size: 11px !important;
    padding: 8px 3px !important;
  }

  .student-grades-badges-row {
    grid-template-columns: 1fr !important;
  }

  /* Admin: single column stats on very small screens */
  .admin-stats-grid {
    grid-template-columns: 1fr !important;
  }

  /* Sidebar nav pills even smaller */
  .sidebar-btn {
    font-size: 11px !important;
    padding: 0 8px !important;
  }
}

/* Motor IA: animación del indicador de carga */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }


/* Calificación masiva con IA */
#modal-batch-ai .data-table { border-collapse: collapse; }
#modal-batch-ai .data-table th { font-size: 11px; font-weight: 800; color: #475569; text-transform: uppercase; letter-spacing: .3px; padding: 9px 8px; border-bottom: 1px solid #E2E8F0; text-align: left; }
#modal-batch-ai .data-table td { padding: 8px; border-bottom: 1px solid #F1F5F9; vertical-align: middle; }
#modal-batch-ai .data-table tbody tr[id^="batch-row-"]:hover { background: #FAF5FF; }
#modal-batch-ai .data-table tr[id^="batch-detail-"] td:empty { display: none; }

/* Rúbricas y formato ordenado de tareas */
.assignment-formatted-desc {
  font-size: 12.5px;
  line-height: 1.5;
  color: #334155;
}
.assignment-formatted-desc p {
  margin: 0 0 8px 0;
}
.assignment-formatted-desc ul, .assignment-formatted-desc ol {
  margin: 4px 0 10px 0;
  padding-left: 20px;
}
.assignment-formatted-desc li {
  margin-bottom: 3px;
  line-height: 1.45;
}
.rubric-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.rubric-table th, .rubric-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #E2E8F0;
  vertical-align: top;
}
.rubric-table th {
  background: #F8FAFC;
  font-weight: 800;
  color: #475569;
}
.rubric-table tr:hover td {
  background-color: #FAF5FF;
}


/* ================= GESTIÓN DE TAREAS: SELECCIÓN Y VISTA DETALLADA ================= */
.assignment-card-item {
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 9px;
  margin-bottom: 8px;
  padding: 10px 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  cursor: pointer;
  position: relative;
}
.assignment-card-item:hover {
  border-color: #0D9488;
  background: #F8FAFC;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.08);
}
.assignment-card-item.selected {
  border-color: #0D9488 !important;
  background: #F0FDFA !important;
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.16) !important;
}
.assignment-inline-detail-box {
  animation: fadeInDownAssignment 0.22s ease-out;
  border-top: 1px dashed #CBD5E1;
  margin-top: 10px;
  padding-top: 12px;
}
@keyframes fadeInDownAssignment {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ================= TARJETAS Y LAYOUT ESTILO MOODLE / LMS MODERNO ================= */

/* Contenedor y Layout del Estudiante (Línea de tiempo completa sin saturación) */
.student-moodle-layout {
  padding: 0 24px 24px 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#student-section-files {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Tarjeta de Curso Matriculado para Estudiantes (Moodle) */
.student-course-card-moodle {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 250px;
  flex: 1 1 280px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.student-course-card-moodle:hover {
  border-color: #0F6CBD;
  box-shadow: 0 4px 12px rgba(15, 108, 189, 0.08);
  transform: translateY(-2px);
}

.student-course-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.student-course-code-tag {
  font-family: monospace;
  font-size: 11px;
  color: #64748B;
  background: #F1F5F9;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}

.badge-status-enrolled {
  font-size: 10.5px;
  font-weight: 700;
  background: #EFF6FF;
  color: #0F6CBD;
  border: 1px solid #BFDBFE;
  padding: 2px 8px;
  border-radius: 9999px;
}

.student-course-card-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.student-course-name {
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
  margin: 0;
  line-height: 1.35;
}

.student-course-teacher {
  font-size: 12px;
  color: #64748B;
  margin: 0;
}

/* ================= TARJETA DE CURSO DOCENTE TIPO MOODLE ================= */
.teacher-course-card-moodle {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.teacher-course-card-moodle:hover {
  border-color: #CBD5E1;
  box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.teacher-course-top-banner {
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 3px solid #0F6CBD;
}

.teacher-course-badge-level {
  font-size: 11px;
  font-weight: 700;
  color: #0F6CBD;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.btn-course-delete-ghost {
  background: transparent;
  border: none;
  color: #94A3B8;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-course-delete-ghost:hover {
  background: #FEE2E2;
  color: #DC2626;
}

.teacher-course-body-moodle {
  padding: 16px 18px 12px 18px;
  flex: 1;
}

.teacher-course-title-moodle {
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 10px 0;
  line-height: 1.35;
}

.teacher-course-meta-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.teacher-course-code-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.teacher-course-code-pill code {
  font-weight: 700;
  color: #0F6CBD;
  font-family: inherit;
}

.btn-course-qr-pill {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-course-qr-pill:hover {
  background: #E2E8F0;
  color: #0F172A;
}

/* Stats Bar */
.teacher-course-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 14px;
}

.teacher-course-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.teacher-course-stat-item:hover {
  background: #EDF2F7;
}

.teacher-course-stat-item .stat-icon {
  font-size: 14px;
}

.teacher-course-stat-item .stat-num {
  font-size: 16px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.1;
  margin-top: 2px;
}

.teacher-course-stat-item .stat-lbl {
  font-size: 10px;
  font-weight: 600;
  color: #64748B;
  text-transform: uppercase;
}

/* Tasks Box */
.teacher-course-tasks-box {
  border-top: 1px solid #F1F5F9;
  padding-top: 10px;
  margin-bottom: 4px;
}

.teacher-course-tasks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.teacher-course-tasks-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
}

.teacher-course-tasks-manage {
  font-size: 11.5px;
  color: #0F6CBD;
  font-weight: 600;
  cursor: pointer;
}

.teacher-course-tasks-manage:hover {
  text-decoration: underline;
}

.teacher-course-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.teacher-course-task-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.teacher-course-task-item:hover {
  background: #EFF6FF;
  border-color: #BFDBFE;
}

.teacher-course-task-info {
  min-width: 0;
  flex: 1;
}

.teacher-course-task-name {
  font-size: 12px;
  font-weight: 600;
  color: #1E293B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.teacher-course-task-date {
  font-size: 10.5px;
  color: #64748B;
  margin-top: 2px;
}

.teacher-course-task-badge {
  font-size: 11px;
  font-weight: 700;
  background: #E2E8F0;
  color: #334155;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.teacher-course-no-tasks {
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
  font-size: 11.5px;
  color: #64748B;
  cursor: pointer;
}

.create-first-task-link {
  display: block;
  font-weight: 700;
  color: #0F6CBD;
  margin-top: 3px;
}

/* Footer & Toolbar */
.teacher-course-footer-moodle {
  padding: 12px 18px 16px 18px;
  background: #FAFAFA;
  border-top: 1px solid #F1F5F9;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-moodle-primary {
  width: 100%;
  height: 38px;
  background: #0F6CBD;
  color: #FFFFFF;
  border: 1px solid #0F6CBD;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-moodle-primary:hover {
  background: #095697;
  border-color: #095697;
}

.teacher-course-toolbar-moodle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.btn-toolbar-item {
  height: 32px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-toolbar-item:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: #0F172A;
}

/* Compatibilidad retrospectiva */
.teacher-course-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* Student Task Details & Container (Full Natural Expansion, Zero Clipping) */
.student-task-instructions-full,
.student-task-instructions-scroll {
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  padding: 6px 4px;
  width: 100%;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.student-tasks-scroll-list,
#student-pending-assignments-list {
  max-height: none !important;
  height: auto !important;
  overflow-y: visible !important;
  overflow-x: visible !important;
  padding-right: 0 !important;
  width: 100%;
  box-sizing: border-box;
}

.student-task-collapsible-card {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.student-task-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
}

.student-task-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.student-task-actions-btns {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Modern Notification Toast */
.nl-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 99999;
  pointer-events: none;
}
.nl-toast {
  pointer-events: auto;
  background: #0F172A;
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: nlToastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.nl-toast.success {
  background: #0F766E;
  border: 1px solid #14B8A6;
}
.nl-toast.info {
  background: #1E1B4B;
  border: 1px solid #6366F1;
}
@keyframes nlToastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ================= ANALYTICS & QR & ADVANCED LAB STYLES ================= */
.analytics-kpi-tile {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.analytics-kpi-tile .kpi-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748B;
  letter-spacing: 0.4px;
}
.analytics-kpi-tile .kpi-val {
  font-size: 22px;
  font-weight: 900;
  color: #0F172A;
  line-height: 1.1;
}
.analytics-kpi-tile .kpi-sub {
  font-size: 11px;
  color: #0D9488;
  font-weight: 600;
}

/* Distribution Bars */
.dist-bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.dist-bar-label {
  width: 140px;
  font-weight: 600;
  color: #334155;
  flex-shrink: 0;
}
.dist-bar-track {
  flex: 1;
  height: 18px;
  background: #E2E8F0;
  border-radius: 9px;
  overflow: hidden;
  position: relative;
}
.dist-bar-fill {
  height: 100%;
  border-radius: 9px;
  transition: width 0.4s ease;
}
.dist-bar-count {
  width: 50px;
  text-align: right;
  font-weight: 700;
  color: #0F172A;
  flex-shrink: 0;
}

/* QR Projector Fullscreen */
#modal-course-qr.projector-mode .modal-content {
  max-width: 90vw !important;
  width: 90vw !important;
  height: 90vh !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px !important;
  background: #FFFFFF !important;
}
#modal-course-qr.projector-mode #qr-code-image {
  width: 360px !important;
  height: 360px !important;
}
#modal-course-qr.projector-mode #qr-modal-code-display {
  font-size: 48px !important;
}

/* Network Scanner Badges */
.net-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  margin: 2px;
}
.net-chip-ip {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}
.net-chip-proto {
  background: #F0FDF4;
  color: #15803D;
  border: 1px solid #BBF7D0;
}
.net-chip-intf {
  background: #FAF5FF;
  color: #7E22CE;
  border: 1px solid #E9D5FF;
}
.net-cmd-box {
  background: #0F172A;
  color: #38BDF8;
  font-family: monospace;
  font-size: 11px;
  padding: 8px 10px;
  border-radius: 6px;
  max-height: 110px;
  overflow-y: auto;
  line-height: 1.4;
}

/* Badge for late submission */
.badge-late-alert {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
}
.badge-ontime-ok {
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #86EFAC;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
}

/* ================= MODERN ANIMATIONS (MagicUI / Anime.js / Motion inspired) ================= */

/* 1. Staggered Entrance Animation */
@keyframes fadeUpEntrance {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-up {
  opacity: 0;
  animation: fadeUpEntrance 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 2. Shimmer Sweep Effect (Magic UI shimmer button pattern) */
@keyframes shimmerSweep {
  0% {
    transform: translateX(-120%) skewX(-20deg);
  }
  100% {
    transform: translateX(220%) skewX(-20deg);
  }
}

.btn-shimmer {
  position: relative !important;
  overflow: hidden !important;
}

.btn-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.28) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-120%) skewX(-20deg);
  pointer-events: none;
}

.btn-shimmer:hover::after {
  animation: shimmerSweep 0.85s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 3. Number Ticker tabular animation */
.kpi-ticker-animated {
  font-variant-numeric: tabular-nums;
  display: inline-block;
  transition: transform 0.15s ease-out;
}

/* ================= WAYGROUND ASSESSMENTS & LIVE STYLES ================= */

/* Wayground 4-Color Palette */
.wg-opt-a { background: #EF4444 !important; color: #FFFFFF !important; border-color: #DC2626 !important; }
.wg-opt-b { background: #3B82F6 !important; color: #FFFFFF !important; border-color: #2563EB !important; }
.wg-opt-c { background: #F59E0B !important; color: #FFFFFF !important; border-color: #D97706 !important; }
.wg-opt-d { background: #10B981 !important; color: #FFFFFF !important; border-color: #059669 !important; }

/* 3D Interactive Wayground Game Buttons */
.wg-game-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 5px 0 rgba(0,0,0,0.22);
  text-align: left;
  user-select: none;
  position: relative;
  overflow: hidden;
  width: 100%;
}
.wg-game-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 7px 0 rgba(0,0,0,0.25);
}
.wg-game-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.2);
}
.wg-game-btn.selected {
  outline: 4px solid #FFFFFF;
  box-shadow: 0 0 22px rgba(255,255,255,0.7);
}
.wg-game-btn.dimmed {
  opacity: 0.35;
  filter: grayscale(0.5);
  pointer-events: none;
}
.wg-game-btn.correct-highlight {
  outline: 4px solid #10B981;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.85);
  animation: pulseCorrect 1s infinite alternate;
}
@keyframes pulseCorrect {
  0% { transform: scale(1); }
  100% { transform: scale(1.02); }
}

/* Badge letter icon inside buttons */
.wg-opt-letter {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(0,0,0,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  flex-shrink: 0;
  color: #FFFFFF;
}

/* Live Host Stage (Dark Immersion Theater) */
.wg-live-stage {
  background: radial-gradient(circle at 50% 15%, #1E1B4B 0%, #0F172A 70%, #020617 100%);
  color: #F8FAFC;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

/* Big Timer Bar */
.wg-timer-bar-wrap {
  width: 100%;
  height: 10px;
  background: #E2E8F0;
  border-radius: 6px;
  overflow: hidden;
}
.wg-timer-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #10B981, #F59E0B, #EF4444);
  transition: width 1s linear;
}

/* Lobby Participants Pill Grid */
.wg-lobby-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
  padding: 12px 14px;
}
.wg-player-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  color: #0F172A;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes popIn {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Live Results Bar Graph */
.wg-stat-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.wg-bar-track {
  width: 100%;
  height: 140px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: 4px;
}
.wg-bar-fill {
  width: 100%;
  border-radius: 8px;
  transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #FFFFFF;
  min-height: 0;
}

/* Podium Styles */
.wg-podium-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  height: 240px;
  margin: 20px 0;
}
.wg-podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 120px;
  text-align: center;
}
.wg-podium-block {
  width: 100%;
  border-radius: 14px 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  color: #FFFFFF;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.3);
}
.wg-podium-1st .wg-podium-block { height: 140px; background: linear-gradient(180deg, #F59E0B, #B45309); }
.wg-podium-2nd .wg-podium-block { height: 100px; background: linear-gradient(180deg, #94A3B8, #475569); }
.wg-podium-3rd .wg-podium-block { height: 75px; background: linear-gradient(180deg, #D97706, #78350F); }

/* Editable Question Card in Teacher Manager */
.wg-editor-card {
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(15,23,42,0.04);
}
.wg-editor-card:hover {
  border-color: #8B5CF6;
  box-shadow: 0 4px 14px rgba(139,92,246,0.12);
}

/* True/False Buttons */
.wg-opt-v { background: #10B981 !important; color: #FFFFFF !important; border-color: #059669 !important; box-shadow: 0 4px 0 #047857 !important; }
.wg-opt-f { background: #EF4444 !important; color: #FFFFFF !important; border-color: #DC2626 !important; box-shadow: 0 4px 0 #B91C1C !important; }

/* Self-Paced Navigation & Question Cards */
.wg-step-indicator {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px;
}
.wg-step-dot {
  min-width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  background: #F1F5F9;
  color: #475569;
  border: 1.5px solid #CBD5E1;
  transition: all 0.2s ease;
}
.wg-step-dot.active {
  background: #7C3AED;
  color: #FFFFFF;
  border-color: #6D28D9;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}
.wg-step-dot.answered {
  background: #ECFDF5;
  color: #059669;
  border-color: #10B981;
}

/* Analytics Cards & Gauges */
.wg-kpi-card {
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wg-kpi-val {
  font-size: 26px;
  font-weight: 900;
  color: #0F172A;
  line-height: 1.1;
}
.wg-kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Question Analytics Bar */
.wg-prog-track {
  width: 100%;
  height: 8px;
  background: #F1F5F9;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}
.wg-prog-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ================= MOODLE 4.5 BOOST LMS DESIGN SYSTEM ================= */

/* 1. Moodle 4 Activity Purpose Icon System (.activityiconcontainer) */
.activityiconcontainer {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.activityiconcontainer.assessment {
  background: #FFF1F2;
  color: #E11D48;
  border: 1px solid #FECDD3;
}

.activityiconcontainer.collaboration {
  background: #EFF6FF;
  color: #0F6CBD;
  border: 1px solid #BFDBFE;
}

.activityiconcontainer.content {
  background: #F0FDFA;
  color: #0D9488;
  border: 1px solid #99F6E4;
}

.activityiconcontainer.communication {
  background: #FFFBEB;
  color: #D97706;
  border: 1px solid #FDE68A;
}

/* 2. Moodle Institutional Login Portal */
.moodle-login-card {
  width: 100%;
  max-width: 780px;
  padding: 0 !important;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.08);
}

.moodle-login-banner {
  background: linear-gradient(135deg, #0F6CBD 0%, #1E3A8A 100%);
  color: #FFFFFF;
  padding: 28px 32px;
  position: relative;
  overflow: hidden;
}

.moodle-login-banner::after {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  pointer-events: none;
}

.moodle-portal-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.moodle-login-banner h1 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
  color: #FFFFFF;
}

.moodle-login-banner p {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.88);
  margin: 0;
  line-height: 1.45;
}

.moodle-role-card {
  border-radius: 12px !important;
  padding: 22px !important;
  border: 1px solid #E2E8F0 !important;
  background: #FFFFFF !important;
  text-align: left !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease !important;
}

.moodle-role-card:hover {
  transform: translateY(-2px);
  border-color: #93C5FD !important;
  box-shadow: 0 8px 20px -4px rgba(15, 108, 189, 0.12) !important;
}

/* 3. Moodle 4.5 Top Navbar & Secondary Navigation */
.moodle-navbar-top {
  background: #FFFFFF !important;
  border-bottom: 1px solid #E2E8F0 !important;
  border-radius: 12px 12px 0 0 !important;
  margin-bottom: 0 !important;
  padding: 12px 20px !important;
  box-shadow: none !important;
}

.moodle-brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, #0F6CBD 0%, #1D4ED8 100%);
  color: #FFFFFF;
  font-weight: 900;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.03em;
  box-shadow: 0 2px 6px rgba(15, 108, 189, 0.25);
  flex-shrink: 0;
}

.moodle-secondary-nav {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-top: none !important;
  border-radius: 0 0 12px 12px !important;
  padding: 0 18px !important;
  margin: 0 0 18px 0 !important;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.03) !important;
}

/* 4. Moodle KPI Summary Strip (Student & Teacher) */
.moodle-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.moodle-kpi-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.moodle-kpi-card:hover {
  border-color: #93C5FD;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 108, 189, 0.08);
}

.moodle-kpi-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.moodle-kpi-val {
  font-size: 21px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.moodle-kpi-lbl {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748B;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 5. Moodle Block Card & Course Overview Grid */
.moodle-block-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.moodle-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #F1F5F9;
}

.moodle-block-title {
  font-size: 16px;
  font-weight: 800;
  color: #0F172A;
  margin: 0;
  letter-spacing: -0.01em;
}

.moodle-block-subtitle {
  font-size: 12px;
  color: #64748B;
  margin: 2px 0 0 0;
}

.moodle-courses-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.student-course-card-moodle {
  cursor: pointer;
  position: relative;
}

.student-course-card-moodle.course-card-selected {
  border: 2px solid #0F6CBD !important;
  box-shadow: 0 0 0 3px rgba(15, 108, 189, 0.14) !important;
}

/* 6. Moodle 4.5 Deterministic Geometric Course Header Patterns */
.course-pattern-0 {
  background: linear-gradient(135deg, #0F6CBD 0%, #1E40AF 100%) !important;
}
.course-pattern-1 {
  background: linear-gradient(135deg, #0D9488 0%, #115E59 100%) !important;
}
.course-pattern-2 {
  background: linear-gradient(135deg, #4F46E5 0%, #3730A3 100%) !important;
}
.course-pattern-3 {
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%) !important;
}
.course-pattern-4 {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%) !important;
}

/* 7. Moodle Course Progress Bar */
.moodle-course-progress-wrap {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #F1F5F9;
}

.moodle-course-progress-bar {
  width: 100%;
  height: 6px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
}

.moodle-course-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0F6CBD 0%, #10B981 100%);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.moodle-course-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #64748B;
  margin-top: 5px;
}

.moodle-course-progress-meta b {
  color: #0F172A;
}

/* 8. Moodle 4.5 Activity Completion Pills */
.moodle-completion-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.2;
}

.moodle-completion-pill.done {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.moodle-completion-pill.graded {
  background: #F0FDF4;
  color: #15803D;
  border: 1px solid #86EFAC;
}

.moodle-completion-pill.todo {
  background: #F8FAFC;
  color: #334155;
  border: 1px solid #CBD5E1;
}

.moodle-completion-pill.urgent {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.moodle-completion-pill.closed {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

/* ================= REGLAS RESPONSIVAS MOODLE (MÓVIL) ================= */
@media (max-width: 768px) {
  .student-moodle-layout {
    padding: 0 10px 18px 10px !important;
    gap: 14px !important;
  }
  .moodle-kpi-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .moodle-kpi-card {
    padding: 10px 12px !important;
    gap: 9px !important;
  }
  .moodle-kpi-card .activityiconcontainer {
    width: 34px !important;
    height: 34px !important;
    font-size: 15px !important;
  }
  .moodle-kpi-val {
    font-size: 17px !important;
  }
  .moodle-kpi-lbl {
    font-size: 10.5px !important;
  }
  .moodle-block-card {
    padding: 14px 12px !important;
  }
  .moodle-courses-overview-grid {
    grid-template-columns: 1fr !important;
  }
  .student-course-card-moodle {
    min-width: 100% !important;
    flex: 1 1 100% !important;
  }
  .teacher-course-toolbar-moodle {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
  }
  .btn-toolbar-item {
    font-size: 11px !important;
    padding: 0 3px !important;
  }
  .moodle-login-banner {
    padding: 20px 18px !important;
  }
  .moodle-login-banner h1 {
    font-size: 21px !important;
  }
}

/* ================= MINIMALIST LMS ARCHITECTURE (V14.0) ================= */

/* 1. Minimalist Vector SVG Icon Boxes */
.lms-svg-box {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.16s ease;
}

.lms-svg-box.blue {
  background: #EFF6FF;
  color: #0F6CBD;
  border: 1px solid #BFDBFE;
}

.lms-svg-box.teal {
  background: #F0FDFA;
  color: #0D9488;
  border: 1px solid #99F6E4;
}

.lms-svg-box.slate {
  background: #F8FAFC;
  color: #334155;
  border: 1px solid #E2E8F0;
}

.lms-avatar-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #0F172A;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 2. Student 2-Column + Right Contextual Menu Shell */
.lms-workspace-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 295px;
  gap: 20px;
  padding: 0 24px 28px 24px;
  max-width: 1460px;
  width: 100%;
  margin: 0 auto;
  align-items: start;
}

.lms-center-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* 3. Teacher 3-Column Shell (Left Sidebar + Center Workspace + Right Contextual Menu) */
.teacher-workspace-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 0;
  min-height: 100vh;
  align-items: stretch;
  background: #F8FAFC;
}

.teacher-workspace-shell .teacher-main {
  padding: 26px 28px;
  max-height: 100vh;
  overflow-y: auto;
  min-width: 0;
}

/* 4. Right-Hand Contextual Drawer (Teacher & Student) */
.lms-right-drawer {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#teacher-right-drawer {
  background: #FFFFFF;
  border-left: 1px solid #E2E8F0;
  padding: 22px 18px;
  max-height: 100vh;
  overflow-y: auto;
}

.lms-right-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 15px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

#teacher-right-drawer .lms-right-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  box-shadow: none;
}

.lms-right-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #334155;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #E2E8F0;
}

.lms-stat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lms-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.lms-stat-row:hover {
  border-color: #93C5FD;
  background: #F8FAFC;
}

.lms-stat-row-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.lms-stat-row-val {
  font-size: 14px;
  font-weight: 800;
  color: #0F172A;
}

.lms-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.lms-dot.blue { background: #0F6CBD; }
.lms-dot.teal { background: #0D9488; }
.lms-dot.amber { background: #D97706; }
.lms-dot.green { background: #10B981; }
.lms-dot.red { background: #EF4444; }

/* Right-Hand Menu Buttons */
.lms-right-menu-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.lms-right-menu-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #FFFFFF;
  color: #334155;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

#student-right-drawer .lms-right-menu-btn {
  background: #F8FAFC;
  border-color: #F1F5F9;
}

.lms-right-menu-btn:hover {
  background: #EFF6FF !important;
  color: #0F6CBD !important;
  border-color: #BFDBFE !important;
}

.lms-right-menu-btn.primary-accent {
  background: #0F6CBD !important;
  color: #FFFFFF !important;
  border-color: #0F6CBD !important;
}

.lms-right-menu-btn.primary-accent:hover {
  background: #0B5394 !important;
  color: #FFFFFF !important;
}

.lms-right-menu-btn.danger-item {
  color: #DC2626;
}

.lms-right-menu-btn.danger-item:hover {
  background: #FEF2F2 !important;
  color: #B91C1C !important;
  border-color: #FECACA !important;
}

/* 5. Minimalist Course Cards (Student & Teacher Catalog) */
.lms-minimal-course-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.lms-minimal-course-card:hover {
  transform: translateY(-2px);
  border-color: #93C5FD;
  box-shadow: 0 8px 20px -6px rgba(15, 23, 42, 0.08);
}

.lms-minimal-course-card.course-card-selected {
  border-color: #0F6CBD !important;
  box-shadow: 0 0 0 3px rgba(15, 108, 189, 0.12) !important;
}

.lms-minimal-course-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lms-minimal-code-tag {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.lms-minimal-code-tag:hover {
  background: #EFF6FF;
  color: #0F6CBD;
  border-color: #BFDBFE;
}

.lms-minimal-status-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748B;
}

.lms-minimal-status-pill.active {
  color: #0F6CBD;
  background: #EFF6FF;
  padding: 2px 7px;
  border-radius: 999px;
}

.lms-minimal-course-title {
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
  margin: 8px 0 6px 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lms-minimal-course-teacher {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748B;
  margin-bottom: 4px;
}

.lms-minimal-course-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid #F1F5F9;
}

.lms-minimal-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lms-minimal-metric {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #64748B;
}

.lms-minimal-metric b {
  color: #0F172A;
  font-weight: 700;
}

.lms-open-course-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #0F6CBD;
}

/* 6. Opened Course Detail Workspace (Teacher) */
.lms-course-breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.lms-course-detail-hero {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-top: 3px solid #0F6CBD;
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.lms-course-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0F6CBD;
  background: #EFF6FF;
  padding: 3px 8px;
  border-radius: 4px;
}

.lms-code-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: #475569;
  cursor: pointer;
}

.lms-code-badge code {
  font-weight: 800;
  color: #0F172A;
  font-size: 12.5px;
}

.lms-course-hero-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lms-hero-stat {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 10px 16px;
  text-align: center;
  min-width: 82px;
  transition: border-color 0.15s ease;
}

.lms-hero-stat:hover {
  border-color: #93C5FD;
}

.lms-hero-stat-num {
  display: block;
  font-size: 19px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.1;
}

.lms-hero-stat-lbl {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #64748B;
  margin-top: 2px;
}

.lms-course-action-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.lms-course-activity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.lms-course-activity-row:hover {
  border-color: #93C5FD;
  background: #F8FAFC;
}

/* Responsive rules for 3-column & 2-column shells + 100% Mobile/Tablet Adaptation */
@media (max-width: 1024px) {
  .lms-workspace-shell {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 12px 24px 12px !important;
    gap: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .lms-center-column,
  .lms-right-drawer {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .teacher-workspace-shell {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .teacher-workspace-shell .teacher-main {
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    overflow-y: visible !important;
    padding: 16px 12px !important;
    box-sizing: border-box !important;
  }

  #teacher-right-drawer {
    width: 100% !important;
    max-width: 100% !important;
    border-left: none !important;
    border-top: 1px solid #E2E8F0 !important;
    max-height: none !important;
    padding: 16px 12px !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 768px) {
  /* Full-width containers without side clipping */
  #student-section-workspace,
  #student-section-evaluations,
  #student-section-grades,
  #student-section-files {
    padding: 0 10px 24px 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .moodle-block-card {
    padding: 14px 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  .moodle-block-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .moodle-block-header > div:last-child {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    gap: 8px !important;
  }

  #student-timeline-course-select {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 100% !important;
  }

  #student-timeline-search-input {
    flex: 1 1 calc(100% - 110px) !important;
    width: auto !important;
    min-width: 0 !important;
  }

  /* Filter tabs wrap cleanly so all 4 ("Todas", "Por Entregar", "Entregadas", "Vencidas") are visible */
  .student-pending-tabs-bar {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
    overflow-x: visible !important;
    padding-bottom: 4px !important;
  }

  .student-pending-tab-btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 8px 6px !important;
    font-size: 12px !important;
  }

  /* Task cards 100% width with readable wrapped text and zero vertical clipping */
  .student-task-collapsible-card {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  .student-task-body {
    padding: 0 10px 12px 10px !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .student-task-header-content {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .student-task-header-content > div:first-child {
    width: 100% !important;
    min-width: 0 !important;
  }

  .student-task-actions {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 8px !important;
    padding-top: 8px !important;
    border-top: 1px dashed #E2E8F0 !important;
  }

  .moodle-completion-pill {
    white-space: normal !important;
    max-width: 100% !important;
  }

  /* Transform Rubric Table into 100% Responsive Stacked Cards on Mobile */
  .rubric-table,
  .rubric-table tbody,
  .rubric-table tr,
  .rubric-table td {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .rubric-table thead {
    display: none !important;
  }

  .rubric-table tr {
    border: 1px solid #E2E8F0 !important;
    border-radius: 10px !important;
    margin-bottom: 10px !important;
    padding: 10px 12px !important;
    background: #FFFFFF !important;
  }

  .rubric-table td {
    padding: 7px 0 !important;
    border-bottom: 1px dashed #F1F5F9 !important;
    text-align: left !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }

  .rubric-table td:last-child {
    border-bottom: none !important;
  }

  .rubric-table td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 3px;
    color: #475569;
  }

  .rubric-table td[data-label*="Excelente"]::before {
    color: #047857;
  }

  .rubric-table td[data-label*="Satisfactorio"]::before {
    color: #B45309;
  }

  .rubric-table td[data-label*="Deficiente"]::before {
    color: #B91C1C;
  }

  /* Teacher Course Detail Hero & Action Strip on Mobile */
  .lms-course-detail-hero {
    padding: 14px 12px !important;
  }

  .lms-course-hero-stats {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }

  .lms-hero-stat {
    min-width: 0 !important;
    padding: 8px 6px !important;
  }

  .lms-course-action-strip {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .lms-course-action-strip .btn {
    width: 100% !important;
    justify-content: center !important;
    font-size: 11.5px !important;
    padding: 8px 6px !important;
  }

  .lms-course-activity-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  /* Responsive Modals on Mobile & Tablet */
  .modal-overlay .modal-content {
    width: 100% !important;
    max-width: 100vw !important;
    max-height: 92dvh !important;
    padding: 16px 12px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
  }
}

/* 7. Minimalist LMS Overrides for Modals, Sub-tabs, and Wayground Stages */
.wg-live-stage {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1px solid #E2E8F0 !important;
  border-top: 3px solid #0F6CBD !important;
  border-radius: 12px !important;
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08) !important;
}

.wg-game-btn {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1.5px solid #CBD5E1 !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  transition: all 0.15s ease !important;
}

.wg-game-btn:hover:not(:disabled) {
  border-color: #0F6CBD !important;
  background: #EFF6FF !important;
  color: #0F6CBD !important;
  transform: translateY(-1px) !important;
}

.wg-sp-option-card {
  color: #0F172A !important;
  user-select: none;
}

.wg-sp-option-card:hover {
  border-color: #0F6CBD !important;
  background: #F0F9FF !important;
}

.analytics-kpi-tile {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-top: 3px solid #0F6CBD !important;
  border-radius: 10px !important;
  padding: 14px 16px !important;
  box-shadow: none !important;
}

.subject-card {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-top: 3px solid #0F6CBD !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}

/* ============================================================================
   8. MINIMALIST STUDENT DASHBOARD & CLICK-TO-VIEW GRADEBOOK MATRIX (v18.0)
   ============================================================================ */

/* Panel Desplegable de Gestión de Curso al dar clic */
.student-course-mgmt-drawer {
  margin-top: 14px;
  background: #F8FAFC;
  border: 1px solid #BFDBFE;
  border-left: 4px solid #0F6CBD;
  border-radius: 12px;
  padding: 16px 18px;
  animation: fadeSlideDown 0.18s ease-out;
}

@keyframes fadeSlideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.student-course-mgmt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid #E2E8F0;
}

.student-course-mgmt-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.student-course-mgmt-action-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
}

.student-course-mgmt-action-btn:hover {
  border-color: #0F6CBD;
  background: #F8FAFC;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
}

.student-course-mgmt-action-btn.primary-action {
  background: #EFF6FF;
  border-color: #93C5FD;
}

.student-course-mgmt-action-btn.primary-action .mgmt-btn-icon {
  background: #0F6CBD;
  color: #FFFFFF;
}

.mgmt-btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #F1F5F9;
  color: #0F6CBD;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mgmt-btn-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mgmt-btn-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.25;
}

.mgmt-btn-sub {
  font-size: 11px;
  color: #64748B;
  margin-top: 2px;
  line-height: 1.25;
}

/* Badge de Orden Cronológico en Tareas Pendientes */
.chrono-priority-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.chrono-priority-badge.chrono-next-up {
  background: #FFFBEB;
  color: #B45309;
  border-color: #FCD34D;
}

/* Cuadro Minimalista de Calificaciones del Estudiante */
.minimal-subject-grade-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-top: 3px solid #0F6CBD;
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.minimal-subject-grade-card.grade-course-highlight {
  border-color: #0F6CBD;
  box-shadow: 0 0 0 3px rgba(15, 108, 189, 0.18);
}

.minimal-subject-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid #F1F5F9;
}

.minimal-subject-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.minimal-subject-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #EFF6FF;
  color: #0F6CBD;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.minimal-subject-name {
  font-size: 16px;
  font-weight: 800;
  color: #0F172A;
  margin: 0;
}

.minimal-subject-meta {
  font-size: 12px;
  color: #64748B;
  margin: 4px 0 0 0;
}

.minimal-course-avg-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
}

.minimal-course-avg-pill .avg-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748B;
}

.minimal-course-avg-pill .avg-number {
  font-size: 15px;
  font-weight: 800;
  color: #0F172A;
}

.minimal-course-avg-pill.avg-high {
  background: #ECFDF5;
  border-color: #A7F3D0;
}
.minimal-course-avg-pill.avg-high .avg-number {
  color: #047857;
}

.minimal-course-avg-pill.avg-low {
  background: #FEF2F2;
  border-color: #FECACA;
}
.minimal-course-avg-pill.avg-low .avg-number {
  color: #B91C1C;
}

/* Cuadro Matricial en Columnas (Títulos arriba, Calificación abajo) */
.minimal-matrix-strip-wrap {
  margin-top: 14px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 12px 14px;
}

.minimal-matrix-strip-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  margin-bottom: 10px;
}

.minimal-matrix-strip-hint {
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #64748B;
}

.minimal-matrix-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 8px;
}

.minimal-matrix-col {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.15s ease;
}

.minimal-matrix-col:hover {
  border-color: #93C5FD;
  background: #F8FAFC;
  transform: translateY(-1px);
}

.minimal-matrix-col.minimal-matrix-col-active {
  border-color: #0F6CBD;
  background: #EFF6FF;
  box-shadow: 0 0 0 2px rgba(15, 108, 189, 0.12);
}

.minimal-matrix-col-header {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.minimal-matrix-task-index {
  font-size: 10px;
  font-weight: 800;
  color: #0F6CBD;
  background: #EFF6FF;
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}

.minimal-matrix-task-title {
  font-size: 12px;
  font-weight: 700;
  color: #1E293B;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.minimal-matrix-col-grade {
  font-size: 16px;
  font-weight: 800;
  text-align: right;
  padding-top: 6px;
  border-top: 1px dashed #E2E8F0;
}

.minimal-matrix-col-grade small {
  font-size: 11px;
  font-weight: 600;
  color: #64748B;
  margin-left: 1px;
}

.minimal-matrix-col-grade.grade-val-high {
  color: #059669;
}
.minimal-matrix-col-grade.grade-val-low {
  color: #DC2626;
}
.minimal-matrix-col-grade.grade-val-pending {
  font-size: 12px;
  color: #D97706;
}

/* Tabla Minimalista de Tareas y Calificaciones */
.minimal-grades-table-container {
  margin-top: 14px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
}

.minimal-grades-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background: #FFFFFF;
}

.minimal-grades-table thead tr {
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}

.minimal-grades-table th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
}

.minimal-grade-row {
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
  transition: background 0.14s ease;
}

.minimal-grade-row:hover {
  background: #F8FAFC;
}

.minimal-grade-row.minimal-grade-row-active {
  background: #F0F9FF;
}

.minimal-grade-row td {
  padding: 12px 14px;
  vertical-align: middle;
}

.minimal-task-cell-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.minimal-task-num {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #F1F5F9;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.minimal-task-title-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.minimal-task-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.minimal-task-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #0F172A;
}

.minimal-team-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: #EFF6FF;
  color: #0F6CBD;
  border: 1px solid #BFDBFE;
}

.minimal-feedback-indicator {
  font-size: 10.5px;
  font-weight: 600;
  color: #047857;
  background: #ECFDF5;
  padding: 1px 7px;
  border-radius: 999px;
}

.minimal-task-submeta {
  font-size: 11px;
  color: #64748B;
  margin-top: 2px;
}

.minimal-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.minimal-status-chip .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.minimal-grade-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 800;
}

.minimal-grade-pill.high {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.minimal-grade-pill.low {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

.minimal-grade-pill.pending {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
  font-size: 11.5px;
}

.minimal-col-expand {
  text-align: right;
  white-space: nowrap;
}

.minimal-grade-row-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #0F6CBD;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  cursor: pointer;
}

.minimal-grade-row-toggle-btn:hover {
  background: #EFF6FF;
  border-color: #BFDBFE;
}

/* Panel Desplegable de Opciones de Visualización de la Tarea */
.minimal-grade-detail-cell {
  padding: 0 !important;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}

.minimal-grade-detail-drawer {
  padding: 14px 18px;
  border-left: 3px solid #0F6CBD;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.minimal-grade-options-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 9px;
  padding: 10px 14px;
}

.minimal-grade-file-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.file-summary-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: #EFF6FF;
  color: #0F6CBD;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-summary-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #0F172A;
  word-break: break-all;
}

.file-summary-meta {
  font-size: 11px;
  color: #64748B;
  margin-top: 2px;
}

.minimal-grade-action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.minimal-grade-feedback-box {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 9px;
  padding: 12px 14px;
}

.minimal-grade-feedback-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  margin-bottom: 6px;
}

.minimal-grades-empty {
  padding: 22px 16px;
  text-align: center;
  font-size: 13px;
  color: #64748B;
}

@media (max-width: 768px) {
  .minimal-subject-grade-card {
    padding: 14px;
  }
  .minimal-matrix-strip {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  }
  .minimal-col-status {
    display: none;
  }
  .minimal-grade-options-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .minimal-grade-action-buttons {
    width: 100%;
  }
  .minimal-grade-action-buttons .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* ============================================================================
   9. PROFESSIONAL EXECUTIVE INSTITUTIONAL LOGIN PORTAL (v18.5)
   ============================================================================ */

.exec-login-viewport {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  box-sizing: border-box;
  background: radial-gradient(circle at 15% 15%, rgba(15, 108, 189, 0.06) 0%, transparent 45%),
              radial-gradient(circle at 85% 85%, rgba(13, 148, 136, 0.05) 0%, transparent 45%),
              #F1F5F9;
}

.exec-login-shell {
  width: 100%;
  max-width: 1000px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 18px;
  box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  overflow: hidden;
}

/* Columna Izquierda: Identidad Institucional */
.exec-login-brand-panel {
  background: linear-gradient(150deg, #0F172A 0%, #1E3A8A 58%, #0F6CBD 100%);
  color: #FFFFFF;
  padding: 36px 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.exec-login-brand-panel::before {
  content: '';
  position: absolute;
  top: -70px;
  right: -70px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.exec-brand-header-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.exec-logo-wrap {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
}

.exec-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
}

.exec-brand-badge-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.exec-campus-tag {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #93C5FD;
}

.exec-campus-sub {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.exec-brand-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.025em;
  color: #FFFFFF;
  margin: 0 0 8px 0;
  line-height: 1.15;
}

.exec-brand-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 24px 0;
}

.exec-role-selector-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 10px;
}

.exec-role-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exec-role-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
}

.exec-role-card:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateX(2px);
}

.exec-role-card.active {
  background: #FFFFFF;
  border-color: #FFFFFF;
  color: #0F172A;
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.22);
}

.exec-role-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
}

.exec-role-card.active .exec-role-card-icon.blue {
  background: #EFF6FF;
  color: #0F6CBD;
}

.exec-role-card.active .exec-role-card-icon.teal {
  background: #F0FDFA;
  color: #0D9488;
}

.exec-role-card.active .exec-role-card-icon.slate {
  background: #F1F5F9;
  color: #334155;
}

.exec-role-card-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.exec-role-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: inherit;
  line-height: 1.25;
}

.exec-role-card-sub {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 2px;
  line-height: 1.3;
}

.exec-role-card.active .exec-role-card-sub {
  color: #64748B;
}

.exec-role-card-arrow {
  font-size: 15px;
  font-weight: 800;
  opacity: 0.55;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.exec-role-card.active .exec-role-card-arrow {
  opacity: 1;
  color: #0F6CBD;
  transform: translateX(2px);
}

.exec-brand-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.exec-security-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

/* Columna Derecha: Formulario de Inicio de Sesión */
.exec-login-form-panel {
  background: #FFFFFF;
  padding: 36px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.exec-login-form-inner {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

/* Banner de Inactividad */
.exec-inactivity-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #FFFBEB;
  border: 1px solid #FCD34D;
  border-left: 4px solid #D97706;
  border-radius: 10px;
  padding: 11px 13px;
  margin-bottom: 18px;
}

.exec-inactivity-alert-icon {
  color: #D97706;
  flex-shrink: 0;
  margin-top: 1px;
}

.exec-inactivity-alert-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  font-size: 12px;
  color: #92400E;
  line-height: 1.35;
}

.exec-inactivity-alert-body strong {
  font-size: 12.5px;
  font-weight: 800;
  color: #78350F;
}

.exec-inactivity-close {
  background: transparent;
  border: none;
  color: #92400E;
  cursor: pointer;
  font-size: 13px;
  padding: 0 4px;
}

/* Pestañas Segmentadas de Rol */
.exec-role-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: #F1F5F9;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 22px;
  border: 1px solid #E2E8F0;
}

.exec-role-tab {
  background: transparent;
  border: none;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #64748B;
  cursor: pointer;
  transition: all 0.15s ease;
}

.exec-role-tab:hover {
  color: #0F172A;
}

.exec-role-tab.active {
  background: #FFFFFF;
  color: #0F6CBD;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.exec-form-header {
  margin-bottom: 20px;
}

.exec-form-badge-row {
  margin-bottom: 6px;
}

.exec-role-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}

.exec-role-pill.student {
  background: #EFF6FF;
  color: #0F6CBD;
  border: 1px solid #BFDBFE;
}

.exec-role-pill.teacher {
  background: #F0FDFA;
  color: #0D9488;
  border: 1px solid #99F6E4;
}

.exec-role-pill.admin {
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #CBD5E1;
}

.exec-form-title {
  font-size: 22px;
  font-weight: 800;
  color: #0F172A;
  margin: 0 0 4px 0;
  letter-spacing: -0.02em;
}

.exec-form-subtitle {
  font-size: 12.5px;
  color: #64748B;
  margin: 0;
  line-height: 1.45;
}

.exec-credentials-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.exec-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.exec-field-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
}

.exec-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.exec-input-icon {
  position: absolute;
  left: 13px;
  color: #94A3B8;
  display: inline-flex;
  align-items: center;
  pointer-events: none;
}

.exec-input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 38px;
  border: 1.5px solid #CBD5E1;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: #0F172A;
  background: #F8FAFC;
  transition: all 0.16s ease;
  box-sizing: border-box;
}

.exec-input-with-toggle {
  padding-right: 42px;
}

.exec-input:focus {
  outline: none;
  background: #FFFFFF;
  border-color: #0F6CBD;
  box-shadow: 0 0 0 3px rgba(15, 108, 189, 0.14);
}

.exec-pwd-toggle {
  position: absolute;
  right: 8px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: #64748B;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.exec-pwd-toggle:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.exec-login-feedback {
  min-height: 18px;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
}

.exec-submit-btn {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #0F6CBD 0%, #1D4ED8 100%);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 16px -3px rgba(15, 108, 189, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.exec-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -4px rgba(15, 108, 189, 0.45);
}

.exec-submit-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.exec-form-divider {
  position: relative;
  text-align: center;
  margin: 20px 0 14px 0;
}

.exec-form-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #E2E8F0;
}

.exec-form-divider span {
  position: relative;
  background: #FFFFFF;
  padding: 0 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: #94A3B8;
}

.exec-secondary-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exec-secondary-btn,
.exec-install-btn {
  width: 100%;
  height: 40px;
  border-radius: 9px;
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  color: #334155;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.exec-secondary-btn:hover,
.exec-install-btn:hover {
  background: #EFF6FF;
  border-color: #93C5FD;
  color: #0F6CBD;
}

.exec-login-page-footer {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #64748B;
}

.exec-footer-dot {
  opacity: 0.45;
}

.exec-version-pill {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

@media (max-width: 860px) {
  .exec-login-shell {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
  .exec-login-brand-panel {
    padding: 24px 22px;
  }
  .exec-brand-title {
    font-size: 24px;
  }
  .exec-brand-desc {
    font-size: 12.5px;
    margin-bottom: 16px;
  }
  .exec-role-cards-stack {
    display: none;
  }
  .exec-role-selector-label {
    display: none;
  }
  .exec-brand-footer {
    margin-top: 12px;
    padding-top: 12px;
  }
  .exec-login-form-panel {
    padding: 24px 22px;
  }
}

/* ============================================================================
   10. EXECUTIVE 100% RESPONSIVE ARCHITECTURE FOR TEACHER & STUDENT (v19.0)
   ============================================================================ */

/* 10.1 Strict Viewport & Intrinsic Width Containment (Prevents <select>/<table> blowout) */
html,
body,
.app-container {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

#view-teacher,
#view-student,
#view-admin,
.teacher-workspace-shell,
.teacher-main,
#tab-teacher-courses,
#tab-teacher-submissions,
#tab-teacher-workspace,
#teacher-courses-catalog-view,
#teacher-course-detail-view,
.student-minimal-dashboard-shell,
.student-minimal-dashboard-inner,
.moodle-block-card {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

select,
input,
textarea,
.input-glass {
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  text-overflow: ellipsis;
}

/* 10.2 Student Panel Unified Executive Container & Alignment (Desktop & Mobile) */
#view-student {
  background: #F1F5F9;
  min-height: 100vh;
  padding-bottom: 36px;
}

#view-student .student-topbar.moodle-navbar-top {
  width: calc(100% - 48px) !important;
  max-width: 1380px !important;
  margin: 18px auto 0 auto !important;
  padding: 14px 22px !important;
  background: #FFFFFF !important;
  border: 1px solid #CBD5E1 !important;
  border-bottom: 1px solid #E2E8F0 !important;
  border-radius: 14px 14px 0 0 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03) !important;
  box-sizing: border-box !important;
}

#view-student .student-subnav-container.moodle-secondary-nav {
  width: calc(100% - 48px) !important;
  max-width: 1380px !important;
  margin: 0 auto 20px auto !important;
  padding: 8px 16px !important;
  background: #FFFFFF !important;
  border: 1px solid #CBD5E1 !important;
  border-top: none !important;
  border-radius: 0 0 14px 14px !important;
  box-shadow: 0 6px 16px -6px rgba(15, 23, 42, 0.06) !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  box-sizing: border-box !important;
}

#student-live-alert-banner {
  width: calc(100% - 48px) !important;
  max-width: 1380px !important;
  margin: 12px auto 12px auto !important;
  box-sizing: border-box !important;
}

.student-minimal-dashboard-shell,
#student-section-evaluations,
#student-section-grades,
#student-section-files {
  width: calc(100% - 48px) !important;
  max-width: 1380px !important;
  margin: 0 auto !important;
  padding: 0 0 28px 0 !important;
  box-sizing: border-box !important;
}

.student-minimal-dashboard-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.moodle-courses-overview-grid,
#student-enrolled-courses-chips {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)) !important;
  gap: 14px !important;
  width: 100% !important;
}

.student-timeline-filters-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

#student-timeline-course-select {
  height: 36px;
  font-size: 12.5px;
  padding: 4px 10px;
  width: 220px;
  max-width: 100% !important;
  min-width: 0 !important;
}

#student-timeline-search-input {
  height: 36px;
  font-size: 12.5px;
  padding: 4px 12px;
  width: 190px;
  max-width: 100% !important;
  min-width: 0 !important;
}

/* 10.3 Teacher Panel Executive Layout (Desktop, Tablet & Mobile) */
#view-teacher.teacher-container {
  grid-template-columns: 256px minmax(0, 1fr) !important;
  min-height: 100vh;
  width: 100% !important;
  max-width: 100vw !important;
  background: #F1F5F9;
}

#view-teacher .sidebar {
  background: #FFFFFF;
  border-right: 1px solid #CBD5E1;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  box-sizing: border-box;
  z-index: 40;
}

#view-teacher .sidebar > div:first-child {
  min-width: 0;
  width: 100%;
}

.teacher-workspace-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  min-height: 100vh;
  width: 100%;
  background: #F1F5F9;
}

.teacher-workspace-shell.teacher-shell-fullwidth {
  grid-template-columns: minmax(0, 1fr) !important;
}

.teacher-workspace-shell .teacher-main {
  padding: 24px 28px;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Top 4-KPI Strip inside Teacher Courses Catalog */
.teacher-catalog-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}

.teacher-kpi-mini-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 11px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  transition: all 0.16s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  min-width: 0;
}

.teacher-kpi-mini-card:hover {
  border-color: #93C5FD;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.teacher-kpi-mini-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.teacher-kpi-mini-dot.teal { background: #0D9488; box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.14); }
.teacher-kpi-mini-dot.blue { background: #0F6CBD; box-shadow: 0 0 0 4px rgba(15, 108, 189, 0.14); }
.teacher-kpi-mini-dot.amber { background: #D97706; box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.14); }
.teacher-kpi-mini-dot.green { background: #10B981; box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14); }

.teacher-kpi-mini-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.teacher-kpi-mini-val {
  font-size: 19px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.1;
}

.teacher-kpi-mini-lbl {
  font-size: 11px;
  font-weight: 600;
  color: #64748B;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Teacher Courses Grid */
#teacher-courses-grid,
.teacher-courses-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 285px), 1fr)) !important;
  gap: 16px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.lms-minimal-course-card {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  word-break: break-word;
}

/* Teacher Submissions Header & Filter Bar */
.teacher-submissions-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  margin-bottom: 16px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-top: 3px solid #0F6CBD;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.teacher-sub-filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.teacher-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.teacher-filter-group .form-label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  flex-shrink: 0;
}

.teacher-filter-group select,
.teacher-filter-group input {
  flex: 1 1 0%;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 36px;
  font-size: 12.5px;
  padding: 4px 10px;
}

.teacher-submissions-card-shell {
  padding: 16px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

/* Hide redundant Right Drawer on <= 1240px so Center Workspace has full breathing room */
@media (max-width: 1240px) {
  .teacher-workspace-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  #teacher-right-drawer {
    display: none !important;
  }
  .teacher-sub-filter-bar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* 10.4 Tablet & "Modo de Escritorio" (<= 1024px) Unified Responsive Layout */
@media (max-width: 1024px) {
  #view-teacher.teacher-view-active {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
  }

  #view-teacher .sidebar {
    position: sticky !important;
    top: 0 !important;
    height: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 14px !important;
    border-right: none !important;
    border-bottom: 1px solid #CBD5E1 !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05) !important;
    gap: 10px !important;
  }

  #view-teacher .sidebar-user-info {
    margin-bottom: 10px !important;
    width: 100% !important;
  }

  #view-teacher .sidebar-logout-mobile-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
  }

  #view-teacher .sidebar-logout-desktop-btn {
    display: none !important;
  }

  /* 3-Column Segmented Navigation Bar (All 3 tabs 100% visible, no cut-off) */
  #view-teacher .sidebar-nav {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    width: 100% !important;
    background: #F1F5F9 !important;
    padding: 4px !important;
    border-radius: 10px !important;
    border: 1px solid #E2E8F0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  #view-teacher .sidebar-btn {
    width: 100% !important;
    min-width: 0 !important;
    height: 38px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
    justify-content: center !important;
    text-align: center !important;
    border-radius: 7px !important;
    gap: 6px !important;
    overflow: hidden !important;
  }

  #view-teacher .sidebar-btn span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  #view-teacher .sidebar-btn.active {
    background: #FFFFFF !important;
    color: #0F6CBD !important;
    border: 1px solid #CBD5E1 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
  }

  .teacher-workspace-shell .teacher-main {
    padding: 16px 14px 28px 14px !important;
    max-height: none !important;
    overflow-y: visible !important;
    width: 100% !important;
  }
}

/* 10.5 Teacher Submissions Table -> Responsive Executive Cards on <= 900px */
@media (max-width: 900px) {
  .teacher-submissions-table-wrap {
    border: none !important;
    background: transparent !important;
    overflow-x: visible !important;
  }

  .teacher-submissions-table,
  .teacher-submissions-table tbody {
    display: block !important;
    width: 100% !important;
  }

  .teacher-submissions-table thead {
    display: none !important;
  }

  .teacher-submissions-table tr.teacher-submission-row {
    display: block !important;
    background: #FFFFFF !important;
    border: 1px solid #CBD5E1 !important;
    border-left: 4px solid #0F6CBD !important;
    border-radius: 10px !important;
    padding: 12px 14px !important;
    margin-bottom: 12px !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04) !important;
    box-sizing: border-box !important;
  }

  .teacher-submissions-table tr.teacher-submission-row td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 6px 0 !important;
    border-bottom: 1px dashed #F1F5F9 !important;
    max-width: 100% !important;
    width: 100% !important;
    white-space: normal !important;
    text-align: right !important;
    box-sizing: border-box !important;
  }

  .teacher-submissions-table tr.teacher-submission-row td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748B;
    text-align: left;
    flex-shrink: 0;
  }

  .teacher-submissions-table tr.teacher-submission-row td.ts-cell-student {
    align-items: flex-start !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #E2E8F0 !important;
    margin-bottom: 4px !important;
  }

  .teacher-submissions-table tr.teacher-submission-row td.ts-cell-file {
    word-break: break-all !important;
    font-size: 12px !important;
  }

  .teacher-submissions-table tr.teacher-submission-row td.ts-cell-actions {
    border-bottom: none !important;
    padding-top: 10px !important;
    margin-top: 4px !important;
    border-top: 1px solid #E2E8F0 !important;
    justify-content: stretch !important;
  }

  .teacher-submissions-table tr.teacher-submission-row td.ts-cell-actions::before {
    display: none !important;
  }

  .teacher-submissions-table .ts-actions-btn-group {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .teacher-submissions-table .ts-actions-btn-group .btn,
  .teacher-submissions-table .ts-actions-btn-group a.btn {
    flex: 1 1 auto !important;
    justify-content: center !important;
    min-height: 36px !important;
  }
}

/* 10.6 Mobile Phone Optimization (<= 768px) for Student & Teacher Panels */
@media (max-width: 768px) {
  /* Student Unified Mobile Header + 2x2 Subnav */
  #view-student .student-topbar.moodle-navbar-top {
    width: calc(100% - 20px) !important;
    margin: 10px auto 0 auto !important;
    padding: 12px 14px !important;
    border-radius: 12px 12px 0 0 !important;
    gap: 10px !important;
  }

  #view-student .topbar-buttons-block {
    display: grid !important;
    grid-template-columns: 1fr 1fr auto !important;
    gap: 6px !important;
    width: 100% !important;
  }

  #view-student .topbar-buttons-block .btn {
    width: 100% !important;
    min-height: 36px !important;
    padding: 6px 8px !important;
    font-size: 11.5px !important;
    justify-content: center !important;
  }

  #view-student .student-subnav-container.moodle-secondary-nav {
    width: calc(100% - 20px) !important;
    margin: 0 auto 14px auto !important;
    padding: 8px !important;
    border-radius: 0 0 12px 12px !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  #view-student .student-subnav-container .nav-tab-pill {
    width: 100% !important;
    min-width: 0 !important;
    justify-content: center !important;
    padding: 8px 6px !important;
    font-size: 11.5px !important;
    min-height: 38px !important;
    border: 1px solid #E2E8F0 !important;
    background: #F8FAFC !important;
  }

  #view-student .student-subnav-container .nav-tab-pill span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  #student-live-alert-banner,
  .student-minimal-dashboard-shell,
  #student-section-evaluations,
  #student-section-grades,
  #student-section-files {
    width: calc(100% - 20px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 0 24px 0 !important;
  }

  .student-minimal-dashboard-inner {
    gap: 14px !important;
  }

  .student-timeline-filters-bar {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 8px !important;
  }

  #student-timeline-course-select {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  #student-timeline-search-input {
    width: 100% !important;
  }

  .student-course-mgmt-actions-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  /* Teacher Mobile Catalog & Grader Refinements */
  .teacher-catalog-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }

  .teacher-kpi-mini-card {
    padding: 10px 12px !important;
    gap: 8px !important;
  }

  .teacher-kpi-mini-val {
    font-size: 16px !important;
  }

  .teacher-kpi-mini-lbl {
    font-size: 10.5px !important;
  }

  .teacher-submissions-header {
    padding: 14px 12px !important;
    gap: 10px !important;
  }

  .teacher-sub-filter-bar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .teacher-filter-group {
    width: 100% !important;
    min-width: 0 !important;
  }

  .teacher-filter-group .form-label {
    min-width: 48px !important;
  }

  .teacher-submissions-card-shell {
    padding: 10px !important;
  }

  /* Student Minimalist Gradebook Table on Mobile */
  .minimal-matrix-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  .minimal-grade-row td {
    padding: 10px 8px !important;
  }

  .minimal-task-name {
    font-size: 12.5px !important;
    word-break: break-word !important;
  }
}

@media (max-width: 420px) {
  #view-teacher .sidebar-btn svg {
    display: none !important;
  }
  #view-teacher .sidebar-btn {
    font-size: 11px !important;
    padding: 0 4px !important;
  }
}

/* ================= STRICT VIEW SEPARATION GUARDS ================= */
#view-home:not(.home-view-active),
#view-student:not(.student-view-active),
#view-teacher:not(.teacher-view-active),
#view-admin:not(.admin-view-active) {
  display: none !important;
}

#view-home.home-view-active {
  display: flex !important;
}

#view-student.student-view-active {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
}

#view-admin.admin-view-active {
  display: block !important;
}


/* ================= TAREAS: PILL & AUDITORÍA DE VISUALIZACIONES ================= */
.moodle-views-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.2;
  background: #F0F9FF;
  color: #0284C7;
  border: 1px solid #BAE6FD;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.moodle-views-pill:hover {
  background: #E0F2FE;
  border-color: #7DD3FC;
  color: #0369A1;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(2, 132, 199, 0.15);
}

.asgn-view-student-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #F1F5F9;
  transition: background 0.15s ease;
  gap: 12px;
}
.asgn-view-student-row:hover {
  background: #F8FAFC;
}
.asgn-view-student-row:last-child {
  border-bottom: none;
}


/* ================= BLINDAJE ANTICOPIA Y PROTECCIÓN DE EXÁMENES ================= */
.no-select-exam,
.no-select-exam *:not(input):not(textarea) {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

.no-select-exam input,
.no-select-exam textarea {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

/* Desenfoque de seguridad inmediato si el alumno cambia de ventana o intenta captura */
.exam-security-blur {
  filter: blur(16px) !important;
  opacity: 0.25 !important;
  pointer-events: none !important;
  transition: filter 0.15s ease, opacity 0.15s ease !important;
  user-select: none !important;
}

/* Cronómetro Interactivo con opción de ocultar */
.wg-sp-timer-clickable {
  transition: all 0.2s ease;
  user-select: none !important;
  -webkit-user-select: none !important;
}
.wg-sp-timer-clickable:hover {
  transform: scale(1.03);
  filter: brightness(0.97);
}

/* Bloqueo total de impresión y salida a PDF */
@media print {
  body {
    display: none !important;
    visibility: hidden !important;
  }
  html:after {
    content: "EVALUACIÓN PROTEGIDA: La impresión o captura a PDF de este examen se encuentra estrictamente prohibida por las normas académicas.";
    display: block !important;
    text-align: center !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    color: #DC2626 !important;
    padding: 120px 40px !important;
    font-family: sans-serif !important;
  }
}

/* Modo Kiosco / Pantalla Completa Absoluta para Exámenes Seguros */
#modal-wayground-self-paced.wg-sp-kiosk-mode {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #F1F5F9 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 100000 !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#modal-wayground-self-paced.wg-sp-kiosk-mode #wg-sp-modal-content {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  min-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  padding: 20px 40px !important;
  background: #F8FAFC !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
  opacity: 1 !important;
  transform: none !important;
}

#modal-wayground-self-paced.wg-sp-kiosk-mode #wg-sp-question-wrapper {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}
#modal-wayground-self-paced.wg-sp-kiosk-mode #wg-sp-pin-container {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}
#modal-wayground-self-paced.wg-sp-kiosk-mode #wg-sp-result-container {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}


/* -------------------------------------------------------------------------
   MONITOREO DE USUARIOS EN LÍNEA Y CONEXIONES (PANEL DERECHO DOCENTE)
   ------------------------------------------------------------------------- */
@keyframes onlinePulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.teacher-activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  gap: 8px;
  transition: all 0.15s ease;
}

.teacher-activity-item:hover {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}


/* -------------------------------------------------------------------------
   ELEGANT USER ACTIVITY COMPONENT (PANEL DERECHO DOCENTE)
   ------------------------------------------------------------------------- */
.user-activity-card {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 12px !important;
  padding: 14px 14px 12px 14px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03) !important;
}

.activity-refresh-btn:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
  border-color: #CBD5E1 !important;
  transform: rotate(180deg);
}

.user-activity-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  background: transparent;
  transition: all 0.15s ease;
  cursor: default;
}

.user-activity-row:hover {
  background: #F8FAFC !important;
}

.user-avatar-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.user-avatar.role-teacher {
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%) !important;
  color: #FFFFFF !important;
}

.user-avatar.role-student {
  background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%) !important;
  color: #FFFFFF !important;
}

.user-avatar.role-admin {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
  color: #FFFFFF !important;
}

.user-status-dot {
  position: absolute;
  bottom: -0.5px;
  right: -0.5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}

.user-status-dot.online {
  background: #10B981 !important;
}

.user-status-dot.offline {
  background: #94A3B8 !important;
}

.user-info-col {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5px;
}

.user-name-line {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.user-you-tag {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #0284C7;
  background: #E0F2FE;
  padding: 1px 4.5px;
  border-radius: 4px;
  flex-shrink: 0;
}

.user-meta-line {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 11px;
  color: #64748B;
  line-height: 1.2;
}

.user-role-text {
  font-weight: 500;
  flex-shrink: 0;
}

.user-course-dot {
  color: #CBD5E1;
  flex-shrink: 0;
}

.user-course-text {
  color: #0D9488;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.user-time-col {
  flex-shrink: 0;
  text-align: right;
  font-size: 10.5px;
}

.user-badge-online-now {
  color: #15803D;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.user-time-ago {
  color: #64748B;
  font-weight: 500;
}


/* -------------------------------------------------------------------------
   MOODLE 4.X SUITE: UNIDADES TEMÁTICAS, AVISOS Y GRADEBOOK PONDERADO
   ------------------------------------------------------------------------- */
.moodle-course-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #E2E8F0;
  margin-top: 18px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.moodle-tab-pill {
  border: none;
  background: transparent;
  color: #64748B;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.moodle-tab-pill:hover {
  color: #0F6CBD;
}

.moodle-tab-pill.active {
  color: #0F6CBD;
  font-weight: 700;
  border-bottom-color: #0F6CBD;
  background: rgba(15, 108, 189, 0.04);
  border-radius: 6px 6px 0 0;
}

/* Announcements Card */
.moodle-announcement-banner {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-left: 4px solid #D97706;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.moodle-announcement-banner.urgent {
  background: #FEF2F2;
  border-color: #FECACA;
  border-left-color: #DC2626;
}

/* Units / Modules Cards */
.moodle-unit-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.moodle-unit-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.moodle-unit-header {
  padding: 12px 16px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.moodle-unit-title {
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 8px;
}

.moodle-unit-body {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Moodle Activity Row */
.moodle-activity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: #FFFFFF;
  border: 1px solid #F1F5F9;
  border-radius: 8px;
  gap: 12px;
  transition: all 0.15s ease;
}

.moodle-activity-row:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  transform: translateX(2px);
}

.moodle-activity-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.moodle-activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.moodle-activity-icon.task {
  background: #EFF6FF;
  color: #0F6CBD;
}

.moodle-activity-icon.quiz {
  background: #FDF2F8;
  color: #DB2777;
}

.moodle-activity-info {
  min-width: 0;
  flex: 1;
}

.moodle-activity-title {
  font-size: 13px;
  font-weight: 600;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.moodle-activity-title:hover {
  color: #0F6CBD;
  text-decoration: underline;
}

.moodle-activity-meta {
  font-size: 11px;
  color: #64748B;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
  flex-wrap: wrap;
}

/* Student Progress Bar */
.moodle-progress-wrapper {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.moodle-progress-bar-bg {
  flex: 1;
  min-width: 140px;
  height: 9px;
  background: #E2E8F0;
  border-radius: 9999px;
  overflow: hidden;
}

.moodle-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981 0%, #059669 100%);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

/* Gradebook Table */
.moodle-gradebook-table-wrap {
  overflow-x: auto;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  background: #FFFFFF;
}

.moodle-gradebook-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.moodle-gradebook-table th {
  background: #F8FAFC;
  padding: 10px 12px;
  font-weight: 700;
  color: #334155;
  border-bottom: 1px solid #E2E8F0;
  white-space: nowrap;
}

.moodle-gradebook-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #F1F5F9;
  color: #1E293B;
  white-space: nowrap;
}

.moodle-gradebook-table tr:hover td {
  background: #F8FAFC;
}


/* ================= MOODLE 4.X ACTIVITIES & RESOURCES CHOOSER ================= */
.moodle-catalog-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.moodle-catalog-card:hover {
  border-color: #0F6CBD;
  background: #F8FAFC;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 108, 189, 0.08);
}

.moodle-catalog-card .catalog-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.moodle-catalog-card .catalog-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.moodle-catalog-card .catalog-info strong {
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 2px;
}

.moodle-catalog-card .catalog-info span {
  font-size: 11px;
  color: #64748B;
  line-height: 1.3;
}

.forum-thread-post {
  padding: 14px 16px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  margin-bottom: 12px;
}

.forum-thread-post.is-reply {
  margin-left: 20px;
  border-left: 3px solid #0D9488;
  background: #F8FAFC;
}

.forum-post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
}

.forum-author-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.forum-author-badge.teacher {
  background: #FEF3C7;
  color: #92400E;
}

.forum-author-badge.student {
  background: #EFF6FF;
  color: #1E40AF;
}

.forum-post-message {
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}


/* ================= MOODLE ACTIVITY ROWS PROFESSIONAL LAYOUT ================= */
.moodle-activity-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 12px 16px !important;
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 10px !important;
  margin-bottom: 8px !important;
  gap: 16px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.moodle-activity-row:hover {
  border-color: #CBD5E1 !important;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05) !important;
  transform: translateY(-1px) !important;
}

.moodle-activity-left {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.moodle-activity-icon {
  width: 38px !important;
  height: 38px !important;
  border-radius: 9px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 16px !important;
  flex-shrink: 0 !important;
}

.moodle-activity-info {
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.moodle-activity-title {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #0F172A !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  cursor: pointer !important;
  line-height: 1.3 !important;
}

.moodle-activity-title:hover {
  color: #0F6CBD !important;
}

.moodle-activity-meta {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 11.5px !important;
  color: #64748B !important;
  margin-top: 3px !important;
  flex-wrap: wrap !important;
}

/* Cluster de Acciones Integrado y Alineado Horizontalmente */
.moodle-activity-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
  flex-wrap: nowrap !important;
}

.moodle-unit-select-pill {
  font-size: 11.5px !important;
  font-weight: 500 !important;
  color: #475569 !important;
  background: #F8FAFC !important;
  border: 1px solid #CBD5E1 !important;
  border-radius: 6px !important;
  padding: 3px 8px !important;
  height: 30px !important;
  max-width: 140px !important;
  cursor: pointer !important;
  outline: none !important;
  transition: border-color 0.15s !important;
}

.moodle-unit-select-pill:hover,
.moodle-unit-select-pill:focus {
  border-color: #0F6CBD !important;
}

.btn-moodle-action {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  padding: 4px 12px !important;
  height: 30px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.btn-moodle-action.primary {
  background: #0F6CBD !important;
  color: #FFFFFF !important;
  border: 1px solid #0F6CBD !important;
}

.btn-moodle-action.primary:hover {
  background: #0D5CA0 !important;
}

.btn-moodle-action.pdf {
  background: #DC2626 !important;
  color: #FFFFFF !important;
  border: 1px solid #B91C1C !important;
}

.btn-moodle-action.pdf:hover {
  background: #B91C1C !important;
}

.btn-moodle-action.video {
  background: #E11D48 !important;
  color: #FFFFFF !important;
  border: 1px solid #BE123C !important;
}

.btn-moodle-action.video:hover {
  background: #BE123C !important;
}

.btn-moodle-action.forum {
  background: #0D9488 !important;
  color: #FFFFFF !important;
  border: 1px solid #0F766E !important;
}

.btn-moodle-action.forum:hover {
  background: #0F766E !important;
}

.btn-moodle-action.link {
  background: #2563EB !important;
  color: #FFFFFF !important;
  border: 1px solid #1D4ED8 !important;
}

.btn-moodle-action.link:hover {
  background: #1D4ED8 !important;
}

.btn-moodle-action.page {
  background: #059669 !important;
  color: #FFFFFF !important;
  border: 1px solid #047857 !important;
}

.btn-moodle-action.page:hover {
  background: #047857 !important;
}

.btn-moodle-copy {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  background: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
  padding: 4px 9px !important;
  height: 30px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.15s !important;
}

.btn-moodle-copy:hover {
  background: #E2E8F0 !important;
  color: #0F172A !important;
  border-color: #94A3B8 !important;
}

.btn-moodle-delete {
  color: #94A3B8 !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s !important;
  font-size: 13px !important;
  padding: 0 !important;
}

.btn-moodle-delete:hover {
  color: #DC2626 !important;
  background: #FEE2E2 !important;
  border-color: #FECACA !important;
}


/* ================= MOODLE 100% RESPONSIVE RULES ================= */
@media (max-width: 768px) {
  .moodle-activity-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px 14px !important;
  }

  .moodle-activity-left {
    width: 100% !important;
    min-width: 0 !important;
  }

  .moodle-activity-title {
    white-space: normal !important;
    word-break: break-word !important;
    font-size: 13.5px !important;
    line-height: 1.35 !important;
  }

  .moodle-activity-meta {
    margin-top: 4px !important;
    gap: 6px !important;
  }

  .moodle-activity-actions {
    width: 100% !important;
    border-top: 1px solid #F1F5F9 !important;
    padding-top: 8px !important;
    margin-top: 2px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
  }

  .btn-moodle-action {
    flex: 1 1 auto !important;
    justify-content: center !important;
    min-width: 0 !important;
    text-align: center !important;
  }

  .moodle-unit-select-pill {
    flex: 0 1 130px !important;
    max-width: 140px !important;
    min-width: 95px !important;
  }

  .btn-moodle-copy {
    flex-shrink: 0 !important;
  }

  .btn-moodle-delete {
    flex-shrink: 0 !important;
  }

  .moodle-unit-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .moodle-unit-header > div:last-child {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: flex-end !important;
  }
}

@media (max-width: 480px) {
  .moodle-activity-row {
    padding: 10px 12px !important;
    gap: 8px !important;
    border-radius: 8px !important;
  }

  .moodle-activity-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 14px !important;
  }

  .moodle-activity-title {
    font-size: 13px !important;
  }

  .moodle-activity-actions {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .btn-moodle-action {
    width: 100% !important;
    flex: 1 1 100% !important;
    order: 1 !important;
    height: 32px !important;
  }

  .moodle-unit-select-pill {
    flex: 1 1 auto !important;
    max-width: none !important;
    min-width: 0 !important;
    order: 2 !important;
    height: 32px !important;
  }

  .btn-moodle-copy {
    order: 3 !important;
    height: 32px !important;
  }

  .btn-moodle-delete {
    order: 4 !important;
    height: 32px !important;
    width: 32px !important;
  }

  .moodle-progress-wrapper {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
}

/* ================= AI DIDACTIC BANNER & CARD STYLES ================= */
.moodle-ai-catalog-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.15) !important;
  border-color: #4F46E5 !important;
}

.ai-act-type-card:hover {
  border-color: #6366F1 !important;
  background: #F8FAFC !important;
}

/* Moodle Edit Button */
.btn-moodle-edit {
  color: #475569 !important;
  background: #F8FAFC !important;
  border: 1px solid #CBD5E1 !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s !important;
  font-size: 13px !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
}

.btn-moodle-edit:hover {
  color: #0F6CBD !important;
  background: #EFF6FF !important;
  border-color: #93C5FD !important;
}

@media (max-width: 480px) {
  .btn-moodle-edit {
    order: 4 !important;
    height: 32px !important;
    width: 32px !important;
  }
  .btn-moodle-delete {
    order: 5 !important;
  }
}

/* ================= NOTIFICACIONES PUSH & CAMPUS VIRTUAL ================= */
.notif-bell-btn {
  position: relative !important;
  color: #334155 !important;
  border: 1px solid #CBD5E1 !important;
  border-radius: 8px !important;
  background: #FFFFFF !important;
  transition: all 0.15s ease !important;
}

.notif-bell-btn:hover {
  background: #F8FAFC !important;
  border-color: #0F6CBD !important;
  color: #0F6CBD !important;
}

.notif-badge-counter {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #DC2626;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.4);
  line-height: 1;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.notif-item:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  transform: translateX(2px);
}

.notif-item.unread {
  background: #F0F9FF;
  border-color: #BAE6FD;
}

.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0284C7;
}

.notif-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.notif-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.notif-toast {
  pointer-events: auto;
  background: #0F172A;
  color: #FFFFFF;
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 360px;
  animation: slide-in-toast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 4px solid #0F6CBD;
}

@keyframes slide-in-toast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Enhancements for Forum Threads & Replies */
.forum-thread-post {
  transition: all 0.2s ease;
}
.forum-thread-post:hover {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}
.forum-thread-post.is-reply {
  position: relative;
}

/* ================= FORO INSTITUCIONAL PROFESIONAL Y RESPONSIVE ================= */
.btn-forum-tab {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
}
.btn-forum-tab:hover {
  background: #EEF2FF;
  border-color: #C7D2FE;
  color: #1E3A8A;
}
.btn-forum-tab.active {
  background: #2563EB !important;
  border-color: #1D4ED8 !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2) !important;
}
.btn-forum-tab.active .badge {
  background: rgba(255, 255, 255, 0.3) !important;
  color: #FFFFFF !important;
}

.forum-thread-post.forum-post-teacher {
  background: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 100%) !important;
  border: 2px solid #BFDBFE !important;
  border-left: 6px solid #2563EB !important;
  border-radius: 10px !important;
  box-shadow: 0 3px 6px rgba(37, 99, 235, 0.08) !important;
}
.forum-thread-post.forum-post-teacher .forum-author-badge {
  background: #2563EB !important;
  color: #FFFFFF !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  padding: 3px 8px !important;
  border-radius: 5px !important;
}

.forum-thread-post.forum-post-student {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 10px !important;
}

@media (max-width: 640px) {
  #modal-moodle-forum-thread .modal-content {
    width: 98% !important;
    padding: 14px 12px !important;
    max-height: 94vh !important;
  }
  .forum-thread-post.is-reply {
    margin-left: 10px !important;
  }
  #forum-nav-tabs {
    width: 100% !important;
    overflow-x: auto !important;
    padding-bottom: 4px !important;
    flex-wrap: nowrap !important;
  }
  #input-forum-search {
    max-width: 100% !important;
  }
}
