/* =====================================================================
   CENDAE – Panel administrador, campus virtual y pantallas de acceso
   (usa las variables y componentes de styles.css)
   ===================================================================== */

/* ---------- Pantallas de acceso ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth__side { background: linear-gradient(135deg, var(--blue-900), var(--blue-800) 60%, var(--blue-700)); color: #c6d3ea; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth--admin .auth__side { background: linear-gradient(135deg, #050f24, var(--blue-900) 50%, var(--red-700) 160%); }
.auth__side::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 40px 40px; mask-image: radial-gradient(circle at 30% 60%, #000, transparent 70%); pointer-events: none; }
.auth__side > * { position: relative; z-index: 1; }
.auth__side h1 { color: #fff; font-size: clamp(1.8rem, 3vw, 2.6rem); max-width: 460px; }
.auth__side img { height: 56px; width: auto; }
.auth__feats li { display: flex; gap: .7rem; align-items: center; margin-bottom: .7rem; color: #dfe7f5; }
.auth__feats i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.1); color: #ff8a96; }
.auth__main { display: grid; place-items: center; padding: 2rem 1.2rem; background: var(--blue-50); }
.auth__card { width: min(440px, 100%); background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 2.4rem; border-top: 6px solid var(--red-600); }
.auth--campus .auth__card { border-top-color: var(--blue-800); }
.auth__card h2 { font-size: 1.5rem; margin-bottom: .3rem; }
.auth__icon { width: 60px; height: 60px; border-radius: 16px; background: var(--blue-50); color: var(--blue-800); display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 1.2rem; }
.auth--admin .auth__icon { background: var(--red-100); color: var(--red-600); }
.auth__help { font-size: .85rem; text-align: center; margin: 1.2rem 0 0; }
.auth__back { display: inline-flex; gap: .4rem; align-items: center; margin-top: 1rem; font-size: .9rem; font-weight: 600; }
.pass { position: relative; }
.pass input { padding-right: 2.8rem; }
.pass__toggle { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); width: 36px; height: 36px; border-radius: 8px; }
.pass__toggle:hover { color: var(--blue-800); background: var(--blue-50); }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth__side { display: none; } }

/* ---------- Layout panel ---------- */
body.adm { background: #f2f5fa; display: block; }
.adm-side {
    position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 50;
    background: var(--blue-900); color: #9fb0d0; display: flex; flex-direction: column; padding: 1.4rem 1rem;
}
.adm--campus .adm-side { background: linear-gradient(180deg, var(--blue-800), var(--blue-900)); }
.adm-side__logo img { height: 48px; width: auto; margin: 0 .4rem 1.6rem; }
.adm-side__label { font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; color: #ff8a96; padding: 0 .8rem .7rem; }
.adm-nav { display: grid; gap: .2rem; }
.adm-nav a { display: flex; align-items: center; gap: .8rem; padding: .7rem .8rem; border-radius: 10px; color: #c6d3ea; font-weight: 600; font-size: .92rem; transition: .2s; }
.adm-nav a i { width: 18px; text-align: center; color: #7f93b8; }
.adm-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.adm-nav a.is-active { background: var(--red-600); color: #fff; box-shadow: 0 8px 18px rgba(214,40,57,.3); }
.adm-nav a.is-active i { color: #fff; }
.adm-count { margin-left: auto; background: var(--red-600); color: #fff; font-size: .7rem; padding: .1rem .5rem; border-radius: 999px; }
.adm-nav a.is-active .adm-count { background: #fff; color: var(--red-600); }
.adm-side__foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding-top: 1rem; }
.adm-side__foot a { color: #9fb0d0; font-size: .88rem; display: flex; gap: .6rem; align-items: center; padding: .5rem .8rem; }
.adm-side__foot a:hover { color: #fff; }

.adm-main { margin-left: 250px; min-height: 100vh; }
.adm-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 1rem; padding: .9rem 2rem; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.adm-top h1 { font-size: 1.35rem; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-top__actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.adm-burger { display: none; border: 0; background: var(--blue-50); color: var(--blue-800); width: 40px; height: 40px; border-radius: 10px; }
.adm-user { position: relative; }
.adm-user > .avatar { cursor: pointer; }
.adm-user__menu { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); padding: .8rem; min-width: 230px; display: none; }
.adm-user:hover .adm-user__menu, .adm-user:focus-within .adm-user__menu { display: block; }
.adm-user__menu::before { content: ''; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.adm-user__menu strong { display: block; color: var(--ink); }
.adm-user__menu small { display: block; color: var(--muted); margin-bottom: .6rem; word-break: break-all; }
.adm-user__menu a { display: flex; gap: .6rem; align-items: center; padding: .5rem; border-radius: 8px; color: var(--ink); font-size: .9rem; }
.adm-user__menu a:hover { background: var(--blue-50); }
.avatar--sm { width: 38px; height: 38px; font-size: .85rem; object-fit: cover; }
.adm-content { padding: 1.8rem 2rem 3rem; max-width: 1400px; }
.adm-overlay { display: none; }

/* ---------- Components ---------- */
.adm-hello { font-size: 1.05rem; margin-bottom: 1.4rem; }
.adm-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.4rem; box-shadow: var(--shadow-sm); }
.adm-card--flush { padding: 0; overflow-x: auto; }
.adm-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.adm-card__head h2 { font-size: 1.1rem; margin: 0; }
.adm-card__head a { font-size: .85rem; font-weight: 600; }
.adm-card__title { font-size: 1.02rem; margin: 0 0 1.1rem; display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.adm-card__title > i { color: var(--red-600); }
.adm-card__title small { font-weight: 500; font-family: var(--font-body); font-size: .78rem; color: var(--muted); }
.adm-card__title--pad { padding: 1.3rem 1.5rem 0; }
.adm-card.narrow { max-width: 720px; }
.adm-card .field textarea, .adm-card .field input, .adm-card .field select { font-size: .92rem; }
.empty { color: var(--muted); text-align: center; padding: 1.5rem; margin: 0; }

.adm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.adm-stat { display: flex; gap: 1rem; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; color: var(--text); transition: .2s; }
.adm-stat:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: var(--text); }
.adm-stat > i { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-800); font-size: 1.25rem; flex-shrink: 0; }
.adm-stat--red > i { background: var(--red-100); color: var(--red-600); }
.adm-stat strong { display: block; font-family: var(--font-head); font-size: 1.7rem; font-weight: 900; color: var(--ink); line-height: 1.1; }
.adm-stat span { font-size: .82rem; color: var(--muted); }

.adm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: start; }
.adm-grid-2--wide { grid-template-columns: 1.6fr 1fr; }

.adm-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.adm-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: .9rem 1rem; background: #f8fafd; border-bottom: 1px solid var(--line); white-space: nowrap; }
.adm-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.adm-table tr:last-child td { border-bottom: 0; }
.adm-table tbody tr:hover { background: #fafcff; }
.adm-table tr.is-muted td { opacity: .55; }
.adm-card:not(.adm-card--flush) .adm-table th:first-child, .adm-card:not(.adm-card--flush) .adm-table td:first-child { padding-left: 0; }
.t-title { font-weight: 700; color: var(--ink); display: block; }
.t-title:hover { color: var(--blue-700); }
.t-sub { display: block; color: var(--muted); font-size: .8rem; }
.t-right { text-align: right !important; }
.t-actions { text-align: right; white-space: nowrap; }
.t-actions > * { display: inline-flex; vertical-align: middle; margin-left: .2rem; }
.t-thumb { width: 72px; }
.t-thumb img, .thumb-ph { width: 64px; height: 42px; border-radius: 8px; object-fit: cover; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--blue-800), var(--blue-600)); }
.thumb-ph--sm { width: 34px; height: 34px; display: inline-grid; vertical-align: middle; margin-right: .5rem; font-size: .85rem; }
.t-user { display: flex; align-items: center; gap: .8rem; }
.inline-form { display: inline; margin: 0; }

.btn-icon { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--blue-800); display: inline-grid; place-items: center; font-size: .85rem; cursor: pointer; transition: .2s; }
.btn-icon:hover { background: var(--blue-800); border-color: var(--blue-800); color: #fff; }
.btn-icon--danger { color: var(--red-600); }
.btn-icon--danger:hover { background: var(--red-600); border-color: var(--red-600); }
.btn-icon--wa { color: #1da851; }
.btn-icon--wa:hover { background: var(--wa); border-color: var(--wa); }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .65rem; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.badge--green { background: #e3f6ec; color: #16794a; }
.badge--red   { background: var(--red-100); color: var(--red-700); }
.badge--blue  { background: var(--blue-100); color: var(--blue-800); }
.badge--amber { background: #fff3d6; color: #9a6400; }
.badge--gray  { background: #eef0f4; color: #5b6478; }

.adm-filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1.2rem; }
.adm-filters .search { flex: 1; min-width: 220px; max-width: 380px; }
.adm-filters select, .adm-inline select, .adm-inline input { padding: .62rem .8rem; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; font-size: .88rem; background: #fff; color: var(--ink); max-width: 100%; }
.adm-filters__info { margin-left: auto; font-size: .88rem; color: var(--muted); }
.select-sm { padding: .35rem .5rem; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; font-size: .82rem; background: #fff; }
.select-nuevo { border-color: var(--red-600); color: var(--red-700); font-weight: 700; }
.adm-inline { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; }
.adm-inline select { flex: 1; min-width: 200px; }
.adm-inline input[type=number] { width: 130px; }
.adm-collapse summary { cursor: pointer; font-weight: 700; font-family: var(--font-head); color: var(--blue-800); list-style: none; display: flex; gap: .5rem; align-items: center; }
.adm-collapse summary::-webkit-details-marker { display: none; }

.adm-tabs { display: flex; gap: .3rem; border-bottom: 2px solid var(--line); margin-bottom: 1.2rem; overflow-x: auto; }
.adm-tabs a { padding: .7rem 1rem; font-weight: 700; font-size: .9rem; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.adm-tabs a b { background: var(--blue-50); color: var(--blue-800); font-size: .72rem; padding: .1rem .5rem; border-radius: 999px; margin-left: .3rem; }
.adm-tabs a.is-active { color: var(--blue-800); border-bottom-color: var(--red-600); }

.adm-pager { display: flex; gap: .3rem; justify-content: center; margin: 1rem 0; flex-wrap: wrap; }
.adm-pager a { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: #fff; border: 1px solid var(--line); font-weight: 700; font-size: .85rem; }
.adm-pager a.is-active { background: var(--blue-800); color: #fff; border-color: var(--blue-800); }

.adm-list li { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.adm-list li:last-child { border-bottom: 0; }
.adm-list li > div { flex: 1; min-width: 0; }
.adm-list strong { display: block; color: var(--ink); font-size: .92rem; }
.adm-list small { color: var(--muted); font-size: .8rem; }
.adm-list--simple li { justify-content: space-between; }

.adm-dl { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; font-size: .9rem; margin: 0 0 1rem; }
.adm-dl dt { color: var(--muted); font-weight: 600; }
.adm-dl dd { margin: 0; color: var(--ink); word-break: break-word; }
.pre { background: var(--blue-50); padding: 1rem; border-radius: 10px; }

/* ---------- Forms ---------- */
.adm-form { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.4rem; align-items: start; }
.adm-form__side { position: sticky; top: 90px; }
.adm-form__side .adm-card .btn--block + .btn--block { margin-top: .5rem; }
.input-prefix { display: flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.input-prefix span { background: var(--blue-50); color: var(--muted); padding: .78rem .8rem; font-size: .85rem; white-space: nowrap; }
.input-prefix input { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; min-width: 0; }
.switch { display: flex; align-items: center; gap: .7rem; margin-bottom: .9rem; cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--ink); }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 42px; height: 24px; border-radius: 999px; background: #cfd6e3; position: relative; transition: .2s; flex-shrink: 0; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: #22a35a; }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--red-600); outline-offset: 2px; }

.img-drop { position: relative; border: 2px dashed var(--line); border-radius: 12px; aspect-ratio: 16/9; overflow: hidden; display: grid; place-items: center; background: var(--blue-50); transition: .2s; margin-bottom: .7rem; }
.img-drop:hover, .img-drop.is-over { border-color: var(--blue-600); }
.img-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.img-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.img-drop__ph { text-align: center; color: var(--muted); font-size: .85rem; padding: 1rem; }
.img-drop__ph i { font-size: 2rem; color: var(--blue-600); display: block; margin-bottom: .4rem; }
.img-drop--round { width: 140px; aspect-ratio: 1; border-radius: 50%; margin: 0 auto .7rem; }
.icon-preview { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--blue-800); color: #fff; margin-top: .5rem; font-size: 1.1rem; }

.modules { display: grid; gap: .8rem; margin-bottom: 1rem; }
.module { border: 1px solid var(--line); border-radius: 12px; padding: .9rem; background: #fafcff; }
.module__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.module__num { font-family: var(--font-head); font-weight: 800; font-size: .8rem; color: #fff; background: var(--red-600); padding: .2rem .65rem; border-radius: 6px; }
.module__btns { display: flex; gap: .3rem; }
.module__btns .btn-icon { width: 30px; height: 30px; font-size: .75rem; }
.module input, .module textarea { width: 100%; padding: .65rem .8rem; border: 1.5px solid var(--line); border-radius: 9px; font: inherit; font-size: .9rem; background: #fff; }
.module__title { font-weight: 700; margin-bottom: .5rem; }
.module input:focus, .module textarea:focus { outline: none; border-color: var(--blue-600); }

/* ---------- Campus ---------- */
.cp-welcome { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: linear-gradient(120deg, var(--blue-800), var(--blue-600)); color: #dfe7f5; border-radius: var(--radius-lg); padding: 1.8rem 2rem; margin-bottom: 1.6rem; }
.cp-welcome h2 { color: #fff; margin: 0 0 .2rem; font-size: 1.5rem; }
.cp-welcome p { margin: 0; }
.cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.3rem; }
.cp-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.cp-card__media { height: 140px; display: grid; place-items: center; color: #fff; font-size: 2.6rem; background: linear-gradient(135deg, var(--blue-800), var(--blue-600)); position: relative; }
.cp-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cp-card__body { padding: 1.2rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.cp-card__body h3 { font-size: 1.02rem; margin: 0; }
.cp-card__body .btn { margin-top: auto; }
.cp-card__body p { margin: 0; }
.cp-course-hero { border-radius: var(--radius-lg); padding: 2rem; color: #dfe7f5; margin-bottom: 1.4rem; background: linear-gradient(135deg, var(--blue-800), var(--blue-600)); position: relative; overflow: hidden; }
.cp-course-hero[style] { background: linear-gradient(90deg, rgba(7,29,64,.95), rgba(7,29,64,.6)), var(--hero-img) center/cover; }
.cp-course-hero h2 { color: #fff; margin: .6rem 0 .3rem; }
.cp-course-hero p { margin: 0; }
.notice-soon { background: #fff6e0; color: #8a5a00; padding: .8rem 1rem; border-radius: 10px; font-size: .88rem; margin-bottom: 1rem; display: flex; gap: .6rem; align-items: center; }
.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-state > i { font-size: 3rem; color: var(--blue-600); margin-bottom: 1rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .adm-form { grid-template-columns: 1fr; }
    .adm-form__side { position: static; }
    .adm-grid-2, .adm-grid-2--wide { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .adm-side { transform: translateX(-100%); transition: transform .3s; }
    body.side-open .adm-side { transform: none; }
    body.side-open .adm-overlay { display: block; position: fixed; inset: 0; background: rgba(7,29,64,.5); z-index: 45; }
    .adm-main { margin-left: 0; }
    .adm-burger { display: grid; place-items: center; }
    .adm-top { padding: .8rem 1rem; flex-wrap: wrap; }
    .adm-top h1 { font-size: 1.1rem; }
    .adm-top__actions { order: 5; width: 100%; }
    .adm-content { padding: 1.2rem 1rem 3rem; }
    .adm-filters__info { margin-left: 0; width: 100%; }
}
