/* ============================================================
   Repositorio de Cursos HRX — Red Personas
   Diseño Premium — Estilo Apple
   Paleta: #ff4800 naranja | #1D1D1F negro | #86868b gris | #f5f5f7 fondo
   ============================================================ */

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --naranja:       #ff4800;
  --naranja-hover: #e03e00;
  --negro:         #1D1D1F;
  --gris-texto:    #86868b;
  --gris-borde:    #d2d2d7;
  --gris-claro:    #f5f5f7;
  --blanco:        #FFFFFF;
  --verde:         #34c759;
  --rojo:          #ff3b30;
  --azul:          #0071e3;
  --radio-sm:      8px;
  --radio:         14px;
  --radio-lg:      20px;
  --sombra-sm:     0 1px 4px rgba(0,0,0,0.06);
  --sombra:        0 4px 24px rgba(0,0,0,0.08);
  --sombra-lg:     0 12px 48px rgba(0,0,0,0.12);
  --trans:         0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gris-claro);
  color: var(--negro);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--naranja); text-decoration: none; transition: var(--trans); }
a:hover { color: var(--naranja-hover); }

/* ── LOGIN ────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #fafafa 0%, #f0f0f2 100%);
  padding: 20px;
}

.login-card {
  background: var(--blanco);
  border-radius: var(--radio-lg);
  box-shadow: var(--sombra-lg);
  padding: 52px 44px;
  width: 100%;
  max-width: 440px;
  border: 1px solid rgba(0,0,0,0.04);
}

.login-card .logo {
  text-align: center;
  margin-bottom: 36px;
}

.login-card .logo h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--negro);
  letter-spacing: -0.5px;
}

.login-card .logo span { color: var(--naranja); }

.login-card .logo p {
  font-size: 13px;
  color: var(--gris-texto);
  margin-top: 6px;
  font-weight: 500;
}

.login-tabs {
  display: flex;
  background: var(--gris-claro);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 28px;
}

.login-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--gris-texto);
  border-radius: 8px;
  transition: var(--trans);
}

.login-tab.active {
  background: var(--blanco);
  color: var(--negro);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ── FORMS ────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: var(--gris-texto);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--gris-borde);
  border-radius: var(--radio-sm);
  font-size: 15px;
  transition: var(--trans);
  background: var(--blanco);
  color: var(--negro);
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--naranja);
  box-shadow: 0 0 0 3px rgba(255, 72, 0, 0.1);
}

.form-group textarea { resize: vertical; min-height: 100px; }
.hint { font-size: 12px; color: var(--gris-texto); margin-top: 6px; line-height: 1.5; }

/* ── BOTONES ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: var(--radio-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--trans);
  text-decoration: none;
  letter-spacing: -0.1px;
}

.btn-primary {
  background: var(--naranja);
  color: #fff;
}

.btn-primary:hover {
  background: var(--naranja-hover);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 72, 0, 0.3);
}

.btn-secondary {
  background: var(--gris-claro);
  color: var(--negro);
}

.btn-secondary:hover {
  background: #e8e8ed;
  text-decoration: none;
}

.btn-danger { background: var(--rojo); color: #fff; }
.btn-danger:hover { background: #d6332a; color: #fff; }

.btn-sm { padding: 7px 16px; font-size: 13px; border-radius: 6px; }
.btn-full { width: 100%; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--naranja);
  color: var(--naranja);
}

.btn-outline:hover {
  background: var(--naranja);
  color: #fff;
  text-decoration: none;
}

/* ── LAYOUT ADMIN ─────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  background: var(--blanco);
  color: var(--negro);
  border-right: 1px solid var(--gris-borde);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: var(--trans);
}

.sidebar-logo {
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--gris-borde);
}

.sidebar-logo h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.sidebar-logo span { color: var(--naranja); }
.sidebar-logo small { display: block; font-size: 11px; color: var(--gris-texto); margin-top: 3px; }

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gris-texto);
  padding: 16px 22px 6px;
  font-weight: 700;
  transition: color var(--trans);
}
.nav-section:hover { color: var(--negro); }

.nav-caret {
  flex-shrink: 0;
  opacity: 0.55;
  transition: transform 0.2s ease;
}
.nav-group.collapsed .nav-caret { transform: rotate(-90deg); }
.nav-group.collapsed .nav-group-items { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  color: #5b5b60;
  font-size: 14px;
  font-weight: 500;
  transition: var(--trans);
  border-left: 3px solid transparent;
  cursor: pointer;
}

.nav-item:hover {
  color: var(--negro);
  background: var(--gris-claro);
  text-decoration: none;
}

.nav-item.active {
  color: var(--negro);
  background: rgba(255, 72, 0, 0.10);
  border-color: var(--naranja);
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.nav-item:hover svg, .nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 18px 22px;
  border-top: 1px solid var(--gris-borde);
}

.sidebar-footer .user-name { font-size: 13px; font-weight: 600; }
.sidebar-footer .user-role { font-size: 11px; color: var(--gris-texto); }
.sidebar-footer .btn-secondary { border: 1px solid var(--gris-borde); }

.main-content { margin-left: 250px; flex: 1; }

.topbar {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 16px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.3px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.content-body { padding: 32px 36px; }

/* ── CARDS ────────────────────────────────────────────────── */
.card {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra-sm);
  padding: 28px;
  border: 1px solid rgba(0,0,0,0.04);
  transition: var(--trans);
}

