/* ============================================================
   Historial de cursos — desplegable del panel del estudiante y sus tarjetas
   Salen del lienzo "Rediseño de inscripción CODEX" (Historial de cursos).
   ============================================================ */

.hx, .hx-body { color: var(--pc-ink); }

/* El desplegable */
.hx { margin-bottom: 24px; background: #fff; border: 1px solid var(--pc-line); border-radius: 20px; }
.hx-summary { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 18px; cursor: pointer; list-style: none; }
.hx-summary::-webkit-details-marker { display: none; }
.hx-summary:focus-visible { outline: 3px solid rgba(0, 188, 212, 0.45); outline-offset: -3px; border-radius: 20px; }
.hx-summary-ic { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: rgba(107, 70, 193, 0.1); color: var(--pc-purple); }
.hx-summary-title { display: block; font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.hx-summary-hint { display: block; font-size: 12px; font-weight: 600; color: var(--pc-muted); }
.hx-arrow { margin-left: auto; color: var(--pc-muted); transition: transform 0.15s; }
.hx[open] > .hx-summary .hx-arrow { transform: rotate(180deg); }
.hx-content { padding: 0 18px 18px; }
.hx-loading, .hx-empty { margin: 0; padding: 18px; border: 1px dashed var(--pc-line); border-radius: 16px; color: var(--pc-muted); font-size: 14px; font-weight: 600; text-align: center; }

/* Tarjetas */
.h-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.h-card { background: #fff; border: 1px solid var(--pc-line); border-radius: 22px; overflow: hidden; }
.h-card[hidden] { display: none; }
.h-card::before { content: ''; display: block; height: 6px; background: var(--pc-cyan); }
.h-card.pay::before, .h-card.review::before { background: #f59e0b; }
.h-card.ok::before { background: #059669; }
.h-card.bad::before { background: #e11d48; }
.h-card.frozen::before { background: #8696a8; }
.h-head { display: flex; gap: 14px; padding: 16px 18px 12px; }
.h-title { min-width: 0; }
.h-title h3 { margin: 6px 0 0; font-size: 17px; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; color: var(--pc-ink); }
.h-title p { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--pc-muted); }
.h-last { color: #b45309; }

.h-grade { margin: 0 18px 14px; padding: 14px; border-radius: 16px; background: var(--pc-cream); }
.h-lbl { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pc-muted); }
.h-grade.none > b { display: block; margin-top: 2px; font-size: 18px; font-weight: 800; color: var(--pc-muted); }
.h-num { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.h-num b { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.h-num span { font-size: 16px; font-weight: 700; color: var(--pc-muted); }
.h-grade.ok { background: #ecfdf5; } .h-grade.ok .h-num b { color: #047857; }
.h-grade.bad { background: #fff1f2; } .h-grade.bad .h-num b { color: #be123c; }
.h-meter { position: relative; height: 8px; margin: 10px 0 6px; border-radius: 4px; background: rgba(0, 51, 102, 0.1); }
.h-meter i { display: block; height: 100%; border-radius: 4px; background: #059669; }
.h-grade.bad .h-meter i { background: #e11d48; }
.h-meter s { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--pc-ink); opacity: 0.55; }
.h-grade small { font-size: 12px; font-weight: 600; color: var(--pc-muted); }

.h-cert { display: flex; align-items: center; gap: 12px; margin: 0 18px 10px; padding: 12px 14px; border-radius: 16px; background: linear-gradient(135deg, #fef3c7, #fde68a); color: #78350f; }
.h-cert-ic { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: #b45309; font-size: 20px; }
.h-cert b { display: block; font-size: 15px; font-weight: 800; }
.h-cert small { font-size: 12px; font-weight: 600; }

.h-acts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0 18px 8px; }
.h-acts.two { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.h-link { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; color: var(--pc-muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.h-link.danger { color: #9f1239; }
.h-note { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #fffbeb; color: #78350f; font-size: 13px; font-weight: 600; }

.h-more { margin: 4px 18px 16px; border-top: 1px solid var(--pc-line-soft); }
.h-more summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; color: var(--pc-muted); font-size: 13px; font-weight: 700; cursor: pointer; list-style: none; }
.h-more summary::-webkit-details-marker { display: none; }
.h-arrow { transition: transform 0.15s; }
.h-more[open] .h-arrow { transform: rotate(180deg); }
.h-more dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 0 0 4px; }
.h-more dt { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--pc-muted); }
.h-more dd { margin: 2px 0 0; font-size: 14px; font-weight: 700; }

@media (min-width: 768px) {
  .h-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
