/* ───── Variables ───── */
:root {
  --sidebar-w: 260px;
  --sidebar-bg: #e8f0f7;
  --sidebar-hover: #d4e5f7;
  --sidebar-active: #c2dff0;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --topbar-h: 60px;
  --text-muted-custom: #94a3b8;
  --card-shadow: 0 2px 12px rgba(0,0,0,.08);
}

/* ───── Reset base ───── */
*, *::before, *::after { box-sizing: border-box; }
body:not(.login-page) {
  font-family: 'Inter', sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ───── Sidebar ───── */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

/* Logo area */
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
  background: #e8f0f7;
}
.sidebar-logo img {
  width: 100%;
  max-height: 56px;
  object-fit: contain;
}

/* Nav */
.sidebar-nav {
  padding: 12px 0;
  flex: 1;
}
.nav-label {
  color: #2c5aa0;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 16px 20px 6px;
}
.sidebar-nav .nav-link {
  color: #0a1929;
  padding: 9px 20px;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .845rem;
  font-weight: 500;
  transition: background .2s, color .2s;
  cursor: pointer;
}
.sidebar-nav .nav-link i { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-nav .nav-link:hover { background: var(--sidebar-hover); color: #0a1929; }
.sidebar-nav .nav-link.active { background: var(--sidebar-active); color: #2c5aa0; border-left: 3px solid var(--accent); }
.sidebar-nav .nav-link .arrow {
  margin-left: auto;
  font-size: .7rem;
  transition: transform .25s;
}
.sidebar-nav .nav-link[aria-expanded="true"] .arrow { transform: rotate(90deg); }

/* Submenu */
.submenu { background: rgba(255,255,255,.03); }
.submenu .nav-link {
  padding: 7px 20px 7px 48px;
  font-size: .8rem;
  font-weight: 400;
  color: #0f172a;
}
.submenu .nav-link::before {
  content: '';
  width: 5px; height: 5px;
  background: #475569;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
}
.submenu .nav-link:hover { color: #0a1929; }
.submenu .nav-link:hover::before { background: var(--accent); }
.submenu .nav-link.active { color: #0a1929; }
.submenu .nav-link.active::before { background: var(--accent); }

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(0,0,0,.08);
  flex-shrink: 0;
}
.sidebar-footer .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #0a1929;
}
.sidebar-footer .avatar {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; color: #fff;
  flex-shrink: 0;
}
.sidebar-footer .user-name { font-size: .82rem; font-weight: 600; color: #0a1929; }
.sidebar-footer .user-role { font-size: .7rem; color: #2c5aa0; }
.sidebar-footer .btn-logout {
  background: #1e293b;
  color: #f8fafc;
}
.sidebar-footer .btn-logout:hover {
  background: #0f172a;
  color: #fff;
}

.evaluation-timer-sticky {
  position: fixed;
  top: calc(var(--topbar-h) + 14px);
  right: 18px;
  z-index: 1035;
  background: linear-gradient(135deg, #0b4f8a 0%, #0ea5b7 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 10px 14px;
  min-width: 220px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.evaluation-timer-sticky .small {
  line-height: 1.1;
  color: rgba(255, 255, 255, 0.86) !important;
}

.evaluation-timer-sticky .fw-semibold {
  font-size: 0.98rem;
  color: #ffffff;
}

.evaluation-timer-sticky #evaluacionTiempoRestante {
  font-weight: 800;
  font-size: 1.02rem;
  color: #ffffff;
}

/* ───── Topbar ───── */
#topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: #d4e5f7;
  border-bottom: 1px solid #b8d4f0;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  z-index: 1030;
  transition: left .3s;
}
#topbar .page-title { font-size: 1rem; font-weight: 600; color: #1e293b; flex: 1; }
#topbar .topbar-actions { display: flex; align-items: center; gap: 8px; }
.btn-topbar {
  width: 36px; height: 36px;
  border: none; background: #f1f5f9;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #64748b; cursor: pointer;
  position: relative;
  transition: background .2s;
}
.btn-topbar:hover { background: #e2e8f0; color: #1e293b; }
.user-menu .user-menu-toggle {
  border: none;
  background: #f1f5f9;
  border-radius: 10px;
  height: 36px;
  padding: 0 10px 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1e293b;
  font-size: .8rem;
  font-weight: 600;
}
.user-menu .user-menu-toggle:hover {
  background: #e2e8f0;
}
.user-menu .user-menu-toggle::after {
  margin-left: 2px;
}
.user-menu .avatar {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .75rem;
  color: #fff;
}
.user-menu-dropdown {
  border: 1px solid #d9e7f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
}
.user-menu-dropdown .dropdown-item {
  font-size: .82rem;
}
.badge-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 8px; height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 1.5px solid #fff;
}

/* ───── Notificaciones panel ───── */
.notif-dropdown { position: relative; }
.notif-panel {
  width: 340px;
  max-height: 420px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d9e7f0;
  box-shadow: 0 8px 24px rgba(15,23,42,.14);
  border-radius: 12px;
}
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-weight: 600;
  font-size: .88rem;
  border-bottom: 1px solid #e9eff5;
  background: #f8fafc;
}
.btn-notif-clear {
  background: none;
  border: none;
  font-size: .75rem;
  color: var(--primary, #0ea5e9);
  cursor: pointer;
  padding: 0;
}
.btn-notif-clear:hover { text-decoration: underline; }
.notif-list {
  overflow-y: auto;
  max-height: 360px;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f1f5f9;
}

.evaluation-question.empty-question {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.18), 0 8px 20px rgba(220, 38, 38, 0.08);
  background: rgba(254, 242, 242, 0.92);
}

.evaluation-question.empty-question .fw-semibold {
  color: #991b1b;
}

.evaluation-question.empty-question .form-check-label {
  color: #7f1d1d;
}

.evaluation-question.empty-question .form-check-input {
  border-color: #dc2626;
}

.evaluation-result-item.correct {
  background: #ecfdf5;
  border-left: 4px solid #16a34a;
  color: #14532d;
}

.evaluation-result-item.incorrect {
  background: #fef2f2;
  border-left: 4px solid #dc2626;
  color: #7f1d1d;
}

.evaluation-result-item.unanswered {
  background: #f8fafc;
  border-left: 4px solid #94a3b8;
  color: #334155;
}

.usr-calendar-card #usrCalendarioCursos {
  min-height: 520px;
}

.usr-calendar-card .fc {
  --fc-border-color: #d9e7f0;
  --fc-button-bg-color: #0ea5e9;
  --fc-button-border-color: #0284c7;
  --fc-button-hover-bg-color: #0284c7;
  --fc-button-hover-border-color: #0369a1;
  --fc-button-active-bg-color: #0369a1;
  --fc-button-active-border-color: #0c4a6e;
}

.usr-calendar-card .fc .fc-toolbar-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.usr-calendar-card .fc .fc-col-header-cell-cushion {
  color: #334155;
  font-weight: 600;
  text-transform: capitalize;
  text-decoration: none;
}

.usr-calendar-card .fc .fc-daygrid-day-number {
  color: #334155;
  text-decoration: none;
  font-weight: 600;
}

.usr-calendar-card .fc .fc-day-today {
  background: #eff6ff !important;
}

.usr-calendar-card .fc .fc-event {
  border-radius: 8px;
  padding: 2px 4px;
  font-weight: 600;
  font-size: .72rem;
}

.usr-calendar-card .fc .fc-timegrid-slot {
  height: 2.6rem;
}

.notif-item {
  transition: background .15s;
}
.notif-item:hover { background: #f0f7ff; }
.notif-icon {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #e0f2fe;
  color: var(--primary, #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.notif-body { flex: 1; min-width: 0; }
.notif-text {
  margin: 0 0 3px;
  font-size: .82rem;
  color: #1e293b;
  line-height: 1.4;
  white-space: normal;
}
.notif-fecha {
  font-size: .72rem;
  color: #94a3b8;
}
.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  color: #94a3b8;
  font-size: .82rem;
  gap: 8px;
}
.notif-empty i { font-size: 1.8rem; }

/* Toggle sidebar (mobile) */
#sidebarToggle { display: none; }

/* ───── Main content ───── */
#main {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  flex: 1 0 auto;
  min-height: 0;
  transition: margin-left .3s;
}
.content-wrapper { padding: 28px 28px 40px; }

/* ───── Footer ───── */
#appFooter {
  margin-left: var(--sidebar-w);
  margin-top: auto;
  background: #d4e5f7;
  border-top: 1px solid #b8d4f0;
  color: #1e293b;
}
#appFooter .footer-content {
  min-height: 52px;
  padding: 8px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: .78rem;
  line-height: 1.25;
  font-weight: 500;
}

/* ───── Page header ───── */
.page-header {
  margin-bottom: 24px;
}
.page-header h1 { font-size: 1.4rem; font-weight: 700; margin: 0; }
.page-header .breadcrumb { margin: 0; font-size: .78rem; }
.page-header .breadcrumb-item + .breadcrumb-item::before { content: '/'; }

/* ───── Stat Cards ───── */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid #e2e8f0;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #dbeafe; color: #2563eb; }
.stat-icon.green  { background: #dcfce7; color: #16a34a; }
.stat-icon.orange { background: #ffedd5; color: #ea580c; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { font-size: .78rem; color: #64748b; margin-top: 2px; }
.stat-badge {
  font-size: .7rem;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 6px;
  display: inline-block;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  color: #94a3b8;
  min-width: 90px;
}

.wizard-step.active,
.wizard-step.completed {
  color: #0f172a;
}

.wizard-step__circle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e2e8f0;
  color: #475569;
  font-weight: 700;
}

.wizard-step.active .wizard-step__circle {
  background: #2563eb;
  color: #fff;
}

.wizard-step.completed .wizard-step__circle {
  background: #16a34a;
  color: #fff;
}

.wizard-step__text {
  font-size: .82rem;
  font-weight: 600;
}

.wizard-panel .lesson-card,
.wizard-panel .question-card {
  border: 1px solid rgba(148, 163, 184, .18);
}

.wizard-panel .card-header {
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.was-validated .no-bootstrap-validate:valid,
.was-validated .no-bootstrap-validate:invalid,
.no-bootstrap-validate:valid,
.no-bootstrap-validate:invalid {
  border-color: var(--bs-border-color) !important;
  background-image: none !important;
  box-shadow: none !important;
  padding-right: .75rem !important;
}

.usuarios-asignados-spacer {
  height: 52px;
}

.lesson-card .note-editor.note-frame {
  border: 1px solid #dbe2ea;
  border-radius: .5rem;
}

.lesson-card .note-toolbar {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.lesson-card .note-editing-area .note-editable {
  min-height: 110px;
  font-size: .88rem;
}

.lesson-card .note-statusbar {
  border-top: 1px solid #e2e8f0;
}

.lesson-card .note-editor.is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 .25rem rgba(220, 53, 69, .1);
}


/* ───── Generic card ───── */
.dash-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}
.dash-card .card-header-custom {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-card .card-header-custom h5 {
  margin: 0;
  font-size: .9rem;
  font-weight: 600;
}
.dash-card .card-body-custom { padding: 20px; }

/* ───── Info cards (horizontal) ───── */
.info-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  border: 1px solid #e2e8f0;
  padding: 18px 20px;
  height: 100%;
}
.info-card .ic-title { font-size: .75rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; }
.info-card .ic-val { font-size: 1.5rem; font-weight: 700; margin: 4px 0 2px; }
.info-card .ic-sub { font-size: .78rem; color: #64748b; }

/* ───── Progress ───── */
.progress { height: 6px; border-radius: 4px; background: #f1f5f9; }

/* ───── Badges ───── */
.badge-status {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
}
.badge-status.entregado   { background: #dcfce7; color: #16a34a; }
.badge-status.transito    { background: #dbeafe; color: #2563eb; }
.badge-status.pendiente   { background: #fef9c3; color: #854d0e; }
.badge-status.preparacion { background: #ede9fe; color: #7c3aed; }
.badge-status.retrasado   { background: #fee2e2; color: #b91c1c; }

/* ───── Table toolbar ───── */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.table-toolbar .search-box {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.table-toolbar .search-box i {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: .85rem;
}
.table-toolbar .search-box input {
  padding-left: 32px;
  font-size: .83rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  height: 36px;
  width: 100%;
}
.table-toolbar .search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

/* ───── DataTables override ───── */
.dataTables_wrapper .dataTables_filter { display: none; }
.dataTables_wrapper .dataTables_length label { font-size: .8rem; }
.dataTables_wrapper .dataTables_info { font-size: .78rem; color: #64748b; }
.dataTables_wrapper .dataTables_paginate .paginate_button { font-size: .78rem !important; }
table.dataTable thead th {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0 !important;
}
table.dataTable tbody td { font-size: .82rem; vertical-align: middle; }
table.dataTable tbody tr:hover { background: #f8fafc; }

/* ───── Timeline ───── */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 14px; top: 0; bottom: 0;
  width: 2px;
  background: #e2e8f0;
}
.timeline li {
  padding: 0 0 18px 36px;
  position: relative;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: 6px; top: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .55rem;
  border: 2px solid #fff;
}
.tl-title { font-size: .83rem; font-weight: 600; }
.tl-meta  { font-size: .73rem; color: #94a3b8; }

/* ───── Dark mode (header/footer + menu) ───── */
body.dark-mode #topbar,
body.dark-mode #appFooter {
  background: #0f172a;
  border-color: #1e293b;
  color: #e2e8f0;
}
body.dark-mode #topbar .page-title {
  color: #e2e8f0;
}
body.dark-mode #appFooter .footer-content {
  color: #cbd5e1;
}

body.dark-mode #sidebar,
body.dark-mode .sidebar-logo,
body.dark-mode .sidebar-footer,
body.dark-mode .submenu {
  background: #1f2937;
}
body.dark-mode .sidebar-logo {
  background: #fff;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  margin: 10px;
  padding: 10px;
}
body.dark-mode .sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.1);
}
body.dark-mode .nav-label {
  color: #93c5fd;
}
body.dark-mode .sidebar-nav .nav-link {
  color: #e2e8f0;
}
body.dark-mode .sidebar-nav .nav-link:hover {
  background: #334155;
  color: #fff;
}
body.dark-mode .sidebar-nav .nav-link.active {
  background: #3b4253;
  color: #93c5fd;
}
body.dark-mode .submenu .nav-link,
body.dark-mode .submenu .nav-link:hover,
body.dark-mode .submenu .nav-link.active {
  color: #dbeafe;
}
body.dark-mode .submenu .nav-link::before {
  background: #94a3b8;
}
body.dark-mode .sidebar-footer .user-info,
body.dark-mode .sidebar-footer .user-name {
  color: #e2e8f0;
}
body.dark-mode .sidebar-footer .user-role {
  color: #93c5fd;
}

body.dark-mode .btn-topbar,
body.dark-mode .user-menu .user-menu-toggle {
  background: #1e293b;
  color: #cbd5e1;
}
body.dark-mode .btn-topbar:hover,
body.dark-mode .user-menu .user-menu-toggle:hover {
  background: #334155;
  color: #fff;
}
body.dark-mode .user-menu-dropdown {
  background: #0f172a;
  border-color: #334155;
}
body.dark-mode .user-menu-dropdown .dropdown-item {
  color: #cbd5e1;
}
body.dark-mode .user-menu-dropdown .dropdown-item:hover {
  background: #1e293b;
  color: #fff;
}
body.dark-mode .user-menu-dropdown .dropdown-divider {
  border-top-color: #334155;
}

/* ───── Responsive ───── */
@media (max-width: 991.98px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.show { transform: translateX(0); }
  #topbar { left: 0; }
  #main   { margin-left: 0; }
  #appFooter { margin-left: 0; }
  .user-menu .user-name-header { display: none; }
  #sidebarToggle { display: flex; }
  .overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1039;
  }
  .overlay.show { display: block; }
}


/* Accordion de permisos */
#accordionPermisos .accordion-button:not(.collapsed) {
    background-color: #e8f0fe;
    color: #0d47a1;
}

#accordionPermisos .accordion-button:not(.collapsed) i {
    color: #0d47a1 !important;
}

#accordionPermisos .form-check-input:checked {
    background-color: #198754;
    border-color: #198754;
}

#accordionPermisos .accordion-item {
    border-left: 3px solid transparent;
}

#accordionPermisos .accordion-item:has(.accordion-button:not(.collapsed)) {
    border-left-color: #0d47a1;
}

/* Detalle de preguntas capacitacion */
.btn-preguntas-detalle {
  border: 1px solid #cbd5e1;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: #0f172a;
  font-weight: 600;
}

.btn-preguntas-detalle:hover {
  border-color: #94a3b8;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  color: #020617;
}

.cpq-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0b4f8a 0%, #0ea5b7 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(11, 79, 138, .25);
}

.cpq-summary-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .18);
  font-size: 1.2rem;
}