.card:hover { box-shadow: var(--sombra); }

.card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gris-claro);
  letter-spacing: -0.2px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra-sm);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(0,0,0,0.04);
  transition: var(--trans);
}

.stat-card:hover {
  box-shadow: var(--sombra);
  transform: translateY(-2px);
}

.stat-card .stat-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--naranja);
  letter-spacing: -1px;
  line-height: 1;
}

.stat-card .stat-label { font-size: 13px; color: var(--gris-texto); font-weight: 500; }
.stat-card .stat-icon { font-size: 1.5rem; margin-bottom: 4px; }

/* ── TABLAS ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radio-sm); }

table { width: 100%; border-collapse: collapse; }

th {
  background: var(--gris-claro);
  color: var(--gris-texto);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gris-claro);
  font-size: 14px;
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255, 72, 0, 0.02); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-green  { background: #e8f9ed; color: #188348; }
.badge-orange { background: #fff4ee; color: var(--naranja); }
.badge-gray   { background: var(--gris-claro); color: var(--gris-texto); }
.badge-blue   { background: #e6f0ff; color: #0066cc; }
.badge-red    { background: #ffe8e5; color: #d70015; }

/* ── ALERTAS ──────────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radio-sm);
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
}

.alert-success { background: #e8f9ed; color: #188348; border-left: 4px solid #34c759; }
.alert-error   { background: #ffe8e5; color: #d70015; border-left: 4px solid #ff3b30; }
.alert-info    { background: #e6f0ff; color: #0055b3; border-left: 4px solid #0071e3; }
.alert-warning { background: #fff4ee; color: #b34a00; border-left: 4px solid var(--naranja); }

/* ── PROGRESO ─────────────────────────────────────────────── */
.progress-bar {
  background: var(--gris-claro);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--naranja), #ff6b33);
  border-radius: 20px;
  transition: width 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ── LAYOUT PARTICIPANTE ──────────────────────────────────── */
.part-header {
  background: var(--blanco);
  color: var(--negro);
  border-bottom: 1px solid var(--gris-borde);
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.part-header a { color: var(--negro); }
.part-header .btn-secondary { border: 1px solid var(--gris-borde); }

.part-header .logo-text {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.2px;
}

.part-header .logo-text span { color: var(--naranja); }

.part-body {
  max-width: 960px;
  margin: 0 auto;
  padding: 36px 28px;
}

/* ── DASHBOARD PARTICIPANTE ───────────────────────────────── */
.dashboard-hero {
  background: var(--blanco);
  border-radius: var(--radio-lg);
  box-shadow: var(--sombra);
  padding: 36px;
  margin-bottom: 28px;
  border: 1px solid rgba(0,0,0,0.04);
}

.dashboard-hero .hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.dashboard-hero .hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.3;
  margin-bottom: 6px;
}

.dashboard-hero .hero-desc {
  color: var(--gris-texto);
  font-size: 14px;
  line-height: 1.5;
}

.dashboard-hero .hero-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gris-texto);
  margin-top: 12px;
  background: var(--gris-claro);
  padding: 6px 12px;
  border-radius: 6px;
}

