/* ==========================================================================
   Admin Panel — First Image Style v5 (optimized, same behavior)
   ==========================================================================
   NOTA: Reordenado por secciones y comentado sin añadir reglas nuevas
   ========================================================================== */




/* == 2) Design tokens / variables globales ================================= */
:root{
  --nav-h: 80px;
  --nav-visible-h: var(--nav-h);
  --sidebar-w: 280px;

  /* Brand */
  --brand: #0D6EFD;
  --brand-rgb: 13,110,253;

  /* Surfaces & chroma */
  --surface: #fff;
  --bg-app:  #f4f7fc;

  /* Lines & borders */
  --border: #e7eaf2;
  --line:   #e7eaf2;

  /* Accents */
  --accent-1: #eef2ff;
  --accent-2: #f5f7ff;
  --accent-3: #e6ebff;

  /* Text */
  --title: #0f172a;
  --muted: #64748b;

  /* Shadows */
  --shadow-1: 0 1px 2px rgba(10, 22, 70, .06);
  --shadow-2: 0 8px 24px rgba(10, 22, 70, .08);
  --shadow-navbar: 0 1px 0 rgba(10,22,70,.06);

  /* Radii */
  --r-sm: .5rem;
  --r-md: .75rem;
  --r-lg: 1rem;
  --r-pill: 999px;

  /* Tokens derivados (evitan literales sueltos) */
  --surface-ghost: rgba(var(--brand-rgb), .08);
  --thead:        rgba(var(--brand-rgb), .06);
  --hover:        #f8fbff;
  --overlay:      rgba(15,23,42,.35);
  --backdrop:     rgba(15,23,42,.6);
  --ring:         0 0 0 .2rem rgba(var(--brand-rgb), .16);
  --chip-ink:     #394b7a;
  --icon-chip-bg: #f2f5ff;

  /* Bootstrap bridges */
  --bs-primary: var(--brand);
  --bs-primary-rgb: var(--brand-rgb);
  --bs-body-bg: transparent; /* usamos gradient en body */
  --bs-card-bg: var(--bg-card);
  --bs-border-color: var(--border);
  --bs-link-color: var(--brand);
}

/*-----------------------------------------------
|   Backgrounds
-----------------------------------------------*/
.bg-holder {
  position: absolute;
  width: 100%;
  min-height: 100%;
  top: 0;
  left: 0;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  will-change: transform, opacity, filter;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  background-repeat: no-repeat;
  z-index: -5;
}



