/* =====================================================================
 * Administración: detalle de curso, usuarios, certificados y reportes
 * ===================================================================== */

a.trow.crs { text-decoration: none; color: inherit; }

/* Cabecera del detalle de curso */
.ac-head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.ac-head h2 { margin: 0 0 .25rem; font-size: 1.35rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ac-head .hint { margin: 0; }
.ac-head .grow { flex: 1; min-width: 240px; }
.ac-img { width: 120px; aspect-ratio: 16 / 9; border-radius: 12px; background: var(--brand-50) center / cover no-repeat; flex: none; }
.ac-body { margin-top: 1rem; }
.trow.acs { grid-template-columns: minmax(0, 2fr) 1.2fr 1fr 170px; }
.trow.acs a.person { text-decoration: none; color: inherit; }
.icon-btn.danger:hover { background: var(--danger-50); color: var(--danger); }
.subtabs a { background: var(--card); }

/* Buscador de personas */
.pu-list { max-height: 55vh; overflow-y: auto; margin-top: .75rem; display: grid; gap: .25rem; }
.pu-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .55rem .4rem; border-radius: 12px; }
.pu-row:hover { background: var(--bg); }

/* Usuario y contraseña */
.cred-box { display: grid; gap: .6rem; background: var(--bg); border: 1.5px dashed var(--line); border-radius: 14px; padding: 1rem; }
.cred-box > div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .2rem .75rem; }
.cred-box small { grid-column: 1 / -1; color: var(--ink-3); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; }
.cred-box b { font-size: 1.15rem; word-break: break-all; }
.cred-box .hint { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9rem; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

/* Importar desde Excel */
.imp-steps { margin: 0 0 1rem; padding-left: 1.2rem; display: grid; gap: .6rem; }
.imp-steps li { line-height: 2; }
.imp-file { cursor: pointer; }
.imp-table { max-height: 45vh; overflow-y: auto; }
.trow.impr { grid-template-columns: 50px minmax(0, 1.4fr) 1.4fr 1fr 1.2fr; }
.trow.impres { grid-template-columns: 50px minmax(0, 1.6fr) 1fr 1fr 1fr; }
.trow.impres small { display: block; color: var(--ink-3); }
.trow.impr.bad { background: var(--danger-50); }

/* Certificados */
.trow.cer { grid-template-columns: minmax(0, 1.8fr) 1.6fr .8fr 1fr 84px; }
.trow.cer a.person { text-decoration: none; color: inherit; }
.trow.cer a.icon-btn { display: grid; place-items: center; text-decoration: none; }

/* Reportes */
.rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-top: 1rem; }
.rep-card { background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .55rem; align-items: flex-start; }
.rep-card h3 { margin: 0; font-size: 1.05rem; }
.rep-card .hint { margin: 0; flex: 1; }
.rep-card .tc-select { width: 100%; max-width: none; }
.rep-ico { width: 46px; height: 46px; border-radius: 14px; background: var(--brand-50); display: grid; place-items: center; font-size: 1.4rem; }

@media (max-width: 760px) {
  .trow.acs { grid-template-columns: minmax(0, 1fr) auto; }
  .trow.cer { grid-template-columns: minmax(0, 1.4fr) 1fr 84px; }
  .trow.impr { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .trow.impres { grid-template-columns: 40px minmax(0, 1fr) 1fr auto; }
}

/* Precio y acceso del curso */
.acc { max-width: 760px; }
.acc-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.acc-mode { display: flex; flex-direction: column; gap: .3rem; padding: 1rem; border: 2px solid var(--line); border-radius: 16px; background: var(--card); cursor: pointer; transition: border-color .15s, background .15s; }
.acc-mode input { position: absolute; opacity: 0; pointer-events: none; }
.acc-mode.on { border-color: var(--brand); background: var(--brand-50); }
.acc-mode small { color: var(--ink-2); line-height: 1.4; }
.acc-ico { font-size: 1.5rem; }
.acc-pay { margin-top: 1.25rem; background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 1.1rem 1.2rem; }
.acc-pay[hidden] { display: none; }
.acc-price { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: end; }
.acc-money { display: flex; align-items: center; gap: .5rem; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 .9rem; background: var(--bg); }
.acc-money:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.acc-money span, .acc-money em { font-weight: 800; color: var(--ink-2); font-style: normal; }
.acc-money input { border: 0 !important; box-shadow: none !important; background: transparent !important; font-size: 1.5rem; font-weight: 800; padding: .6rem 0 !important; width: 100%; min-width: 0; }
.acc-bs { background: var(--bg); border-radius: 12px; padding: .7rem .9rem; display: flex; flex-direction: column; gap: .1rem; margin-bottom: 1rem; }
.acc-bs b { font-size: 1.3rem; color: var(--brand); }
.acc-bs small { color: var(--ink-3); font-size: .78rem; }
.acc-gw { display: flex; flex-direction: column; gap: .3rem; border-radius: 14px; padding: .85rem 1rem; margin-top: .5rem; font-size: .9rem; }
.acc-gw.ok { background: var(--ok-50); }
.acc-gw.bad { background: var(--danger-50); }
.acc-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.25rem; }
.acc-foot .msg { flex-basis: 100%; order: 3; }
@media (max-width: 700px) { .acc-modes, .acc-price { grid-template-columns: 1fr; } }