.cpq-summary-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .2px;
}

.cpq-summary-subtitle {
  font-size: .82rem;
  opacity: .95;
}

.cpq-list {
  display: grid;
  gap: 12px;
}

.cpq-item {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}

.cpq-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.cpq-numero {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .75rem;
  font-weight: 700;
  color: #334155;
  background: #f8fafc;
}

.cpq-correcta {
  display: inline-flex;
  align-items: center;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .75rem;
  font-weight: 700;
  color: #166534;
  background: #dcfce7;
}

.cpq-pregunta {
  font-size: .95rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
}

.cpq-opcion {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
  min-height: 56px;
}

.cpq-opcion .cpq-opcion-input {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: .84rem;
  color: #0f172a;
}

.cpq-opcion .cpq-opcion-input:focus {
  box-shadow: none;
  background: transparent;
}

.cpq-opcion .cpq-letra {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #e2e8f0;
  color: #334155;
  font-size: .73rem;
  font-weight: 700;
  flex-shrink: 0;
}

.cpq-opcion.correcta {
  border-color: #86efac;
  background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
}

.cpq-opcion.correcta .cpq-letra {
  background: #22c55e;
  color: #fff;
}

.lesson-description-rich {
  color: #334155;
  line-height: 1.6;
  font-size: .93rem;
}