.section-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gris-texto);
  margin: 28px 0 14px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.hero-stat {
  background: var(--blanco);
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: var(--sombra-sm);
  border-radius: var(--radio);
  padding: 22px 20px;
  text-align: center;
  transition: var(--trans);
}

.hero-stat:hover {
  box-shadow: var(--sombra);
  transform: translateY(-2px);
}

.hero-stat .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--naranja);
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 6px;
}

.hero-stat .stat-label {
  font-size: 12px;
  color: var(--gris-texto);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-stat .progress-bar {
  margin-top: 12px;
  height: 6px;
}

/* ── ACTION CARDS ─────────────────────────────────────────── */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.action-card {
  display: block;
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra-sm);
  padding: 36px 28px;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--trans);
  text-decoration: none;
  color: var(--negro);
}

.action-card:hover {
  border-color: var(--naranja);
  box-shadow: var(--sombra);
  transform: translateY(-3px);
  text-decoration: none;
  color: var(--negro);
}

.action-card .action-icon {
  font-size: 2.8rem;
  margin-bottom: 14px;
  display: block;
}

.action-card .action-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.action-card .action-subtitle {
  color: var(--gris-texto);
  font-size: 13px;
  margin: 0;
}

/* ── MODULOS ──────────────────────────────────────────────── */
.modulo-card {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra-sm);
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.04);
}

.modulo-header {
  padding: 16px 22px;
  background: var(--gris-claro);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.modulo-header .modulo-num {
  background: var(--naranja);
  color: #fff;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.material-item {
  padding: 14px 22px;
  border-bottom: 1px solid var(--gris-claro);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--trans);
}

.material-item:last-child { border-bottom: none; }
.material-item:hover { background: rgba(255,72,0,0.02); }

.material-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radio-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.material-icon.yt   { background: #ffe8e5; }
.material-icon.pdf  { background: #ffe8e5; }
.material-icon.html { background: #e6f0ff; }
.material-icon.web  { background: #e8f9ed; }

.material-info { flex: 1; }
.material-info h4 { font-size: 14px; font-weight: 600; }
.material-info small { color: var(--gris-texto); font-size: 12px; }
.visto-check { color: var(--verde); font-size: 1.2rem; }

/* ── MODAL ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: var(--trans);
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--blanco);
  border-radius: var(--radio-lg);
  padding: 36px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--sombra-lg);
}

.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; letter-spacing: -0.2px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--negro);
  padding: 6px;
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: 270px; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .content-body { padding: 20px 16px; }
  .topbar { padding: 12px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .login-card { padding: 36px 24px; }
  .part-body { padding: 20px 14px; }
  .part-header { padding: 0 16px; }
  table { font-size: 13px; }
  td, th { padding: 10px; }
  .hero-stats { grid-template-columns: 1fr; }
  .action-grid { grid-template-columns: 1fr; }
  .dashboard-hero { padding: 24px; }
  .dashboard-hero .hero-title { font-size: 1.25rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 1rem; }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 99;
}

.sidebar-overlay.active { display: block; }

/* ── MARCA / LOGO Red Personas ────────────────────────────────
   logo-rp*.png = original recortado sin pérdida (solo se quitó el
   margen transparente). Se escala con width:%, sin distorsión. */
.login-card .logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-card .logo img {
  display: block;
  margin: 0 auto;
  width: 68%;
  max-width: 230px;
  height: auto;
}
.login-card .logo p {
  text-align: center;
  font-size: 13px;
  color: var(--gris-texto);
  font-weight: 500;
  margin-top: 10px;
}
.sidebar-logo-img {
  display: block;
  width: 80%;
  height: auto;
  margin-bottom: 10px;
}
.part-header-logo {
  display: block;
  height: 30px;
  width: auto;
}

/* ── ÁRBOL DE MATERIALES (admin) ──────────────────────────── */
.tree-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tree-toolbar #tree-filter {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
  padding: 9px 12px;
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio-sm);
  font-size: 14px;
}
.tree-toolbar-btns { display: flex; gap: 8px; }

.filetree { display: flex; flex-direction: column; gap: 10px; }

.ft-curso {
  background: var(--blanco);
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio);
  overflow: hidden;
}
.ft-curso-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.ft-toggle {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--negro);
  text-align: left;
  padding: 4px;
}
.ft-caret {
  flex-shrink: 0;
  opacity: 0.5;
  transform: rotate(-90deg);
  transition: transform 0.2s ease;
}
.ft-curso.open .ft-caret { transform: none; }
.ft-folder { font-size: 1rem; flex-shrink: 0; }
.ft-curso-nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-count {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--gris-texto);
}