/* Interruptor visible / oculto del curso */
.vis-toggle { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; font-weight: 700; font-size: .88rem; padding: .3rem .6rem .3rem .35rem; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); }
.vis-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.vis-track { width: 38px; height: 22px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; flex: none; }
.vis-track i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.vis-toggle.on .vis-track { background: var(--ok); }
.vis-toggle.on .vis-track i { transform: translateX(16px); }
.vis-toggle:not(.on) .vis-label { color: var(--ink-3); }

/* Secciones */
.trow.crs.sub { background: var(--bg); padding-top: .55rem; padding-bottom: .55rem; }
.sec-tag { font-weight: 700; font-size: .85rem; color: var(--brand); padding-left: .4rem; white-space: nowrap; }
.sec-intro { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; background: var(--brand-50); border-radius: 16px; padding: 1rem 1.2rem; margin-bottom: 1rem; }
.sec-intro p { margin: 0; flex: 1; min-width: 260px; color: var(--ink-2); line-height: 1.55; }
.sec-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.sec-card { background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.sec-card.open { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-50); }
.sec-top { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.sec-top b { font-size: 1.05rem; margin-right: .2rem; }
.sec-bar { width: 100%; height: 10px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.sec-bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.sec-bar i.hot { background: var(--accent); }
.sec-num { margin: 0; font-size: .9rem; color: var(--ink-2); }
.sec-num b { color: var(--ink); font-size: 1.1rem; }
.sec-card .hint { margin: 0; }

/* Catálogo por categorías */
.cat-tools { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.25rem; }
.cat-tools .search { max-width: 420px; }
.cat-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.cat-group { margin-bottom: 2rem; }
.cat-head { margin-bottom: .9rem; }
.cat-head h3 { margin: 0; font-size: 1.2rem; display: flex; align-items: baseline; gap: .5rem; }
.cat-head h3 small { font-size: .8rem; color: var(--ink-3); font-weight: 600; }
.cat-head p { margin: .25rem 0 0; color: var(--ink-2); }

/* Administración de categorías */
.cat-admin { display: grid; gap: .9rem; }
.cat-box { background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: .9rem 1.1rem; }
.cat-box.off { opacity: .7; }
.cat-box-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.cat-box-head h3 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cat-box-head h3 small { color: var(--ink-3); font-weight: 600; font-size: .8rem; }
.cat-box-head .hint { margin: .2rem 0 0; }
.cat-order { display: flex; flex-direction: column; }
.cat-order .icon-btn { width: 28px; height: 22px; font-size: .7rem; }
.cat-order .icon-btn:hover { background: var(--brand-50); color: var(--brand); }
.cat-order .icon-btn:disabled { opacity: .25; }
.cat-courses { margin-top: .75rem; border-top: 1px solid var(--line); }
.cat-course { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.cat-course:last-child { border-bottom: 0; }
.cat-course a { text-decoration: none; color: inherit; }
.cat-move { font-size: .8rem; color: var(--ink-3); display: flex; align-items: center; gap: .4rem; }
.cat-move select { padding: .35rem .6rem; border-radius: 9px; border: 1.5px solid var(--line); font: inherit; font-size: .82rem; background-color: var(--card); color: var(--ink); max-width: 200px; }
.cat-empty { margin: .6rem 0 0; }
.cat-box-head { flex-wrap: nowrap; }
.cat-box-head .grow { flex: 1; min-width: 0; }
.cat-box-head .tc-actions { flex: none; }
@media (max-width: 640px) { .cat-box-head { flex-wrap: wrap; } .cat-box-head .tc-actions { width: 100%; justify-content: flex-end; } }

/* Página de inicio: fotos */
.hp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.5rem; align-items: start; }
.hp-slots { display: grid; gap: .75rem; }
.hp-slot { display: flex; gap: 1rem; align-items: center; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: .75rem; }
.hp-thumb { width: 150px; aspect-ratio: 16 / 9; border-radius: 12px; background: var(--bg) center / cover no-repeat; flex: none; display: grid; place-items: center; text-align: center; border: 1.5px dashed var(--line); }
.hp-thumb[style*="background-image"] { border-style: solid; }
.hp-thumb span { font-size: .78rem; color: var(--ink-3); font-weight: 600; line-height: 1.3; }
.hp-info { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.hp-up { cursor: pointer; }
.hp-preview { position: sticky; top: 80px; display: flex; flex-direction: column; gap: .5rem; }
.hp-hero { position: relative; height: 230px; border-radius: 16px; overflow: hidden; background: radial-gradient(circle at 15% 20%, #0a85c7 0, #006298 45%, #003a5c 100%); }
.hp-text { position: absolute; left: 16px; top: 40px; width: 40%; color: #fff; display: flex; flex-direction: column; gap: 8px; }
.hp-text b { font-size: 1.05rem; line-height: 1.1; }
.hp-text i { display: block; height: 7px; border-radius: 9px; background: rgba(255, 255, 255, .35); }
.hp-text i + i { width: 70%; }
.hp-art { position: absolute; right: 12px; top: 22px; width: 52%; height: 185px; }
.hp-art .ha-pic { border-width: 2px; border-radius: 9px; box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }
@media (max-width: 900px) { .hp-layout { grid-template-columns: 1fr; } .hp-preview { position: static; } }
@media (max-width: 520px) { .hp-slot { flex-direction: column; align-items: stretch; } .hp-thumb { width: 100%; } }

/* Firma del certificado */
.cs-card { margin-bottom: 1.25rem; }
.cs-head { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.cs-head h3 { margin: 0; }
.cs-head .hint { margin: .15rem 0 0; }
.cs-head .kpi-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.cs-head .kpi-ico .lp-ico { width: 22px; height: 22px; }
.cs-head .grow { flex: 1; min-width: 220px; }
.cs-sign, .cs-preview { margin: 1rem 0 .5rem; max-width: 320px; background: #fff; color: #0f172a; border-radius: 14px; padding: 14px 18px; box-shadow: inset 0 0 0 1px var(--line); }
.cs-img { height: 64px; display: flex; align-items: flex-end; }
.cs-img img { max-height: 64px; max-width: 100%; object-fit: contain; }
.cs-line { height: 1px; background: #0f172a; opacity: .6; margin: 4px 0 8px; }
.cs-sign b, .cs-preview b { display: block; font-size: .95rem; }
.cs-sign small, .cs-preview small { color: #64748b; font-size: .8rem; }
.cs-tpl { margin: .25rem 0 0; }
.cs-warn { display: flex; gap: .4rem; align-items: center; color: #b45309; }
.cs-warn .lp-ico { width: 16px; height: 16px; }

/* Certificado: color del nombre del curso */
.cs-color { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.cs-color h4 { margin: 0 0 .6rem; }
.cs-swatches { display: flex; gap: .5rem; flex-wrap: wrap; }
.cs-sw { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; background: var(--c); box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--line); transition: box-shadow .15s, transform .15s; }
.cs-sw:hover { transform: scale(1.06); }
.cs-sw.on { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--c); }
.cs-sw:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.cs-custom { display: grid; place-items: center; background: conic-gradient(#ef4444, #f59e0b, #22c55e, #0ea5e9, #8b5cf6, #ef4444); }
.cs-custom.on { background: var(--c); }
.cs-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.cs-cprev { margin-top: .9rem; padding: .85rem 1rem; border-radius: 12px; background: #fff; font-family: 'Montserrat', 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 1.15rem; box-shadow: inset 0 0 0 1px var(--line); }
.cs-cfoot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-top: .75rem; }

/* Estilo del certificado: miniaturas, lista por curso y catálogo */
.modal-xl { max-width: 1180px; }
.cst-thumb { position: relative; width: 38px; height: 58px; border-radius: 8px; overflow: hidden; flex: none; display: block; box-shadow: 0 2px 6px rgba(15,31,51,.18); }
.cst-thumb .cp-bg { position: absolute; inset: 0; }
.cst-thumb i { position: absolute; left: 7px; right: 7px; top: 24px; height: 9px; border-radius: 2px; background: #fff !important; opacity: .95; }
.cst-general { display: flex; align-items: center; gap: .9rem; margin-top: 1rem; padding: .85rem 1rem; border-radius: 14px; background: var(--bg); flex-wrap: wrap; }
.cst-general .grow, .cst-row .grow { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: .1rem; }
.cst-color { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--ink-3); }
.cst-color i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.cst-list { margin-top: 1rem; }
.cst-listhead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .4rem; }
.cst-row { display: flex; align-items: center; gap: .85rem; padding: .55rem 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.cst-row small { color: var(--ink-3); font-size: .8rem; }
.cst-miss { color: #b45309; font-weight: 700; }
.cst-dot { width: 18px; height: 18px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--line); }
.cst-modal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1.5rem; align-items: start; }
.cst-catalog h4 { margin: 1rem 0 .5rem; font-size: .9rem; }
.cst-catalog h4:first-of-type { margin-top: .25rem; }
.cst-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.cst-opt { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .45rem .3rem; border: 0; border-radius: 12px; background: none; cursor: pointer; font: inherit; color: var(--ink-2); font-size: .72rem; line-height: 1.2; text-align: center; box-shadow: inset 0 0 0 1px transparent; }
.cst-opt:hover { background: var(--bg); }
.cst-opt.on { box-shadow: inset 0 0 0 2px var(--brand); background: var(--brand-50); color: var(--brand); font-weight: 700; }
.cst-opt:disabled { opacity: .45; cursor: not-allowed; }
.cst-opt .cst-thumb { width: 44px; height: 66px; }
.cst-check { display: flex; align-items: center; gap: .5rem; font-size: .88rem; font-weight: 600; min-height: 40px; cursor: pointer; }
.cst-check input { width: 18px; height: 18px; accent-color: var(--brand); }
.cs-sw:disabled, .cs-custom input:disabled { opacity: .45; cursor: not-allowed; }
.cst-side { position: sticky; top: 0; }
.cst-prevhead { display: flex; flex-direction: column; margin-bottom: .5rem; }
.cst-preview { width: 100%; aspect-ratio: 1123 / 794; border-radius: 10px; overflow: hidden; box-shadow: 0 10px 30px rgba(15,31,51,.18); background: #fff; }
@media (max-width: 900px) { .cst-modal { grid-template-columns: 1fr; } .cst-side { position: static; order: -1; } .cst-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Vista previa del certificado moderno (A4 horizontal a escala) */
.cp-scale { width: 1123px; height: 794px; transform: scale(var(--k, .5)); transform-origin: 0 0; }
.cp-page { width: 1123px; height: 794px; display: grid; grid-template-columns: 325px 1fr; background: #fff; color: #0f172a; font-family: 'Plus Jakarta Sans', sans-serif; }
.cp-side { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 0 45px; }
.cp-bg { position: absolute; inset: 0; }
.cp-bg svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cp-stripe { position: absolute; top: 0; right: 0; bottom: 0; width: 6px; display: flex; flex-direction: column; z-index: 1; }
.cp-stripe i { flex: 1; } .cp-stripe i:nth-child(1) { background: #0078c0; } .cp-stripe i:nth-child(2) { background: #78c030; } .cp-stripe i:nth-child(3) { background: #f39018; } .cp-stripe i:nth-child(4) { background: #f06018; } .cp-stripe i:nth-child(5) { background: #7a3030; }
.cp-verify { position: relative; }
.cp-vt { font-size: 23px; font-weight: 800; line-height: 1.08; margin-bottom: 22px; }
.cp-qr { width: 113px; height: 113px; background: #fff; border-radius: 13px; padding: 8px; box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.cp-qr svg { width: 100%; height: 100%; display: block; }
.cp-vl { margin-top: 16px; font-size: 9px; font-weight: 800; letter-spacing: .26em; text-transform: uppercase; }
.cp-code { font-family: 'JetBrains Mono', Consolas, monospace; font-weight: 700; font-size: 15px; margin-top: 3px; }
.cp-hint { margin-top: 10px; font-size: 9.5px; opacity: .85; }
.cp-main { position: relative; padding: 49px 68px 98px; display: flex; flex-direction: column; }
.cp-logo { height: 79px; width: auto; align-self: flex-start; }
.cp-body { margin-top: 60px; }
.cp-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .4em; text-transform: uppercase; color: #f06018; }
.cp-name { margin-top: 23px; font-family: 'Allura', cursive; font-size: 68px; line-height: .98; color: #184860; }
.cp-for { margin-top: 26px; font-size: 14px; color: #64748b; }
.cp-course { margin-top: 6px; font-family: 'Montserrat', 'Plus Jakarta Sans', sans-serif; font-size: 28px; font-weight: 700; line-height: 1.18; }
.cp-facts { display: flex; margin-top: 38px; }
.cp-facts div { padding: 0 26px; border-left: 1px solid #e2e8f0; }
.cp-facts div:first-child { padding-left: 0; border-left: 0; }
.cp-facts small { display: block; font-size: 9px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: #64748b; }
.cp-facts b { display: block; margin-top: 4px; font-size: 15px; font-weight: 700; }
.cp-miss { color: #b45309; }
.cp-sign { margin-top: auto; width: 280px; }
.cp-sigimg { height: 52px; display: flex; align-items: flex-end; }
.cp-sigimg img { max-height: 52px; max-width: 100%; object-fit: contain; }
.cp-line { height: 1px; background: #0f172a; opacity: .7; margin: 5px 0 6px; }
.cp-sign b { display: block; font-size: 13px; }
.cp-sign small { font-size: 10.5px; color: #64748b; }
