/* ══════════════════════════════════════════
   UTILIDADES — clases reutilizables
   ══════════════════════════════════════════ */

/* Layout */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-start { display: flex; align-items: flex-start; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; min-width: 0; }
.flex-shrink-0 { flex-shrink: 0; }
.fx-row { display: flex; align-items: center; gap: 8px; }
.fx-row-end { display: flex; align-items: flex-end; gap: 8px; }
.gap-2 { gap: 2px; }
.gap-3 { gap: 3px; }
.gap-4 { gap: 4px; }
.gap-5 { gap: 5px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

/* Flex sin min-width */
.fx-1 { flex: 1; }

/* Texto */
.text-center { text-align: center; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 14px; }
.text-base { font-size: 16px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 22px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.uppercase { text-transform: uppercase; letter-spacing: 0.5px; }
.leading-tight { line-height: 1.3; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* Colores semánticos */
.text-primary { color: var(--text); }
.text-secondary { color: var(--text2); }
.text-muted { color: var(--text3); }
.text-accent { color: var(--accent); }
.text-green { color: var(--green); }

/* Spacing */
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 2px; }
.mt-4 { margin-top: 4px; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-28 { margin-top: 28px; }
.mb-4 { margin-bottom: 4px; }
.mb-6 { margin-bottom: 6px; }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.m-0 { margin: 0; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }
.h-40 { height: 40px; }
.tar { text-align: right; }
.tac { text-align: center; }
.cp { cursor: pointer; }
.fx-end { justify-content: flex-end; }
.items-end { align-items: flex-end; }
.fx-center { justify-content: center; }
.p-20 { padding: 20px; }
.c-text3 { color: var(--text3); }
.c-text2 { color: var(--text2); }
.c-text { color: var(--text); }
.c-green { color: var(--green); }
.c-red { color: var(--red); }
.c-assigned { color: #8b7faa; }
.hl { color: var(--green); font-weight: 600; }
.hl--violet { color: #9b7dd4; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fs-14 { font-size: 14px; }
.text-title { font-weight: 600; font-size: 14px; color: var(--text); }

.p-8 { padding: 8px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }

.mt-10 { margin-top: 10px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 2px; }
.mb-14 { margin-bottom: 14px; }
.mb-20 { margin-bottom: 20px; }
.mb-22 { margin-bottom: 22px; }
.ml-4 { margin-left: 4px; }

.fs-9 { font-size: 9px; }
.fs-10 { font-size: 10px; }
.fs-11 { font-size: 11px; }
.fs-13 { font-size: 13px; }
.fs-15 { font-size: 15px; }
.fs-16 { font-size: 16px; }
.fs-18 { font-size: 18px; }
.fs-20 { font-size: 20px; }
.fs-22 { font-size: 22px; }
.fs-24 { font-size: 24px; }
.fw-400 { font-weight: 400; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.italic { font-style: italic; }
.lh-12 { line-height: 1.2; }
.lh-13 { line-height: 1.3; }
.lh-14 { line-height: 1.4; }
.lh-15 { line-height: 1.5; }

.pos-relative { position: relative; }
.pos-static { position: static; }
.shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.min-h-16 { min-height: 16px; }
.tt-up { text-transform: uppercase; }
.w-full { width: 100%; }
.invisible { visibility: hidden; }

.z-960 { z-index: 960; }
.z-1100 { z-index: 1100; }
.z-1200 { z-index: 1200; }

.mw-120 { max-width: 120px; }
.mw-160 { max-width: 160px; }
.mw-340 { max-width: 340px; }
.mw-360 { max-width: 360px; }
.mw-420 { max-width: 420px; }
.mw-460 { max-width: 460px; }
.mw-480 { max-width: 480px; }
.mw-500 { max-width: 500px; }

.center-480 { max-width: 480px; margin: 0 auto; }

.mh-88vh { max-height: 88vh; }
.tal { text-align: left; }
.px-2 { padding-left: 2px; padding-right: 2px; }
.px-20 { padding-left: 20px; padding-right: 20px; }
.p-2 { padding: 2px; }
.pt-6 { padding-top: 6px; }
.pt-16 { padding-top: 16px; }
.pr-28 { padding-right: 28px; }
.pt-4 { padding-top: 4px; }
.pb-2 { padding-bottom: 2px; }
.pb-8 { padding-bottom: 8px; }
.py-3 { padding-top: 3px; padding-bottom: 3px; }
.py-4 { padding-top: 4px; padding-bottom: 4px; }
.py-6 { padding-top: 6px; padding-bottom: 6px; }
.py-16 { padding-top: 16px; padding-bottom: 16px; }
.px-4 { padding-left: 4px; padding-right: 4px; }
.px-8 { padding-left: 8px; padding-right: 8px; }
.py-8 { padding-top: 8px; padding-bottom: 8px; }
.py-12 { padding-top: 12px; padding-bottom: 12px; }
.py-20 { padding-top: 20px; padding-bottom: 20px; }
.py-24 { padding-top: 24px; padding-bottom: 24px; }
.py-40 { padding-top: 40px; padding-bottom: 40px; }
.py-60 { padding-top: 60px; padding-bottom: 60px; }
.mt-1 { margin-top: 1px; }
.mt-3 { margin-top: 3px; }
.mb-3 { margin-bottom: 3px; }
.mb-5 { margin-bottom: 5px; }
.mb-18 { margin-bottom: 18px; }
.ml-6 { margin-left: 6px; }
.mxa { margin-left: auto; margin-right: auto; }
.fs-12 { font-size: 12px; }
.fs-17 { font-size: 17px; }
.tracking { text-transform: uppercase; letter-spacing: 1px; }
.tracking-2 { text-transform: uppercase; letter-spacing: 2px; }
.items-center { align-items: center; }
.op-60 { opacity: 0.6; }
.fit-content { width: fit-content; }
.grid { display: grid; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.grid-7 { display: grid; grid-template-columns: repeat(7, 1fr); }
.gtc-2 { grid-template-columns: 1fr 1fr; }
.gtc-3 { grid-template-columns: repeat(3, 1fr); }
.gtc-7 { grid-template-columns: repeat(7, 1fr); }
.gtr-6 { grid-template-rows: repeat(6, 1fr); }
.grid-col-full { grid-column: 1 / -1; }
.w-28 { width: 28px; }
.w-48 { width: 48px; }
.w-54 { width: 54px; }
.w-55 { width: 55px; }
.w-80 { width: 80px; }
.w-120 { width: 120px; }
.h-48 { height: 48px; }
.h-54 { height: 54px; }

/* Heights */
.h-30 { height: 30px; }
.h-80 { height: 80px; }

/* Bordes y fondos */
.rounded { border-radius: var(--rs); }
.rounded-lg { border-radius: 12px; }
.rounded-full { border-radius: 9999px; }
.bg-card { background: var(--card); }
.bg-surface { background: var(--bg2); }
.border { border: 1px solid var(--border); }

/* Visibilidad */
.hidden { display: none; }
.block { display: block; }
.op-50 { opacity: 0.5; }

/* Componentes */
.chip { font-size: 11px; padding: 4px 10px; border-radius: 20px; font-weight: 600; }
.chip--outline { background: var(--bg2); border: 1px solid var(--border); color: var(--text2); }
.chip--accent { background: rgba(107,155,150,0.12); color: var(--green); }
.section-label { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; }
.btn-ghost { background: none; border: 1px solid var(--border); color: var(--text3); font-size: 14px; font-weight: 600; font-family: inherit; padding: 6px 10px; border-radius: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: all 0.15s; }
@media (hover: hover) { .btn-ghost:hover { border-color: var(--text2); color: var(--text2); } }
.btn-primary { background: linear-gradient(135deg,#34d399,#8b5cf6,#3b82f6,#34d399); background-size: 400% 400%; animation: aurora 8s ease infinite; color: #fff; border: none; border-radius: 10px; padding: 10px 20px; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.btn-icon { background: none; border: 1px solid transparent; color: var(--text3); cursor: pointer; padding: 4px; border-radius: 8px; transition: all 0.2s; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; -webkit-tap-highlight-color: transparent; }
.btn-link { background: none; border: none; color: var(--text3); font-family: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.btn-link--green { background: none; border: none; color: var(--green); font-family: inherit; cursor: pointer; }
.btn-link--sm { font-size: 10px; font-weight: 600; }
.btn-link--md { font-size: 11px; font-weight: 600; }
.card-base { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.card-hist { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 6px 14px; }

/* Badge warning (6+ semanas) */
.badge-warn { display: inline-flex; align-items: center; gap: 5px; background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.25); border-radius: 20px; padding: 4px 12px; font-size: 11px; color: #f59e0b; font-weight: 600; letter-spacing: 0.2px; }

/* Textarea */
.resize-none { resize: none; font-family: inherit; }

/* Exercise instructions */
.ex-instructions { margin: 0; padding: 0; list-style: none; counter-reset: ex-step; display: flex; flex-direction: column; gap: 10px; }
.ex-instructions li { position: relative; counter-increment: ex-step; padding: 10px 12px 10px 42px; background: var(--bg2); border-radius: 10px; font-size: 13.5px; color: var(--text); line-height: 1.55; }
.ex-instructions li::before { content: counter(ex-step); position: absolute; left: 10px; top: 9px; width: 22px; height: 22px; border-radius: 50%; background: rgba(107,155,150,0.16); color: var(--green); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ex-tips { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.ex-tips li { position: relative; padding: 0 0 0 20px; font-size: 13.5px; color: var(--text2); line-height: 1.55; }
.ex-tips li::before { content: ""; position: absolute; left: 4px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.ex-yt-embed { border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; }
.ex-yt-embed--short { aspect-ratio: 9/16; max-height: 70vh; }
.ex-yt-embed iframe { width: 100%; height: 100%; border: none; }
.media-slide--loading { background: var(--bg2); display: flex; align-items: center; justify-content: center; }

/* Gestor de ejercicios (exm) */
.exm-sticky-header { position: sticky; top: var(--header-h); z-index: 40; background: var(--bg); padding: 10px 0 8px; }
.exm-filter-btn { font-size: 10px; padding: 5px 10px; }
.exm-page-btn { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; font-size: 11px; cursor: pointer; font-family: inherit; color: var(--text2); }
.exm-page-btn:disabled { opacity: 0.4; cursor: default; }
.exm-table { width: 100%; border-collapse: collapse; font-size: 14px; max-width: 900px; }
.exm-thead { text-align: left; color: var(--text3); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
.exm-th { padding: 8px 4px; }
.exm-row { border-bottom: 1px solid var(--border); }
.exm-row--checked { opacity: 0.55; }
.exm-td { padding: 5px 4px; }
.exm-td--check { text-align: center; }
.exm-td--center { text-align: center; }
.exm-check-btn { background: none; border: none; cursor: pointer; padding: 2px; }
.exm-thumb-img { width: 36px; height: 36px; object-fit: contain; border-radius: 3px; background: var(--bg2); cursor: zoom-in; }
.exm-dash { color: var(--border); font-size: 9px; }
.exm-visibility-btn { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; font-size: 10px; font-weight: 700; cursor: pointer; font-family: inherit; color: var(--green); min-width: 50px; }
.exm-visibility-btn--hidden { color: var(--red); }
.exm-name { font-weight: 600; font-size: 13px; line-height: 1.3; }
.exm-name-en { font-size: 10px; color: var(--text3); font-style: italic; line-height: 1.3; }
.exm-meta { font-size: 9px; color: var(--text3); margin-top: 1px; }

/* Empty states */
.empty-state { padding: 40px 0; text-align: center; color: var(--text3); font-size: 14px; }
.empty-state--loading { padding: 40px; text-align: center; color: var(--text3); font-size: 13px; }
.empty-state--loading-sm { padding: 20px; text-align: center; color: var(--text3); font-size: 13px; }
.empty-state--sm { padding: 20px 0; text-align: center; }
.empty-state-lg { padding: 60px 0; text-align: center; }
.empty-state-lg__title { font-size: 15px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.empty-state-lg__desc { font-size: 13px; color: var(--text3); }

/* Stats */
.stats-separator { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text3); margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

/* Spacer */
.spacer { height: 20px; }

/* Interacción */
.clickable { cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* Scroll sin barra visible (sigue scrolleando) — pop-ups y modales */
.no-scrollbar,
.banco-sheet-scroll,
.fsheet-scroll,
.ex-detail-body,
.modal-body,
.modal-sheet,
.lib-preview-body,
.assign-sheet-opts,
.rpe-guide-body,
.orm-modal-body,
.ex-picker-list,
.video-body,
.myprofe-modal-card {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.no-scrollbar::-webkit-scrollbar,
.banco-sheet-scroll::-webkit-scrollbar,
.fsheet-scroll::-webkit-scrollbar,
.ex-detail-body::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.modal-sheet::-webkit-scrollbar,
.lib-preview-body::-webkit-scrollbar,
.assign-sheet-opts::-webkit-scrollbar,
.rpe-guide-body::-webkit-scrollbar,
.orm-modal-body::-webkit-scrollbar,
.ex-picker-list::-webkit-scrollbar,
.video-body::-webkit-scrollbar,
.myprofe-modal-card::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.pre-line { white-space: pre-line; }
.reveal-up { opacity: 0; transform: translateY(10px); animation: revealUp 0.34s ease forwards; }
@keyframes revealUp { to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .reveal-up { opacity: 1; transform: none; animation: none; }
}