.lesson-description-rich p {
  margin-bottom: .5rem;
}

.lesson-description-rich ul,
.lesson-description-rich ol {
  margin-bottom: .5rem;
  padding-left: 1.2rem;
}

.lesson-description-rich a {
  color: #0b4f8a;
  text-decoration: underline;
}

@media (max-width: 767.98px) {
  .cpq-item-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Catalogo de cursos en tarjetas */
.catalogo-card {
  border: 1px solid #dbe7f3;
  border-radius: 16px;
  background: linear-gradient(165deg, #ffffff 0%, #f6fbff 100%);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  position: relative;
  overflow: hidden;
}

.catalogo-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0ea5b7 0%, #0b4f8a 100%);
}

.catalogo-card:hover {
  transform: translateY(-4px);
  border-color: #a9c8e8;
  box-shadow: 0 14px 30px rgba(11, 79, 138, .18);
}

.catalogo-id {
  display: inline-block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: #475569;
  font-weight: 700;
  background: #edf5ff;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 3px 8px;
}

.catalogo-title {
  font-size: 1.08rem;
  line-height: 1.3;
  color: #0f172a;
  font-weight: 800;
}

.catalogo-badge-activo {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  color: #fff;
  font-weight: 700;
  font-size: .72rem;
  padding: 7px 11px;
}

.catalogo-desc {
  color: #334155;
  min-height: 88px;
  line-height: 1.5;
  font-size: .9rem;
}

.catalogo-meta {
  display: grid;
  gap: 8px;
}

.catalogo-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fbff;
  color: #334155;
  font-size: .82rem;
}