.bg-light-gradient {
  background: -webkit-gradient(linear, left top, left bottom, from(rgba(236, 240, 253, 0)), color-stop(14.32%, rgba(236, 240, 253, 0.53)), color-stop(45.83%, #ECF0FD), color-stop(84.33%, rgba(236, 240, 253, 0.43)), to(rgba(236, 240, 253, 0)));
  background: -o-linear-gradient(top, rgba(236, 240, 253, 0) 0%, rgba(236, 240, 253, 0.53) 14.32%, #ECF0FD 45.83%, rgba(236, 240, 253, 0.43) 84.33%, rgba(236, 240, 253, 0) 100%);
  background: linear-gradient(180deg, rgba(236, 240, 253, 0) 0%, rgba(236, 240, 253, 0.53) 14.32%, #ECF0FD 45.83%, rgba(236, 240, 253, 0.43) 84.33%, rgba(236, 240, 253, 0) 100%);
}

.bg-primary-gradient {
  background: -o-linear-gradient(241.82deg, #67C3F3 9.05%, #5A98F2 76.74%);
  background: linear-gradient(208.18deg, #67C3F3 9.05%, #5A98F2 76.74%);
}


/* == 3) Comportamientos de sticky y compensaciones de header =============== */
[data-stem-sticky].sticky-top { top: calc(var(--nav-visible-h, var(--nav-h, 72px)) + .5rem); } /* pequeño respiro */
body.header-hidden { --nav-visible-h: 0px; } /* cuando el header se oculta */


/* == 4) Base: html/body, tipografía y suavizado =========================== */
html, body { height: 100%; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
  background: var(--bg-app);
  color: var(--title);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}


/* == 5) Utilidades tipográficas rápidas =================================== */
.prepara {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-style: normal;
  color: #3bc452;
}


/* == 6) Utilidades de layout flexibles ==================================== */
.split{
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.split > .pane{
  flex: 1 1 160px;   /* base ~260px, se apila por debajo de ese ancho */
  min-width: 160px;
}


/* == 7) Páginas de autenticación: viewport iOS robusto ==================== */
/* --- Soporte robusto de viewport en iOS (vh → svh → dvh) --- */
.auth-page{
  /* tu fondo y resto se mantienen */
  min-height: 100vh;   /* fallback general */
  min-height: 100svh;  /* iOS 16– */
  min-height: 100dvh;  /* iOS 16.4+ dinámico */
  background: var(--bg-app);
  color: var(--title);
  position: relative;
  overflow-x: hidden;
  z-index: 0;          /* asegura contexto de apilado detrás del contenido */
}

/* Evita height fijo: en iOS produce “saltos” al cambiar la barra */
.auth-shell{
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}


/* == 8) Adorno: cuarto de círculo fijo (iPhone-safe) ====================== */
/* ---- Adorno: cuarto de círculo abajo-derecha (a prueba de iPhone) ---- */
.auth-page--quarter::after{
  content:"";
  position: fixed;              /* anclado al viewport */
  right: calc(0px + env(safe-area-inset-right, 0));
  bottom: calc(0px + env(safe-area-inset-bottom, 0));

  /* cuadrado ⇒ círculo; algo más flexible en móviles estrechos */
  width:  clamp(18rem, 36vmin, 42rem);
  height: clamp(18rem, 36vmin, 42rem);

  background: var(--blob-fill, rgba(var(--bs-primary-rgb), .74));
  border-top-left-radius: 100% 100%;
  border-top-right-radius: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;

  pointer-events: none;
  z-index: 0;

  /* Evita glitches de repintado de iOS con fixed + sombras */
  box-shadow: -1rem -1rem 3rem rgba(0,0,0,.06);
  transform: translateZ(0);
}


/* == 9) Auth: ajustes responsive de altura ================================ */
@media (max-height: 640px){
  .auth-shell{ padding-top: 1.25rem; }
}

/* Opcional: aún más compacto en landscape muy bajo */
@media (orientation: landscape) and (max-height: 480px){
  .auth-page--quarter::after{
    width:  clamp(14rem, 40vmin, 28rem);
    height: clamp(14rem, 40vmin, 28rem);
  }
}

/* == Custom donuts para cobertura del temario ================================= */
.course-header-donut,
.home-course-donut {
  --size: 34px;
  --thickness: 8px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: conic-gradient(rgba(59,130,246,0.9) calc(var(--pct) * 1%), rgba(59,130,246,0.12) 0);
  display: flex;
  align-items: center;
  justify-content: center;
}
.course-header-donut-inner,
.home-course-donut-inner {
  width: calc(var(--size) - (var(--thickness) * 2));
  height: calc(var(--size) - (var(--thickness) * 2));
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}


/* == 10) Navbar sticky ===================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1050;
  height: var(--nav-h);
  background: var(--surface);

}
.navbar .navbar-brand { font-weight: 800; color: var(--title); letter-spacing: .2px; }
.navbar .btn { border-radius: .6rem; }


/* == 11) Breadcrumbs con gradiente de fondo =============================== */
.breadcrumb-wrap {
  background: linear-gradient(180deg, rgba(255,255,255,.9) 0%, rgba(255,255,255,0) 100%);
  padding: .5rem 2rem 0;
}
.breadcrumb { margin: 0; }
.breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: #c0c7d4; }
.breadcrumb .breadcrumb-item a { color: var(--muted); text-decoration: none; }
.breadcrumb .active { color: var(--title); font-weight: 600; }


/* == 12) Layout general (grid) y área principal =========================== */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--nav-h));
  transition: grid-template-columns .2s ease;
}
.main { padding: 1.25rem 2rem 2rem; }
@media (max-width: 1199.98px){ .main { padding: 1rem; } }


/* == 13) Sidebar (fija en desktop, deslizable en móvil) =================== */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  overflow-y: auto;
  transition: transform .2s ease;
}
.sidebar-header {
  height: var(--nav-h);
  display:flex; align-items:center; padding: 0 1rem;
  font-weight: 800; color: var(--title);
}

/* Menú lateral: ítems, iconos, estados */
.sidebar-menu .list-group-item {
  border:0; border-radius:0;
  padding: .65rem 1rem; display:flex; align-items:center; gap:.75rem; color:var(--title); position:relative;
}
.sidebar-menu .list-group-item .icon {
  width: 36px; height:36px; border-radius:10px; display:grid; place-items:center;
  background: var(--icon-chip-bg); color:var(--brand); font-size:18px;
}
.sidebar-menu .list-group-item:hover { background:#f6f8ff; }
.sidebar-menu .list-group-item.active {
  background: var(--surface-ghost); color: var(--brand);
  font-weight: 800;
}
.sidebar-menu .list-group-item.active::before {
  content:""; position:absolute; left:0; top:0; bottom:0; width:6px; background:var(--brand);
  border-top-right-radius:6px; border-bottom-right-radius:6px;
}
.sidebar-menu .list-group-item .count {
  margin-left:auto; background:var(--accent-1); color:#334155;
  border-radius:var(--r-pill); font-weight:700; padding:.25rem .5rem; font-size:.8rem;
}


/* == 14) Encabezado de página / acciones ================================== */
.page-header { display:flex; align-items:center; justify-content:space-between; margin-bottom: 1rem; }
.overline { font-size:.72rem; text-transform:uppercase; letter-spacing:.12em; color:var(--muted); font-weight:700; }
.page-title { font-size:1.35rem; font-weight:800; color:var(--title); }
.page-actions .btn + .btn { margin-left: .5rem; }


/* == 15) Superficies tipo card / contenedores ============================= */
.card, .kpi, .table-wrap, .selbar {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  background: var(--surface);
}
.card .card-header { background: var(--surface); border-bottom:1px solid var(--border); color:var(--title); }
.card.elevated { border-color: transparent; box-shadow: var(--shadow-2); }


/* == 16) KPIs compactos ==================================================== */
.kpi{ padding:1rem; }
.kpi .label{ color:var(--muted); font-size:.8rem; text-transform:uppercase; letter-spacing:.02em; }
.kpi .value{ font-size:1.65rem; font-weight:800; color:var(--title); }


/* == 17) Filtros (chips) ================================================== */
.filters { display:flex; gap:.5rem; flex-wrap:wrap; }
.chip{
  display:inline-flex; align-items:center; gap:.5rem;
  background:var(--accent-1); border:1px solid var(--accent-3);
  color:var(--chip-ink); padding:.35rem .6rem; border-radius:var(--r-pill); font-weight:600;
}
.chip .x{ cursor:pointer; }


/* == 18) Tablas con thead sticky y hover ================================== */
.table { margin:0; }
.table-wrap { /* overflow visible para sticky thead */ overflow: visible; }
.table thead th{
  background: var(--thead);
  color: var(--title);
  font-weight: 800;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1;
}
.table th .sort { opacity:.55; margin-left:.35rem; font-size:.85em; }
.table th .sort.active { opacity:1; color:var(--brand); }
.table-hover tbody tr:hover { background: var(--hover); }
.table :is(td, th) { vertical-align: middle; }
.table .checkbox { width:42px; }
.table .actions { white-space:nowrap; }


/* == 19) Barra de selección contextual ==================================== */
.selbar { display:none; align-items:center; justify-content:space-between; padding:.55rem .8rem; margin: .85rem 0; }
.selbar.show { display:flex; }


/* == 20) Badges de estado ================================================== */
.badge-status{
  text-transform:uppercase; font-weight:800; letter-spacing:.02em;
  border-radius:var(--r-pill); padding:.4rem .7rem;
}
.badge-status[data-state="finished"]   { background:#198754; color:#ffffff; }
.badge-status[data-state="in_progress"]{ background:#fde68a; color:#7a5200; }
.badge-status[data-state="archived"]   { background:#e2e8f0; color:#46566b; }


/* == 21) Botones (incluye estilo ghost) =================================== */
.btn { border-radius:.6rem; font-weight:600; }
.btn-ghost { background: transparent; border: 1px dashed var(--accent-3); color:#334155; }


/* == 22) Formularios: focus ring consistente ============================== */
.form-control, .form-select { border-radius:.6rem; border-color:#d7ddea; }
.form-control:focus, .form-select:focus { border-color:rgba(var(--brand-rgb),.6); box-shadow: var(--ring); }


/* == 23) Paginación ======================================================== */
.pagination .page-link{ border-radius:.5rem; border-color:var(--border); }


/* == 24) Densidad compacta opcional ======================================= */
body.density-compact .main { padding: 1rem; }
body.density-compact .table { font-size:.94rem; }
body.density-compact .table :is(td, th) { padding-top:.45rem; padding-bottom:.45rem; }


/* == 25) Responsive: sidebar y overlay en móviles ========================= */
@media (max-width: 1199.98px){
  .layout{ grid-template-columns: 1fr; }
  .sidebar{
    position: fixed;
    top: var(--nav-h, 56px); left: 0;
    width: var(--sidebar-w);
    /* iOS: vh → svh → dvh con fallback; la última soportada gana */
    height: calc(100vh  - var(--nav-h, 56px));
    height: calc(100svh - var(--nav-h, 56px));
    height: calc(100dvh - var(--nav-h, 56px));
    transform: translateX(-100%);
    will-change: transform; z-index: 1040;
    -webkit-overflow-scrolling: touch;
  }
  body.sidebar-open .sidebar{ transform: none; }
  .overlay{
    display: block;
    position: fixed;
    top: var(--nav-h, 56px); left: 0; right: 0; bottom: 0;
    background: var(--overlay);
    opacity: 0; pointer-events: none; z-index: 1010; /* < navbar */
    transition: opacity .2s ease;
  }
  body.sidebar-open .overlay{ opacity: 1; pointer-events: auto; }
}

/* Desktop: colapsado/expandido con body flags */
@media (min-width: 1200px){
  body.sidebar-collapsed .layout{ grid-template-columns: 72px 1fr; }
  body.sidebar-collapsed .sidebar{ width:72px; }
  body.sidebar-collapsed .sidebar-header{ display:none; }
  body.sidebar-collapsed .sidebar-menu .list-group-item{ justify-content:center; }
  body.sidebar-collapsed .sidebar-menu .list-group-item > span:not(.icon){ display:none; }
}


/* == 26) Z-index layering con modales ===================================== */
body.modal-open .navbar         { z-index: 1030; }
body.modal-open #toasts         { z-index: 1040; }
body.modal-open .floating-timer { z-index: 1030; }

.modal-backdrop{ background-color: var(--backdrop); }
.modal-backdrop.show{ opacity: .45; }
.modal-content{
  background-color: var(--surface); border:0; border-radius: var(--r-lg);
  box-shadow: 0 20px 60px rgba(2,6,23,.18);
}
.modal-header, .modal-footer{
  border-color: var(--line);
  background-color: var(--bs-light) !important;
}

/* == 27) Detalles/Q y preformateado ======================================= */
details.q summary { list-style: none; cursor: pointer; }
details.q summary::-webkit-details-marker { display: none; }
pre { white-space: pre-wrap; }


/* == 28) Utilidades varias ================================================= */
.minw-0{ min-width:0 !important; }
.w-0{ width:0 !important; }
.truncate-1{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.drag-ghost{ opacity:.6; }
.drag-over{ border:1px dashed var(--bs-secondary); }
.order-index{ display:inline-block; width:2.2ch; min-width:2.2ch; }
.content-editor { min-height: 220px; max-height: 60vh; overflow: auto; }


/* == 29) Tarjetas con toggle (radio/checkbox + card) ====================== */
.toggle-card-group{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem; }
.toggle-card{
  border:1px solid var(--bs-border-color); border-radius:1rem; padding:.9rem 1rem;
  background-color:var(--bs-body-bg); cursor:pointer; transition:border-color .15s, box-shadow .15s;
  min-height:84px;
}
.toggle-card:hover{ border-color:var(--bs-primary); }
.btn-check:checked + .toggle-card{ border-color:var(--bs-primary); background-color: #edf4ff; }
.toggle-card .icon{
  width:2.25rem; height:2.25rem; display:inline-flex; align-items:center; justify-content:center;
  border-radius:.75rem; background:var(--bs-light); margin-right:.5rem; font-size:1.1rem;
}
.btn-check:checked + .toggle-card .icon{ background: rgba(var(--bs-primary-rgb,13,110,253), .1); }
.toggle-card .title{ font-weight:600; }
.toggle-card .desc{ font-size:.875rem; color: var(--bs-secondary-color); }
.toggle-card.disabled{ opacity:.6; cursor:not-allowed; }


/* == 30) Toasts (contenedor y estilo simple) ============================== */
#toasts {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.toast--simple .toast-inner{
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  column-gap: 12px;
  padding-left: 6px;
}
.toast--simple .btn-close{ margin-left: 8px; }
.toast.toast--simple{
  position: relative;
  border: none;
  border-radius: .65rem;
  background: var(--surface);
  box-shadow: 0 15px 30px rgba(0,0,0,.08);
  min-width: 300px;
  padding: .72rem .75rem;
}
.toast.toast--simple::before{
  content:""; position:absolute; inset:0 auto 0 0; width:6px;
  background: var(--toast-accent, var(--bs-info));
  border-top-left-radius:.75rem; border-bottom-left-radius:.75rem;
}
.toast--simple .toast-icon{
  width:26px; height:26px; border-radius:50%;
  display:grid; place-items:center; color:#fff;
  justify-self:center;
  background: var(--toast-accent, var(--bs-info));
}
.toast--simple .toast-icon i{ line-height:1; }
.toast--simple .toast-title{
  font-weight:700;
  line-height:1.15;
  font-size:.72rem;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.toast--simple .toast-msg{ color: var(--bs-secondary-color); }
.toast-container{ z-index:2000 !important; }


/* == 31) Podium Ranking ==================================================== */
.podium-row { margin-bottom: 1rem; }
.podium .winner-card{ transition:transform .2s ease, box-shadow .2s ease; }
.podium .winner-card .avatar-initial{
  width:56px;height:56px;font-weight:700
}
.ranking-avatar-badge{
  width:32px;
  height:32px;
}
.ranking-avatar-slot{
  width:32px;
  height:32px;
}
.ranking-avatar-emoji{
  line-height:1;
}
.ranking-avatar-emoji--podium{
  width:56px;
  height:56px;
  font-size:2.1rem;
}
.ranking-avatar-emoji--table{
  width:32px;
  height:32px;
  font-size:1.45rem;
  transform:translate(1px, -1px);
}
.ranking-user-cell__divider{
  height:32px;
}
.podium .winner-card .name{ font-weight:600 }
.podium .winner-card .sub{ font-size:.85rem;color:#6b7280 }
.podium .winner-card .big{ font-size:1.25rem;font-weight:700;line-height:1 }
@media (min-width: 768px){
  .podium .col-first   { order: 2; }
  .podium .col-second  { order: 1; }
  .podium .col-third   { order: 3; }
  .podium .col-first   .winner-card { transform: translateY(-8px) scale(1.03); }
  .podium .col-second  .winner-card { transform: translateY(8px); }
  .podium .col-third   .winner-card { transform: translateY(16px); }
}
.podium .first  .border-top{ border-top:4px solid #f7c948 !important; }
.podium .second .border-top{ border-top:4px solid #bfc7d5 !important; }
.podium .third  .border-top{ border-top:4px solid #d6a680 !important; }

.ranking-table-shell { min-height: 160px; }
.ranking-table-loader {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  align-items: start;
  padding-top: .25rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease;
}
.ranking-table-loader.htmx-request {
  opacity: 1;
  visibility: visible;
}
.ranking-table-loader.is-hold {
  opacity: 1;
  visibility: visible;
}
.ranking-table-loader.is-suppressed {
  opacity: 0 !important;
  visibility: hidden !important;
}
.ranking-table-loader.htmx-request::before,
.ranking-table-loader.is-hold::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(255,255,255,.72);
  border-radius: .75rem;
}
.ranking-table-loader .ranking-loader-wrap {
  position: relative;
  margin: 0;
  z-index: 1;
}
.ranking-loader-wrap {
  width: 100%;
}
.ranking-loader-body {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.ranking-loader-lottie {
  width: 170px;
  height: 170px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 6px 14px rgba(15,23,42,.12));
  overflow: hidden;
}
.ranking-loader-lottie svg {
  width: 100%;
  height: 100%;
  display: block;
}
.ranking-loader-fallback {
  font-size: 5rem;
  line-height: 1;
}
.ranking-loader-lottie.is-ready .ranking-loader-fallback {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .ranking-table-loader { transition: none; }
}


/* == 32) Course Status (pasos con progreso) =============================== */
.steps {
  --step-size: 40px;
  --track: #d9dde3;
  --muted: #8b97a8;

  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0;
}
.steps::before {
  content: "";
  position: absolute;
  top: calc(var(--step-size) / 2 - 3px);
  left: calc(var(--step-size) / 2);
  right: calc(var(--step-size) / 2);
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--track);
  z-index: 0;
}
.steps::after {
  content: "";
  position: absolute;
  top: calc(var(--step-size) / 2 - 3px);
  left: calc(var(--step-size) / 2);
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--bs-primary);
  width: calc((100% - var(--step-size)) * (var(--done) / var(--segments)));
  z-index: 1;
}
.step { position: relative; flex: 1 1 0; text-align: center; }
.step .icon {
  position: relative; z-index: 2;
  width: var(--step-size); height: var(--step-size); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #e9eef5; color: var(--muted);
  box-shadow: 0 0 0 4px var(--surface);
  margin: 0 auto;
}
.step.completed .icon, .step.current .icon { background: var(--bs-primary); color: #fff; }
.step .label { margin-top: .5rem; font-weight: 500; color: #6c757d; white-space: nowrap; }


/* == 33) Temporizador flotante (FAB) ====================================== */
.floating-timer {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  left: auto; top: auto; z-index: 1060;

  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--r-pill);

  background: rgba(17, 24, 39, 0.92); color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  backdrop-filter: saturate(140%) blur(6px);

  font-weight: 600; font-size: 14px; line-height: 1;
}
.floating-timer[hidden] { display: none !important; }
.floating-timer__icon { opacity: .9; }
@media (min-width: 1024px) {
  .floating-timer {
    padding: 14px 18px; font-size: 18px; box-shadow: 0 10px 28px rgba(0,0,0,0.2);
    bottom: max(80px, env(safe-area-inset-bottom));
  }
  .floating-timer__icon { transform: scale(1.1); }
}

/* == Case modal helpers ================================================= */
.case-alert { border-left: 4px solid rgba(var(--bs-warning-rgb), 0.5); }
.case-modal-fab {
  position: fixed;
  right: calc(1rem + env(safe-area-inset-right, 0));
  bottom: calc(1rem + env(safe-area-inset-bottom, 0));
  display: none;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.18);
  z-index: 1070;
}
.case-modal-fab__count {
  font-size: 0.75rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.25);
}
.case-modal-fab--show { display: inline-flex; }
.case-modal-fab--show {
  bottom: calc(1rem + env(safe-area-inset-bottom, 0) + 120px);
}
@media (min-width: 1024px) {
  .case-modal-fab--show {
    bottom: calc(1rem + env(safe-area-inset-bottom, 0) + 140px);
  }
}
body.modal-open .case-modal-fab { display: none; }

/* == 33.1) Test nav: sticky si cabe, normal si no ========================= */
#nav-sticky.nav-sticky--flow {
  position: static !important;
  top: auto !important;
}


/* == 34) Accesibilidad: reduce motion ===================================== */
@media (prefers-reduced-motion: reduce){
  * { transition: none !important; animation: none !important; }
}


/* == 35) EDGE LATERAL TEST: botón flotante ================================ */
.edge-toggle{
  position: fixed;
  top: 28%;
  right: 0;
  transform: translate(50%, -50%);
  width: 56px; height: 56px;
  border: 0; border-radius: 9999px;
  background: var(--edge-btn); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(0,0,0,.15);
  cursor: pointer; z-index: 1050;
}
.edge-toggle:hover { filter: brightness(1.05); }
.edge-toggle:active { transform: translate(50%, -50%) scale(.98); }
.edge-toggle:focus-visible{
  outline: 3px solid rgba(255,255,255,.9);
  outline-offset: 2px;
}
.edge-toggle svg{
  transition: transform .25s;
  margin-right: 21px;
}
html[data-test-nav="open"] .edge-toggle svg{ transform: rotate(180deg); }

@media (max-width: 768px){
  .edge-toggle{ top: auto; bottom: 70px; right: 16px; transform: none; }
  .edge-toggle:active { transform: scale(.98); }
  .edge-toggle svg{ margin-right: 0px; }
}


/* == 36) Truncado de lineas (extras) ===================================== */
.hp-title{
  display: -webkit-box;
  line-clamp: 1;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hp-title2{
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-2{
  display: -webkit-box;
  line-clamp: 2;          /* nº de líneas */
  -webkit-line-clamp: 2;   /* nº de líneas */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3{
  display: -webkit-box;
  line-clamp: 3;          /* nº de líneas */
  -webkit-line-clamp: 3;   /* nº de líneas */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* == 37) Timeline de prioridad con carril y máscaras ====================== */
#hp_prioridad{
  position: relative;
  overflow: visible;
  --hp-line-x: 2.25rem;            /* (fallback) posición horizontal del carril */
}

/* Carril vertical continuo detrás de todo */
#hp_prioridad::before{ display: none; }

#hp_prioridad .list-group-item{ position: relative; }
#hp_prioridad .hp-ring{ position: relative; z-index: 2; } /* el anillo siempre por encima */

/* Máscaras del carril (tapan la parte superior e inferior) */
#hp_prioridad .hp-ring::before,
#hp_prioridad .hp-ring::after{
  content:"";
  position:absolute;
  left:50%; transform:translateX(-50%);
  width:2px;
  background: var(--bs-card-bg, var(--bs-body-bg, #fff));
  display:none;
  z-index: 1;                      /* por encima del carril, por debajo del anillo */
}

/* En el PRIMER ítem: tapa desde arriba hasta el centro del anillo */
#hp_prioridad .list-group-item:first-child .hp-ring::before{
  display:block;
  top:-100vh;                      /* llega sobrado hasta el borde superior del bloque */
  bottom:50%;
}

/* En el ÚLTIMO ítem: tapa desde el centro hasta abajo */
#hp_prioridad .list-group-item:last-child .hp-ring::after{
  display:block;
  top:50%;
  bottom:-100vh;                   /* llega sobrado hasta el borde inferior del bloque */
}


/* == 38) Tooltips temáticos y texto justificado =========================== */
.tt-topics {
  --bs-tooltip-bg: rgba(17, 24, 39, 0.96); /* gris-azul oscuro */
  --bs-tooltip-color: #fff;                 /* texto blanco */
  --bs-tooltip-max-width: 420px;            /* opcional, un poco más ancho */
  --bs-tooltip-padding-x: .6rem;
  --bs-tooltip-padding-y: .45rem;
  --bs-tooltip-font-size: .875rem;
}
.tt-topics .tooltip-inner {
  white-space: pre-line;
  text-align: left;
}

.text-justify { text-align: justify; hyphens: auto; overflow-wrap: anywhere; }

/* == 38b) Home enrolled plans: truncate title consistently ============ */
.course-plan-row { min-width: 0; }
.course-plan-left {
  min-width: 0;
  flex: 1 1 0;
}
.course-plan-left > .flex-grow-1 { min-width: 0; }
.course-plan-actions { flex: 0 0 auto; }
.course-title-truncate {
  display: block;
  flex: 1 1 auto;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 575.98px) {
  .course-plan-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.75rem;
  }
  .course-plan-row .course-title-truncate { max-width: 20ch; }
  .course-plan-actions { justify-self: end; }
}


/* == 39) Card promo con blob radial sutil ================================ */
.promo-card { position: relative; isolation: isolate; }
.promo-card::after {
  content: "";
  position: absolute;
  right: -250px;
  top: 50%;
  transform: translateY(-50%);
  width: 60%;
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle at center, #AFC7FF 0%, #3B82F6 40%, var(--bs-primary, #0d6efd) 80%);
  opacity: .12;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}


/* == 40) TEST MODE (desktop ≥1200): colapsado por defecto ================= */
@media (min-width: 1200px){
  /* Solo aplica estilos de collapse si el body tiene .sidebar-collapsed */
  body.test-mode.sidebar-collapsed .layout{ grid-template-columns: 72px 1fr; }
  body.test-mode.sidebar-collapsed .sidebar{ width:72px; }
  body.test-mode.sidebar-collapsed .sidebar-header{ display:none; }
  body.test-mode.sidebar-collapsed .sidebar-menu .list-group-item{ justify-content:center; }
  body.test-mode.sidebar-collapsed .sidebar-menu .list-group-item > span:not(.icon){ display:none; }

  /* Estado expandido durante test (restaura ancho normal) */
  body.test-mode:not(.sidebar-collapsed) .layout{ grid-template-columns: var(--sidebar-w, 280px) 1fr; }
  body.test-mode:not(.sidebar-collapsed) .sidebar{ width: var(--sidebar-w, 280px); }

  /* En desktop no usamos overlay */
  body.test-mode .overlay{ display:none !important; }
}


/* == 41) CUSTOM TEST MODAL (grid de modos) ================================ */
#customTestModal .mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
#customTestModal .mode-card {
  display: flex; align-items: center; gap: .75rem;
  padding: .9rem; border: 1px solid rgba(0,0,0,.08); border-radius: .75rem;
  background: #fff; transition: box-shadow .2s ease, transform .05s ease, border-color .2s ease;
  color: var(--bs-body-color);
  cursor: pointer; user-select: none;
  -webkit-text-fill-color: currentColor;
}
#customTestModal .mode-card.mode-card-compact {
  padding: .5rem .6rem !important;
  gap: .6rem;
  margin-bottom: .35rem;
}
#customTestModal #especialChooser .mode-card {
  padding: .5rem .6rem !important;
}
#customTestModal .mode-card:hover { box-shadow: 0 6px 20px rgba(43,55,86,.08); border-color: rgba(0, 98, 255, .35); }
#customTestModal .mode-card.selected { border-color: rgba(0, 98, 255, .6); box-shadow: 0 6px 20px rgba(43,55,86,.12); }
#customTestModal .mode-card,
#customTestModal .mode-card:hover,
#customTestModal .mode-card:focus,
#customTestModal .mode-card.selected {
  color: var(--bs-body-color);
}
#customTestModal .mode-icon {
  width: 44px; height: 44px; border-radius: .75rem;
  background: rgba(0, 123, 255, .15);
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
#customTestModal .mode-title { font-weight: 600; line-height: 1.1; color: inherit; -webkit-text-fill-color: currentColor; }
#customTestModal .mode-desc { font-size: .85rem; color: #6c757d; margin: 0; }
#customTestModal .section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
#customTestModal input.form-range { width: 100% !important; display: block; }


.tt-contrast { --bs-tooltip-color: #fff !important; --bs-tooltip-max-width: 640px; }
.tt-nowrap .tooltip-inner { text-align: left; }
.tt-nowrap .tooltip-inner .tt-row { white-space: nowrap; display: block; }

/* == 42) CARD HEADER  ================================ */
.stat-card-icon {
    position: absolute;
    top: 15px;
    left: -15px;
    height: 40px;
    border-radius: 999px;
    background: var(--bs-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: 0 2.1rem;
    /* box-shadow: 0 12px 28px rgba(37, 99, 235, 0.6); */
    color: #000;
    /* font-size: .8rem; */
    font-weight: 500;
    white-space: nowrap;
}

.card-badge-title {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;

  background: var(--bs-light);
  font-weight: 500;            /* fw-normal */
  position: relative;
  left: -25px;
  max-width: calc(100% + 25px);

  padding: 0.55rem 2rem;       /* py-3 px-3 */


  /* Para simular rounded-start-0 (lado izquierdo recto) */
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
    /* shadow-sm */
  box-shadow: 0 .125rem .25rem rgba(0, 0, 0, 0.075);
}

/* == 43) HOME LEVEL CARD ================================ */
.level-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}
.level-card .level-hero {
  background: linear-gradient(135deg, #f7fbff 0%, #eef4ff 100%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.level-card .level-hero-main {
  min-width: 0;
}
.level-card .level-title {
  font-weight: 700;
  font-size: 1.1rem;
}
.level-card .level-next {
  font-size: 0.85rem;
}
.level-card .level-icon {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6);
}
.level-card .level-icon-ring {
  width: 76px;
  height: 76px;
  padding: 6px;
  border-radius: 999px;
  background: conic-gradient(
    var(--level-ring-color) var(--level-progress, 0%),
    #e7ecf3 0
  );
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.level-card .level-icon-ring--novato {
  --level-ring-color: #94a3b8;
}
.level-card .level-icon-ring--opositor {
  --level-ring-color: #60a5fa;
}
.level-card .level-icon-ring--pro {
  --level-ring-color: #f4c24b;
}
.level-card .level-icon--novato {
  background: radial-gradient(circle at 30% 30%, #e5e7eb 0%, #cbd5e1 55%, #b8c3d1 100%);
  color: #475569;
}
.level-card .level-icon--opositor {
  background: radial-gradient(circle at 30% 30%, #dbeafe 0%, #93c5fd 55%, #60a5fa 100%);
  color: #1d4ed8;
}
.level-card .level-icon--pro {
  background: radial-gradient(circle at 30% 30%, #fde68a 0%, #f8c760 55%, #f3b23c 100%);
  color: #92400e;
}
.level-card .level-icon i {
  font-size: 2rem;
}
.level-card .level-icon-value {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
}
.level-card .level-icon-caption {
  margin-top: 0.15rem;
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
  line-height: 1;
}
.level-card .level-icon-label {
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  background: #fef3c7;
  color: #92400e;
  font-size: 0.62rem;
  line-height: 1;
  padding: 0.2rem 0.42rem;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.24);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
}
.level-card .level-icon-label .bi {
  font-size: 0.72rem;
  line-height: 1;
}
.level-card .level-badge {
  background: #22c55e;
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
}
.level-card .metric-icon {
  width: 28px;
  height: 28px;
  font-size: 1rem;
  align-self: center;
}
.level-card .level-metric-head {
  min-width: 0;
}
.level-card .level-metric-label {
  flex: 1 1 auto;
  min-width: 0;
}
.level-card .metric-val {
  flex: 0 0 auto;
  font-weight: 600;
  color: #1f2937;
}
.level-card .level-progress {
  height: 10px;
  border-radius: 999px;
  background: #eef1f7;
}
.level-card .level-progress .progress-bar {
  border-radius: 999px;
}
.level-card .level-bar {
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08);
  transition: width 0.3s ease;
}
.level-card .level-bar-blue { background: linear-gradient(90deg, #8fb8ff, #6ea2ff); }
.level-card .level-bar-green { background: linear-gradient(90deg, #8fe3b3, #6fd59c); }
.level-card .level-bar-teal { background: linear-gradient(90deg, #8fe3da, #63d1c6); }
.level-card .level-bar-purple { background: linear-gradient(90deg, #c4a8ff, #b38cff); }
.level-card .level-bar-gold { background: linear-gradient(90deg, #f7d58a, #f3c96a); }
.level-card .metric-blue { color: #3b82f6; }
.level-card .metric-green { color: #22c55e; }
.level-card .metric-teal { color: #14b8a6; }
.level-card .metric-purple { color: #a855f7; }
.level-card .metric-gold { color: #f59e0b; }

.level-card .level-details {
  border: 0;
}
.level-card .level-details-toggle {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.15rem 0 0.15rem 0;
}
.level-card .level-details-toggle::-webkit-details-marker { display: none; }
.level-card .level-toggle-icon {
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}
.level-card .level-details .chev { transition: transform .2s ease; }
.level-card .level-details:not([open]) .chev { transform: rotate(180deg); }
.level-card .level-details-content { padding-top: 0.35rem; }
@media (min-width: 992px) {
  .level-card .level-details-toggle { display: none; }
  .level-card .level-details-content { padding-top: 0; }
}

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  line-height: 1;
  vertical-align: middle;
  font-weight: 600;
  border: 1px solid transparent;
  padding: 0.2rem 0.55rem;
}
.level-badge--novato {
  background: #e2e8f0;
  color: #475569;
  border-color: #cbd5e1;
}
.level-badge--opositor {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.level-badge--pro {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.levels-modal .modal-header {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.levels-modal .modal-footer {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.levels-modal .levels-req .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #64748b;
  display: inline-block;
  margin-right: 0.45rem;
}
.levels-modal .levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
}
.levels-modal .levels-card {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.9rem;
  padding: 0.9rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}
.levels-modal .levels-reqs {
  display: grid;
  gap: 0.4rem;
}
.levels-modal .levels-req {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}
.level-badge .badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0.9rem;
  margin-right: 0;
  transform: translateY(-0.5px);
}
.level-badge--pro .badge-icon {
  transform: translateY(-1px);
}
@media (max-width: 575.98px) {
  .level-badge .badge-text {
    display: none;
  }
  .level-badge .badge-icon {
    transform: translateY(-0.5px);
  }
  .level-badge--pro .badge-icon { transform: translateY(-1px); }
}

.pt-6 {
  padding-top: 4rem !important; /* equivalente a 72px si 1rem = 16px */
}

  .bs-details summary { list-style: none; cursor: pointer; }
  .bs-details summary::-webkit-details-marker { display: none; }
  .bs-details .chev { transition: transform .2s ease; }
  .bs-details[open] .chev { transform: rotate(90deg); }

/* ==========================================================================
   Smart App Banner (iOS/Android)
   ========================================================================== */
.smart-app-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 78px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: linear-gradient(to bottom, #f2f2f2 0%, #e4e4e4 100%);
  border-bottom: 1px solid #c4c4c4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 1040;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.smart-app-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
}
.smart-app-banner__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #888;
  cursor: pointer;
  padding: 0;
  margin-right: 6px;
}
.smart-app-banner__close:hover {
  color: #333;
}
.smart-app-banner__icon {
  flex-shrink: 0;
  width: 57px;
  height: 57px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15), 
              inset 0 0 0 0.5px rgba(0, 0, 0, 0.1);
  margin-right: 12px;
}
.smart-app-banner__info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.smart-app-banner__title {
  font-size: 14px;
  font-weight: 600;
  color: #000;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.smart-app-banner__subtitle {
  font-size: 12px;
  color: #666;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.smart-app-banner__meta {
  font-size: 11px;
  color: #888;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.smart-app-banner__btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  height: 28px;
  padding: 0 14px;
  margin-left: 10px;
  background: #147EFB;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: background 0.15s ease;
}
.smart-app-banner__btn:hover {
  background: #0d6edf;
  color: #fff;
  text-decoration: none;
}
/* Ajuste del body cuando el banner está visible */
body.app-banner-visible .auth-shell {
  padding-top: 78px;
}
/* Responsive */
@media (max-width: 575.98px) {
  .smart-app-banner {
    height: 68px;
    padding: 0 8px;
  }
  .smart-app-banner__icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    margin-right: 10px;
  }
  .smart-app-banner__title {
    font-size: 13px;
  }
  .smart-app-banner__subtitle {
    font-size: 11px;
  }
  .smart-app-banner__meta {
    font-size: 10px;
  }
  .smart-app-banner__btn {
    min-width: 60px;
    height: 26px;
    font-size: 13px;
    padding: 0 12px;
  }
  body.app-banner-visible .auth-shell {
    padding-top: 68px;
  }
}

#hp_sections .hp-plan-item {
  min-height: 88px;
}
#hp_sections .hp-plan-item .hp-title2 {
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}

.pre-wrap {
  white-space: pre-wrap;
}

.profile-notifications td > .day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: .5rem;
  font-weight: 500;
}
.profile-notifications td.weekend {
  background: var(--bs-table-bg);
}
.profile-notifications td.today .day {
  background: var(--bs-primary);
  color: #fff;
}
.profile-notifications td .badges {
  margin-top: .25rem;
  display: grid;
  gap: .25rem;
}

.profile-emoji-choice {
  min-height: 92px;
  cursor: pointer;
}

.profile-emoji-choice:hover .profile-emoji-choice__badge {
  transform: translateY(-1px);
}

.profile-emoji-choice__badge {
  width: 4.25rem;
  height: 4.25rem;
  font-size: 2rem;
  border: 2px solid transparent;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.btn-check:checked + .profile-emoji-choice .profile-emoji-choice__badge {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 .18rem rgba(var(--bs-primary-rgb), .18);
}

@media (max-width: 575.98px) {
  .profile-emoji-choice {
    min-height: 84px;
  }

  .profile-emoji-choice__badge {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.7rem;
  }
}

.radar-box {
  width: 360px;
  max-width: 100%;
}
.radar-canvas {
  height: 320px;
}
.radar-topics-legend {
  font-size: 0.85rem;
  color: #4a5568;
}
.radar-topics-legend-swatch {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(0,0,0,0.1);
}
.radar-divider {
  height: 100%;
  min-height: 240px;
}

/* ==========================================================================
   Video Player con marca de agua
   ========================================================================== */
.video-watermark-container {
  position: relative;
  background: #000;
  /* Evitar selección y menú contextual en Safari */
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.video-watermark-container video {
  /* Evitar que Safari muestre controles de descarga */
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: auto;
}

/* Ocultar botón fullscreen nativo */
.video-watermark-container video::-webkit-media-controls-fullscreen-button {
  display: none !important;
}

/* Botón fullscreen personalizado */
.video-watermark-container .video-fullscreen-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
  width: 36px;
  height: 36px;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.video-watermark-container .video-fullscreen-btn:hover {
  opacity: 1;
}

/* Estilos cuando está en fullscreen */
.video-watermark-container:fullscreen,
.video-watermark-container:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.video-watermark-container:fullscreen video,
.video-watermark-container:-webkit-full-screen video {
  max-height: 100vh;
  max-width: 100vw;
  width: auto;
  height: auto;
}

/* Fullscreen "falso" para iOS (mantener marcas de agua) */
body.video-fs-open {
  overflow: hidden;
}
.video-watermark-container.is-fake-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.video-watermark-container.is-fake-fullscreen video {
  max-height: 100vh;
  max-width: 100vw;
  width: auto;
  height: auto;
}

/* Marcas de agua */
.video-watermark-container .video-watermark {
  pointer-events: none;
  z-index: 10;
}
.video-watermark-container .watermark-text {
  font-family: "Poppins", "Inter", system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(14px, 4vw, 28px);
  letter-spacing: 0.5px;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
  opacity: 0.35;
  transform: rotate(-15deg);
  animation: watermarkFloat 8s ease-in-out infinite;
}
.video-watermark-container .watermark-text small {
  font-size: 0.65em;
  font-weight: 500;
}
.video-watermark-container .watermark-corner {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 500;
  font-size: 12px;
  pointer-events: none;
  z-index: 10;
  opacity: 0.4;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.9);
}

/* PDF viewer en modal de recursos */
.resource-pdf-wrapper .resource-pdf-frame {
  height: min(80vh, calc(100vh - 210px));
}

.resource-pdf-wrapper .resource-pdf-fullscreen-btn {
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 36px;
  height: 36px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.resource-pdf-wrapper .resource-pdf-fullscreen-btn:hover {
  opacity: 1;
}

.resource-pdf-wrapper:fullscreen,
.resource-pdf-wrapper:-webkit-full-screen {
  padding: 0 !important;
  width: 100vw;
  height: 100vh;
  background: #101214 !important;
}

.resource-pdf-wrapper:fullscreen .resource-pdf-frame,
.resource-pdf-wrapper:-webkit-full-screen .resource-pdf-frame {
  height: 100vh !important;
  border-radius: 0 !important;
}

.resource-pdf-wrapper.is-fake-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1080 !important;
  padding: 0 !important;
  background: #101214 !important;
}

.resource-pdf-wrapper.is-fake-fullscreen .resource-pdf-frame {
  height: 100vh !important;
  border-radius: 0 !important;
}

/* Recursos: cuando hay filtros, el primer visible puede no ser el primer hermano */
#allResourcesModal .list-group > .list-group-item.is-first-visible {
  border-top-width: var(--bs-list-group-border-width, 1px);
}

@keyframes watermarkFloat {
  0%, 100% { transform: rotate(-15deg) translateY(0); }
  50% { transform: rotate(-15deg) translateY(-5px); }
}

.course-tabs-scroller {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.course-tabs-scroller::-webkit-scrollbar {
  display: none;
}

#course-page,
#course-page .row,
#course-page [class^="col-"],
#course-page [class*=" col-"] {
  min-width: 0;
}

#courseTabs.course-tabs-app {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
}

#courseTabs.course-tabs-app .course-tab-item {
  flex: 1 1 0;
  min-width: 0;
}

#courseTabs.course-tabs-app .course-tab-link {
  color: var(--bs-secondary-color);
  background: transparent;
  border: 0;
  box-shadow: none;
}

#courseTabs.course-tabs-app .course-tab-link:hover,
#courseTabs.course-tabs-app .course-tab-link:focus {
  color: var(--bs-primary);
  background: transparent;
  box-shadow: none;
}

#courseTabs.course-tabs-app .course-tab-link.active {
  color: var(--bs-primary);
  background: transparent;
  box-shadow: none;
}

#courseTabs.course-tabs-app .course-tab-label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.15;
}

#courseTabs.course-tabs-app .course-tab-indicator {
  display: block;
  width: clamp(3rem, 40%, 4.75rem);
  height: .35rem;
  border-radius: 999px;
  background: var(--bs-secondary-bg-subtle);
  transition: background-color .2s ease, opacity .2s ease;
}

@media (max-width: 767.98px) {
  #courseTabs.course-tabs-app .course-tab-link {
    padding-top: .85rem !important;
    padding-bottom: .85rem !important;
  }

  #courseTabs.course-tabs-app .course-tab-label {
    white-space: normal;
    text-overflow: clip;
    font-size: .74rem;
    line-height: 1.1;
    letter-spacing: .03em;
  }

  #courseTabs.course-tabs-app .course-tab-indicator {
    width: 3.25rem;
  }
}

#courseTabs.course-tabs-app .course-tab-link.active .course-tab-indicator {
  background: var(--bs-primary);
}

#courseActions .course-test-rail-trigger {
  width: 100%;
  min-height: 100%;
  min-width: 0;
  padding: .5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  text-align: center;
  color: var(--bs-body-color);
  background: transparent;
  border: 0;
  box-shadow: none;
  transition: transform .18s ease, opacity .18s ease;
}

#courseActions .course-test-rail-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  margin-top: 1.2rem;
  min-width: 0;
  max-width: 100%;
}

#courseActions .course-test-rail-trigger:hover,
#courseActions .course-test-rail-trigger:focus {
  color: var(--bs-body-color);
  background: transparent;
  box-shadow: none;
}

#courseActions .course-test-rail-trigger:focus-visible {
  outline: 0;
}

#courseActions .course-test-rail-trigger[disabled] {
  opacity: .42;
  cursor: not-allowed;
}

#courseActions .course-test-rail-trigger:not([disabled]):hover,
#courseActions .course-test-rail-trigger:not([disabled]):focus-visible {
  transform: translateY(-2px);
}

#courseActions .course-test-rail-icon {
  width: clamp(3.8rem, 8.5vw, 4.65rem);
  height: clamp(3.8rem, 8.5vw, 4.65rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1.15rem;
  color: #fff;
  background: var(--course-action-color, var(--bs-secondary));
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, .96),
    0 0 0 6px var(--course-action-ring, rgba(108, 117, 125, .24)),
    0 .55rem 1.1rem rgba(15, 23, 42, .08);
}