.ft-curso-body { display: none; padding: 4px 14px 14px; }
.ft-curso.open .ft-curso-body { display: block; }

.ft-empty, .ft-noresults {
  color: var(--gris-texto);
  font-size: 13px;
  padding: 14px 4px;
}
.ft-noresults { padding: 20px 4px; }

.ft-modulo { margin-top: 10px; }
.ft-modulo-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gris-texto);
  padding: 6px 4px;
}

.ft-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 18px;
  border-radius: var(--radio-sm);
  transition: background var(--trans);
}
.ft-item:hover { background: var(--gris-claro); }
.ft-item-icon { flex-shrink: 0; font-size: 1rem; }
.ft-item-titulo {
  font-weight: 500;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ft-item-meta {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--gris-texto);
}
.ft-item-acciones { flex-shrink: 0; display: flex; gap: 6px; }

@media (max-width: 768px) {
  .ft-item { flex-wrap: wrap; }
  .ft-item-meta { margin-left: 28px; order: 3; }
  .ft-item-acciones { margin-left: auto; }
}

/* ── VISTA PREVIA DEL PARTICIPANTE (admin) ────────────────── */
.preview-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #e6f0ff;
  border: 1px solid #b9d3f7;
  border-radius: var(--radio);
  padding: 12px 16px;
  margin-bottom: 20px;
}
.preview-tag { font-weight: 700; font-size: 13px; color: #0055b3; }
.preview-curso { font-weight: 600; font-size: 14px; }
.preview-nota { font-size: 12px; color: var(--gris-texto); }
.preview-banner .btn { margin-left: auto; }

/* ── TABLAS: ordenar / filtrar / paginar ──────────────────── */
.tbl-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.tbl-tools .tbl-search {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
  padding: 8px 12px;
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio-sm);
  font-size: 14px;
  font-family: inherit;
}
.tbl-tools .tbl-count { font-size: 12px; color: var(--gris-texto); }
.tbl-tools .tbl-size {
  margin-left: auto;
  font-size: 13px;
  color: var(--gris-texto);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tbl-tools .tbl-size select {
  padding: 6px 8px;
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio-sm);
  font-size: 13px;
  font-family: inherit;
}

th.tbl-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.tbl-sortable:hover { color: var(--negro); }
th.tbl-sortable .tbl-caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0.25;
}
th.tbl-sortable[aria-sort="ascending"] .tbl-caret {
  border-bottom: 5px solid currentColor;
  opacity: 0.9;
}
th.tbl-sortable[aria-sort="descending"] .tbl-caret {
  border-top: 5px solid currentColor;
  opacity: 0.9;
}

.tbl-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--gris-texto);
}
.tbl-pager button {
  padding: 6px 14px;
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio-sm);
  background: var(--blanco);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--trans);
}
.tbl-pager button:hover:not(:disabled) { background: var(--gris-claro); }
.tbl-pager button:disabled { opacity: 0.4; cursor: default; }

/* ── DISPONIBILIDAD (activo / programado / requisito) ─────── */
.material-locked { cursor: default; opacity: 0.75; }
.material-locked .material-icon { background: var(--gris-claro); }
.material-locked .material-info small { color: var(--gris-texto); }

.card-locked { opacity: 0.8; border-style: dashed; }

/* toggle en el árbol de materiales */
.ft-item-switch { display: inline-flex; align-items: center; flex-shrink: 0; }
.ft-item-switch input { width: 15px; height: 15px; cursor: pointer; }
.item-toggle-wrap.is-off .ft-item-titulo,
.item-toggle-wrap.is-off .ft-item-meta { opacity: 0.5; text-decoration: line-through; }
tr.item-toggle-wrap.is-off td { opacity: 0.55; }
.ft-chip {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--gris-texto);
  background: var(--gris-claro);
  border-radius: 999px;
  padding: 2px 8px;
}

/* ── Barra de emisión masiva de diplomas ──────────────────── */
.cert-bulkbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--gris-texto);
}
.cert-bulkbar #sel-count { font-weight: 700; color: var(--negro); }