.catalogo-meta-item i {
  color: #0b4f8a;
}

.catalogo-meta-item.catalogo-restante {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

.catalogo-btn-curso {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #0b4f8a 0%, #0ea5b7 100%);
  color: #fff;
  font-weight: 700;
  padding: 10px 14px;
}

.catalogo-btn-curso:hover {
  color: #fff;
  filter: brightness(1.03);
  box-shadow: 0 8px 18px rgba(11, 79, 138, .24);
}

@media (max-width: 575.98px) {
  .catalogo-desc {
    min-height: auto;
  }
}

/* Learning del curso */
.learning-hero {
  border: 1px solid #d7e6f7;
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(135deg, #0b4f8a 0%, #0ea5b7 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(11, 79, 138, .2);
}

#evaluacionMeta {
  color: rgba(255, 255, 255, 0.88) !important;
}

.learning-folio {
  display: inline-block;
  background: rgba(255, 255, 255, .2);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .6px;
  margin-bottom: 8px;
}

.learning-progress-box {
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
  padding: 10px 12px;
}

.learning-panels-row {
  align-items: stretch;
}

.learning-panel-card {
  min-height: 72vh;
}

.learning-list-body,
.learning-detail-body {
  overflow-y: auto;
}

.learning-list-body {
  max-height: calc(72vh - 72px);
}

.learning-detail-body {
  max-height: calc(72vh - 88px);
}

.learning-item {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 10px;
  margin-bottom: 10px;
  transition: all .2s ease;
}

.learning-item:hover {
  border-color: #93c5fd;
  box-shadow: 0 6px 14px rgba(14, 116, 144, .12);
}

.learning-item.active {
  border-color: #0ea5b7;
  background: linear-gradient(180deg, #f0fdff 0%, #ecfeff 100%);
}

.learning-item.locked {
  border-style: dashed;
  border-color: #f1b5b5;
  background: #fff7f7;
}

.learning-item.locked .learning-item-title,
.learning-item.locked .learning-item-meta {
  color: #7f1d1d;
}

.learning-item-num {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #e0f2fe;
  color: #0b4f8a;
  font-size: .78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.learning-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.learning-item-title {
  font-size: .85rem;
  font-weight: 700;
  color: #0f172a;
}

.learning-item-meta {
  font-size: .73rem;
  color: #64748b;
}

.learning-item-status {
  font-size: .7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 8px;
}

.learning-item-status.ok {
  background: #dcfce7;
  color: #166534;
}

.learning-item-status.pending {
  background: #fee2e2;
  color: #991b1b;
}

.learning-detail-desc {
  color: #334155;
  line-height: 1.6;
  font-size: .92rem;
}

.learning-detail-desc p {
  margin-bottom: .55rem;
}

@media (max-width: 991.98px) {
  .learning-panel-card,
  .learning-list-body,
  .learning-detail-body {
    min-height: auto;
    max-height: none;
    overflow: visible;
  }
}