#courseActions .course-test-rail-icon i {
  font-size: 1.9rem;
  line-height: 1;
}

#courseActions .course-test-rail-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  max-width: 100%;
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: normal;
  line-height: 1.1;
  text-wrap: balance;
}

#courseActions .course-test-rail-help {
  display: block;
  max-width: 100%;
  font-size: .82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: center;
}

#courseActions .course-test-rail-grid-3 .course-test-rail-icon {
  width: clamp(3.4rem, 7.1vw, 4rem);
  height: clamp(3.4rem, 7.1vw, 4rem);
}

#courseActions .course-test-rail-grid-3 .course-test-rail-icon i {
  font-size: 1.68rem;
}

#courseActions .course-test-rail-grid-3 .course-test-rail-label {
  font-size: .84rem;
}

#courseActions .course-test-rail-grid-3 .course-test-rail-help {
  font-size: .76rem;
  line-height: 1.28;
}

#courseActions .course-test-rail-dot {
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  flex: 0 0 auto;
}

#courseActions .course-test-rail-trigger.is-success .course-test-rail-icon {
  --course-action-color: rgba(25, 135, 84, .92);
  --course-action-ring: rgba(25, 135, 84, .28);
}

#courseActions .course-test-rail-trigger.is-primary .course-test-rail-icon {
  --course-action-color: rgba(13, 110, 253, .9);
  --course-action-ring: rgba(13, 110, 253, .28);
}

#courseActions .course-test-rail-trigger.is-special .course-test-rail-icon {
  --course-action-color: rgba(125, 133, 147, .9);
  --course-action-ring: rgba(125, 133, 147, .26);
}

#courseActions .course-test-rail-trigger.is-danger .course-test-rail-icon {
  --course-action-color: rgba(220, 53, 69, .9);
  --course-action-ring: rgba(220, 53, 69, .28);
}

.course-resources-card,
.course-resource-item,
.course-resource-row {
  min-width: 0;
  max-width: 100%;
}

.course-resource-row {
  width: 100%;
}

.course-resource-row > .flex-grow-1 {
  min-width: 0;
  width: 0;
}

.course-hero-actions {
  width: auto;
}

@media (max-width: 767.98px) {
  .course-status-mobile > * {
    min-width: 0;
  }

  .course-status-mobile-arrow {
    min-width: 0 !important;
  }

  .course-hero-row > * {
    min-width: 0;
  }

  .course-hero-actions {
    width: auto;
    flex-wrap: nowrap;
  }

  #courseActions .course-test-rail .row > .col {
    min-width: 0;
  }
}

@media (max-width: 575.98px) {
  .course-resource-row {
    flex-wrap: nowrap;
    align-items: flex-start !important;
  }

  .course-resource-actions {
    width: auto;
    margin-left: .5rem !important;
    margin-top: 0;
    justify-content: flex-start;
  }

  .course-resource-item .badge {
    max-width: none;
  }
}

@media (max-width: 575.98px) {
  #courseActions .course-test-rail-grid-3 .course-test-rail-trigger {
    padding-inline: 0;
  }

  #courseActions .course-test-rail-grid-3 .course-test-rail-icon {
    width: 2.85rem;
    height: 2.85rem;
  }

  #courseActions .course-test-rail-grid-3 .course-test-rail-icon i {
    font-size: 1.26rem;
  }

  #courseActions .course-test-rail-grid-3 .course-test-rail-label {
    font-size: .72rem;
  }

  #courseActions .course-test-rail-grid-3 .course-test-rail-help {
    font-size: .66rem;
    line-height: 1.18;
  }

  #courseActions .course-test-rail-trigger {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    padding: .35rem 0;
    text-align: center;
  }

  #courseActions .course-test-rail-copy {
    align-items: center;
    text-align: center;
    margin-top: 1.08rem;
  }

  #courseActions .course-test-rail-icon {
    width: 3.15rem;
    height: 3.15rem;
    flex: 0 0 auto;
    box-shadow:
      0 0 0 3px rgba(255, 255, 255, .96),
      0 0 0 5px var(--course-action-ring, rgba(108, 117, 125, .24)),
      0 .4rem .85rem rgba(15, 23, 42, .08);
  }

  #courseActions .course-test-rail-icon i {
    font-size: 1.5rem;
  }

  #courseActions .course-test-rail-label {
    justify-content: center;
    font-size: .8rem;
    letter-spacing: .02em;
  }

  #courseActions .course-test-rail-help {
    font-size: .72rem;
    line-height: 1.25;
    text-align: center;
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  #courseActions .course-test-rail-trigger {
    gap: .6rem;
    padding-inline: .1rem;
  }

  #courseActions .course-test-rail-icon {
    width: 3.4rem;
    height: 3.4rem;
    box-shadow:
      0 0 0 3px rgba(255, 255, 255, .96),
      0 0 0 5px var(--course-action-ring, rgba(108, 117, 125, .24)),
      0 .4rem .85rem rgba(15, 23, 42, .08);
  }

  #courseActions .course-test-rail-icon i {
    font-size: 1.55rem;
  }

  #courseActions .course-test-rail-label {
    font-size: .78rem;
    letter-spacing: .02em;
  }

  #courseActions .course-test-rail-help {
    font-size: .7rem;
    line-height: 1.22;
  }
}
