/* Aula Virtual INUA — estilos */
:root {
  /* Colores de marca INUA (tomados de inuamakeup.com) */
  --brand-plum: #2A203A;     /* ciruela oscuro: textos y fondos oscuros */
  --brand-magenta: #C65393;  /* botones principales */
  --brand-purple: #745A9A;   /* acentos secundarios */
  --brand-mauve: #8E4F8E;
  --brand-pink: #EDA5EF;

  --bg: #ffffff;
  --surface: #ffffff;
  --soft: #faf7fb;
  --ink: var(--brand-plum);
  --muted: #7b7287;
  --line: #ece7f0;
  --accent: var(--brand-magenta);
  --accent-dark: #a8417a;
  --accent-soft: #fbeef5;
  --gold: var(--brand-purple);
  --ok: #2f8a63;
  --ok-soft: #e6f4ed;
  --warn: #8a5a12;
  --warn-soft: #fbf1df;
  --danger: #c0392b;
  --danger-soft: #fbe8e6;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(42, 32, 58, 0.04), 0 8px 28px rgba(42, 32, 58, 0.06);
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Montserrat", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; margin: 0 0 .4em; letter-spacing: -0.015em; }
h1 { font-weight: 800; }
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.15rem; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 14px; }

/* Botones */
.btn { appearance: none; border: 1px solid transparent; border-radius: 999px; padding: 10px 20px; font: 600 .92rem var(--font); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--surface); border-color: #d8cfe0; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #f6d6d3; }
.btn-sm { padding: 6px 14px; font-size: .82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.link-btn { background: none; border: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; }

/* Formularios */
label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.hint { font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date], input[type=datetime-local], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 90px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; margin: 0; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Tarjetas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }

/* Barra superior */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.brand { font-family: var(--serif); font-size: 1.35rem; font-weight: 800; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand img { height: 40px; width: auto; }
.auth-art .brand img { height: 64px; }
.brand small { font-family: var(--font); font-weight: 600; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--brand-purple); padding-left: 12px; border-left: 1px solid var(--line); }
.container { max-width: 1100px; margin: 0 auto; padding: 32px 20px 60px; }

/* Login */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: radial-gradient(circle at 85% 90%, rgba(198,83,147,.45), transparent 45%), radial-gradient(circle at 10% 10%, rgba(116,90,154,.35), transparent 40%), linear-gradient(160deg, #23222C 0%, #2A203A 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 1px solid rgba(255,255,255,.15); right: -160px; bottom: -160px; }
.auth-art::before { content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%; border: 1px solid rgba(237,165,239,.3); right: -40px; bottom: -40px; }
.auth-art h1 { font-size: 2.6rem; max-width: 460px; }
.auth-art h1 em { font-style: normal; color: var(--brand-pink); }
.auth-art .brand { color: #fff; }
.auth-art .brand small { color: var(--brand-pink); border-left-color: rgba(255,255,255,.2); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form form { width: 100%; max-width: 380px; }
.alert { padding: 12px 14px; border-radius: 10px; font-size: .9rem; margin-bottom: 16px; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-info { background: var(--accent-soft); color: var(--accent-dark); }

/* Dashboard alumna */
.greeting { margin-bottom: 28px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.course-card { overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.course-card:hover { transform: translateY(-3px); box-shadow: 0 12px 36px rgba(42,32,58,.12); }
.cover { aspect-ratio: 16/9; background: linear-gradient(135deg, #fbeef5 0%, #efe8f6 100%); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 2.4rem; font-weight: 800; color: var(--accent); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.course-card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 99px; transition: width .4s; }
.progress-label { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); }
.empty { text-align: center; padding: 60px 20px; }
.empty .icon { font-size: 2.6rem; margin-bottom: 8px; }

/* Página de curso */
.course-hero { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; margin-bottom: 30px; }
.course-hero .cover { border-radius: var(--radius); }
.module { margin-bottom: 16px; overflow: hidden; }
.module-head { padding: 16px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); background: var(--soft); }
.module-head h3 { margin: 0; font-size: 1.05rem; }
.module-head .tag { margin-left: auto; }
.lesson-row { display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.lesson-row:last-child { border-bottom: none; }
a.lesson-row:hover { background: var(--accent-soft); }
.lesson-row.locked { color: var(--muted); }
.dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #d8cfe0; flex-shrink: 0; display: grid; place-items: center; font-size: 13px; color: #fff; }
.dot.done { background: var(--ok); border-color: var(--ok); }
.dot.lock { border: none; color: var(--muted); font-size: 15px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-dark); white-space: nowrap; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-muted { background: #f1edf4; color: var(--muted); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }

/* Reproductor de clase */
.player { display: grid; grid-template-columns: 320px 1fr; min-height: calc(100vh - 61px); }
.side { background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; max-height: calc(100vh - 61px); position: sticky; top: 61px; }
.side-head { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.side-head a { text-decoration: none; font-size: .85rem; }
.side-mod { padding: 14px 20px 6px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.side-lesson { display: flex; gap: 10px; align-items: center; padding: 10px 20px; text-decoration: none; color: var(--ink); font-size: .9rem; border-left: 3px solid transparent; }
.side-lesson:hover { background: #fbf6fa; }
.side-lesson.active { background: var(--accent-soft); border-left-color: var(--accent); font-weight: 600; }
.side-lesson.locked { color: var(--muted); pointer-events: none; }
.side-lesson .dot { width: 20px; height: 20px; font-size: 11px; }
.stage { padding: 28px 36px 60px; max-width: 980px; width: 100%; }
.video { position: relative; aspect-ratio: 16/9; background: #111; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lesson-body { white-space: pre-wrap; word-wrap: break-word; }
.materials { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.material { display: flex; gap: 12px; align-items: center; padding: 14px 16px; text-decoration: none; color: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; font: inherit; text-align: left; width: 100%; }
.material:hover { border-color: var(--accent); background: #fffbfd; }
.material .ficon { width: 40px; height: 40px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); display: grid; place-items: center; font-weight: 800; font-size: .7rem; flex-shrink: 0; }
.lesson-nav { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.side-toggle { display: none !important; }
.celebrate { text-align: center; padding: 40px 20px; }
.celebrate .big { font-size: 3rem; }

/* Admin */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tab { background: none; border: none; padding: 12px 18px; font: 600 .95rem var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--soft); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fcf8fb; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input[type=search], .toolbar select { width: auto; min-width: 200px; }
.admin-course { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.admin-course:last-child { border-bottom: none; }
.admin-course .cover { width: 120px; flex-shrink: 0; font-size: 1.2rem; border-radius: 8px; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.mod-edit { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 16px; }
.mod-edit-head { display: grid; grid-template-columns: 1fr 230px auto; gap: 12px; padding: 16px; align-items: end; background: var(--soft); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.mod-edit-head .field { margin: 0; }
.les-edit { border-bottom: 1px solid var(--line); }
.les-edit:last-child { border-bottom: none; }
.les-summary { display: flex; gap: 10px; align-items: center; padding: 12px 16px; cursor: pointer; }
.les-summary:hover { background: #fcf8fb; }
.les-detail { padding: 4px 16px 18px 48px; }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 8px; width: 32px; height: 32px; cursor: pointer; color: var(--muted); font-size: 15px; display: inline-grid; place-items: center; flex-shrink: 0; }
.icon-btn:hover { background: #f3eef5; color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.att-row { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.att-row input { padding: 6px 10px; }
.sticky-save { position: sticky; bottom: 0; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 14px 0; margin-top: 20px; z-index: 5; }
.preview-video { max-width: 360px; margin-top: 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { padding: 18px; }
.stat b { display: block; font-size: 1.7rem; font-family: var(--serif); }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(42,32,58,.5); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 640px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 900px; }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-head h2 { margin: 0; font-size: 1.3rem; }
.modal-body { padding: 22px 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 99px; font-size: .9rem; opacity: 0; transition: all .25s; z-index: 200; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { padding: 32px 24px; min-height: 220px; }
  .auth-art h1 { font-size: 1.9rem; }
  .course-hero { grid-template-columns: 1fr; }
  .course-hero .cover { order: -1; }
  .player { grid-template-columns: 1fr; }
  .side { position: fixed; top: 57px; left: 0; bottom: 0; width: 86%; max-width: 340px; max-height: none; z-index: 40; transform: translateX(-100%); visibility: hidden; transition: transform .25s, visibility .25s; }
  .side.open { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .side-toggle { display: inline-grid !important; font-size: 20px; color: var(--ink); }
  .topbar-inner { gap: 8px; }
  .topbar .brand small, .topbar .hide-m { display: none; }
  .topbar .btn-sm { padding: 6px 10px; }
  .lesson-nav .row { width: 100%; justify-content: flex-end; }
  .lesson-nav .btn { white-space: normal; }
  .stage { padding: 18px 16px 50px; }
  .editor-grid { grid-template-columns: 1fr; }
  .mod-edit-head { grid-template-columns: 1fr; }
  .les-detail { padding-left: 16px; }
  .admin-course .cover { width: 80px; }
  h1 { font-size: 1.6rem; }
  .container { padding: 22px 16px 50px; }
  .topbar-inner { padding: 12px 16px; }
  .lesson-nav .btn { flex: 1; }
}

/* ───────────── Refinamientos UI ───────────── */
.ico { width: 18px; height: 18px; flex-shrink: 0; display: inline-block; vertical-align: -0.2em; }
.btn .ico { width: 17px; height: 17px; }
.btn-sm .ico, .tag .ico, .small .ico { width: 14px; height: 14px; }
:focus-visible { outline: 2px solid var(--brand-purple); outline-offset: 2px; }
::selection { background: var(--accent-soft); }

h1 { font-size: 1.9rem; }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-purple); margin: 0 0 8px; }
.with-icon { display: flex; align-items: center; gap: 10px; }
.with-icon .ico { color: var(--accent); }

/* Barra superior */
.topbar { box-shadow: 0 1px 0 var(--line); border-bottom: none; }
.topnav { display: flex; gap: 4px; margin-right: 8px; }
.topnav a { padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: .88rem; color: var(--muted); text-decoration: none; }
.topnav a:hover { color: var(--ink); background: var(--soft); }
.topnav a.active { color: var(--ink); background: var(--soft); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-magenta), var(--brand-purple)); color: #fff; font-weight: 700; font-size: .8rem; display: grid; place-items: center; text-decoration: none; flex-shrink: 0; letter-spacing: .02em; }
.avatar.sm { width: 32px; height: 32px; font-size: .72rem; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; }
.icon-btn .ico { width: 18px; height: 18px; }
.icon-btn:disabled { opacity: .3; cursor: default; background: none; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--accent); }
.link-plain { background: none; border: none; cursor: pointer; padding: 0; font-family: inherit; }

/* Tarjetas de curso */
.card { box-shadow: 0 1px 2px rgba(42,32,58,.04); }
.course-card { box-shadow: 0 1px 2px rgba(42,32,58,.04); }
.course-card .body { gap: 12px; padding: 20px 22px 22px; }
.course-card h3 { font-size: 1.1rem; }
.card-cta { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .88rem; color: var(--accent); }
.card-cta .ico { width: 16px; height: 16px; transition: transform .15s; }
.course-card:hover .card-cta .ico { transform: translateX(3px); }
.progress { height: 6px; }
.greeting { margin-bottom: 32px; }

/* Estados vacíos */
.empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto 16px; }
.empty-icon .ico { width: 26px; height: 26px; }
.empty-icon.big { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-magenta), var(--brand-purple)); color: #fff; }
.empty-icon.big .ico { width: 34px; height: 34px; }
.empty h3 { margin-bottom: 6px; }

/* Módulos y clases */
.module { box-shadow: none; }
.module-head { background: var(--soft); border-bottom: 1px solid var(--line); }
.lesson-row { padding: 14px 20px; transition: background .12s; }
a.lesson-row:hover { background: #fcf8fb; }
.lesson-title { font-weight: 500; }
.lesson-meta { display: inline-flex; align-items: center; gap: 14px; color: var(--muted); font-size: .82rem; }
.lesson-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.lesson-meta .ico { width: 16px; height: 16px; }
.row-arrow { opacity: 0; transition: opacity .12s, transform .12s; }
a.lesson-row:hover .row-arrow { opacity: 1; transform: translateX(2px); color: var(--accent); }
.dot { width: 22px; height: 22px; border-width: 1.5px; }
.dot .ico { width: 13px; height: 13px; stroke-width: 3; }
.dot.lock { background: none; color: var(--muted); }
.dot.lock .ico { width: 16px; height: 16px; stroke-width: 2; }
.tag { gap: 5px; padding: 4px 10px; }

/* Reproductor */
.side { background: #fff; }
.side-head h3 { font-size: 1rem; }
.side-mod { gap: 6px; }
.side-mod .ico { width: 13px; height: 13px; }
.side-lesson { font-size: .88rem; padding: 10px 20px; }
.side-lesson .dot .ico { width: 11px; height: 11px; }
.side-lesson.locked .dot { border-style: dashed; }
.stage h1 { margin-bottom: 20px; }
.video { border-radius: 14px; box-shadow: 0 12px 40px rgba(42,32,58,.14); }
.lesson-body { color: #4a4157; line-height: 1.7; }
.material { gap: 14px; padding: 14px 16px; transition: border-color .15s, box-shadow .15s; }
.material:hover { border-color: #e2c3d6; background: #fff; box-shadow: 0 4px 16px rgba(42,32,58,.06); }
.material .ficon { background: var(--accent-soft); color: var(--accent); }
.material .ficon .ico { width: 20px; height: 20px; }
.mat-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.mat-text b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-go { color: var(--muted); width: 18px; height: 18px; }
.material:hover .mat-go { color: var(--accent); }
.alert { display: flex; gap: 10px; align-items: flex-start; }
.alert .ico { margin-top: 2px; }
.celebrate h2 { margin-top: 4px; }

/* Admin */
.tab { display: inline-flex; align-items: center; gap: 8px; }
.tab .ico { width: 17px; height: 17px; }
.ficon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.ficon.sm { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.ficon.sm .ico { width: 15px; height: 15px; }
.person { display: flex; align-items: center; gap: 12px; }
.add-module { width: 100%; border-style: dashed; padding: 14px; border-radius: var(--radius); color: var(--muted); }
.add-module:hover { color: var(--accent); border-color: var(--accent); }
.les-summary .tag .ico { width: 13px; height: 13px; }
.stat b { font-weight: 800; font-size: 1.8rem; }
.toast { border-radius: 12px; font-weight: 500; }

@media (max-width: 900px) {
  .topnav { display: none; }
  .lesson-meta { gap: 10px; }
  .row-arrow { display: none; }
  .hero-cover.no-img { display: none; }
  .course-hero { gap: 18px; }
  h1 { font-size: 1.55rem; }
}

/* ───────────── Material de apoyo y visor ───────────── */
.materials { display: flex; flex-direction: column; gap: 12px; }
.mat { border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.mat.open { border-color: #e6d3e0; box-shadow: 0 8px 28px rgba(42,32,58,.07); }
.mat-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 16px; }
.mat .ficon { background: var(--accent-soft); color: var(--accent); }
.mat .ficon .ico { width: 20px; height: 20px; }
.mat-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.mat-actions a.icon-btn { color: var(--muted); }
.viewer { border-top: 1px solid var(--line); background: var(--soft); }
.viewer-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.viewer-title { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-body { height: min(78vh, 900px); overflow: auto; position: relative; }
.viewer-body .spinner { margin: 80px auto; }
.viewer-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.viewer-img { max-width: 100%; margin: 0 auto; display: block; padding: 12px; }
.viewer-msg { padding: 40px 20px; text-align: center; color: var(--muted); }
.pdf-pages { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 12px; padding: 12px; }
.pdf-page { flex-shrink: 0; width: 100%; max-width: 900px; background: #fff; box-shadow: 0 1px 3px rgba(42,32,58,.12); border-radius: 4px; overflow: hidden; }
.pdf-page canvas { width: 100%; height: auto; display: block; }
.viewer.fs { position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column; border: 0; }
.viewer.fs .viewer-body { height: auto; flex: 1; }
body.no-scroll { overflow: hidden; }
@media (max-width: 900px) {
  .mat-row { padding: 10px 10px 10px 12px; gap: 10px; }
  .mat-actions .btn span { display: none; }
  .mat-actions .btn { padding: 8px 10px; }
  .viewer-body { height: 70vh; }
  .pdf-pages { padding: 8px; gap: 8px; }
}

/* ───────────── Semanas (editor) ───────────── */
.cal-card { margin-bottom: 26px; }
.cal-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; }
.cal-pill { flex: 0 0 auto; min-width: 178px; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); background: #fff; scroll-snap-align: start; transition: border-color .15s, box-shadow .15s, transform .15s; }
.cal-pill:hover { border-color: #dcc7e6; box-shadow: 0 6px 18px rgba(42,32,58,.07); transform: translateY(-1px); }
.cal-pill-top { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.cal-pill-date { font-size: .82rem; font-weight: 600; color: var(--brand-purple); text-transform: capitalize; }
.cal-pill-meta { display: flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--muted); }
.cal-pill.st-open { border-left: 3px solid var(--ok); }
.cal-pill.st-scheduled { border-left: 3px solid var(--brand-purple); }
.cal-auto { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.cal-auto summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--accent); display: inline-flex; align-items: center; gap: 8px; list-style: none; }
.cal-auto summary::-webkit-details-marker { display: none; }
.cal-auto summary .ico { width: 16px; height: 16px; }

.st-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; flex-shrink: 0; }
.st-open .st-dot { background: var(--ok); }
.st-scheduled .st-dot { background: var(--brand-purple); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.status-pill.st-open { background: var(--ok-soft); color: var(--ok); }
.status-pill.st-scheduled { background: #f0ebf7; color: var(--brand-purple); }

.week { border: 1px solid var(--line); border-radius: 18px; background: #fff; margin-bottom: 20px; scroll-margin-top: 80px; overflow: hidden; }
.week-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.week-num { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, var(--brand-magenta), var(--brand-purple)); color: #fff; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; font-size: .95rem; }
.week-num.sm { width: 22px; height: 22px; border-radius: 7px; font-size: .7rem; }
.week-num.free { background: var(--soft); color: var(--muted); border: 1px solid var(--line); }
.week-num.free .ico { width: 18px; height: 18px; }
.week-titles { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.week-head .week-title { border: 1px solid transparent !important; padding: 4px 8px !important; margin-left: -8px; font-weight: 800; font-size: 1.1rem; background: transparent !important; border-radius: 8px !important; }
.week-head .week-title:hover { border-color: var(--line) !important; }
.week-head .week-title:focus { border-color: var(--accent) !important; background: #fff !important; }
.week-titles .small { padding-left: 0; }
.week-date { display: flex; flex-direction: column; gap: 2px; }
.week-date label { margin: 0; font-weight: 600; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.week-date input { padding: 8px 10px; width: auto; }
.week-actions { gap: 2px; }
.week-body { padding: 14px; background: var(--soft); display: flex; flex-direction: column; gap: 12px; }
.week-body .mod-edit { margin: 0; }
.week-empty { padding: 18px; text-align: center; background: var(--soft); }
.week-foot { padding: 10px 14px; border-top: 1px solid var(--line); background: #fff; }
.week-free { border-style: dashed; }
.week-free .week-titles b { font-size: 1rem; }
.mod-edit { border-radius: 14px; }
.mod-edit-head { grid-template-columns: 1fr 200px auto; border-radius: 14px 14px 0 0; background: #fff; }
.mod-actions { gap: 2px; padding-bottom: 2px; align-self: end; }
.mod-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); }
.mod-edit .les-edit:first-of-type { border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  .week-head { gap: 10px; padding: 14px; }
  .week-date { width: 100%; }
  .week-date input { width: 100%; }
  .mod-edit-head { grid-template-columns: 1fr; }
  .week-body { padding: 10px; }
}

/* ───────────── Semanas (vista de alumna) ───────────── */
.wk { margin-bottom: 30px; }
.wk-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.wk-head h3 { margin: 0; font-size: 1.15rem; }
.wk-titles { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.wk-head.is-locked h3 { color: var(--muted); }
.week-num.locked { background: #f1edf4; color: var(--muted); }
.week-num.locked .ico { width: 17px; height: 17px; }
.wk .module { margin-bottom: 12px; }
.wk.is-locked .module, .wk-head.is-locked ~ .module { opacity: .85; }

.side-week { display: flex; align-items: center; gap: 8px; padding: 18px 20px 6px; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); border-top: 1px solid var(--line); }
.side-week:first-of-type { border-top: none; }
.side-week.is-locked { color: var(--muted); }
.side-week .ico { width: 14px; height: 14px; }
.side-week-date { margin-left: auto; font-weight: 600; letter-spacing: 0; text-transform: none; font-size: .74rem; color: var(--muted); }
.side-mod { padding: 8px 20px 4px; font-size: .8rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); }
@media (max-width: 900px) {
  .sticky-save .row { flex-wrap: nowrap; gap: 8px; }
  .sticky-save .btn-lg { padding: 12px 18px; font-size: .92rem; }
  .sticky-save #saveState { font-size: .75rem; }
  .sticky-save #delCourse { padding: 6px 10px; font-size: .75rem; }
}

/* Interruptor Publicado / Borrador */
.pub-switch { display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 8px 14px 8px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: .85rem; cursor: pointer; user-select: none; }
.pub-switch.on { background: var(--ok-soft); color: var(--ok); }
.pub-switch input { position: absolute; opacity: 0; pointer-events: none; }
.pub-switch .switch { width: 38px; height: 22px; border-radius: 999px; background: #d9cfc0; position: relative; flex-shrink: 0; transition: background .15s; }
.pub-switch .switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.pub-switch.on .switch { background: var(--ok); }
.pub-switch.on .switch::after { transform: translateX(16px); }
.pub-switch:has(input:focus-visible) { outline: 2px solid var(--brand-purple); outline-offset: 2px; }
@media (max-width: 900px) {
  .sticky-save .row { flex-wrap: wrap; }
  .pub-switch { width: 100%; justify-content: flex-start; }
}
@media (max-width: 900px) {
  .sticky-save #saveState { display: none; }
  .sticky-save .row { row-gap: 8px; }
  .sticky-save .pub-switch { padding: 6px 12px 6px 8px; }
}

/* Vista previa */
.preview-bar { position: sticky; top: 0; z-index: 35; display: flex; align-items: center; gap: 10px; padding: 9px 20px; background: var(--brand-plum); color: #fff; font-size: .85rem; }
.preview-bar .ico { width: 17px; height: 17px; color: var(--brand-pink); }
.preview-bar .check { color: #fff; font-weight: 500; }
.preview-bar .check input { accent-color: var(--brand-pink); }
.preview-bar ~ .topbar { top: 38px; }
.preview-bar ~ .player .side { top: 99px; max-height: calc(100vh - 99px); }
@media (max-width: 900px) { .preview-bar ~ .player .side { top: 95px; } }
@media (max-width: 900px) { .sticky-save #previewBtn span { display: none; } .sticky-save #previewBtn { padding: 10px 12px; } }
.is-preview .back-link[href="#/"] { display: none; }
.preview-bar .check { white-space: nowrap; }
@media (max-width: 900px) {
  .preview-bar { padding: 8px 14px; height: 38px; }
  .preview-bar .hide-m { display: none; }
  .preview-bar .check span { font-size: .78rem; }
}

/* Clases: número, arrastrar y soltar */
.les-summary { cursor: default; gap: 6px; padding: 8px 10px 8px 6px; }
.les-summary:hover { background: transparent; }
.drag-handle { width: 26px; height: 32px; display: grid; place-items: center; color: #c3b8cc; cursor: grab; border-radius: 6px; flex-shrink: 0; }
.drag-handle:hover { color: var(--brand-purple); background: var(--soft); }
.drag-handle:active { cursor: grabbing; }
.drag-handle .ico { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.les-num { width: 24px; height: 24px; border-radius: 7px; background: var(--soft); border: 1px solid var(--line); color: var(--muted); font-size: .75rem; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.les-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: none; border: none; padding: 8px 6px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--ink); text-align: left; }
.les-open:hover { background: #fcf8fb; }
.les-open > .ico { width: 16px; height: 16px; color: var(--muted); }
.les-open b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reorder { display: inline-flex; gap: 0; padding: 0 4px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); margin: 0 2px; }
.reorder .icon-btn { width: 30px; height: 30px; }
.les-edit { position: relative; transition: background .3s; }
.les-edit.dragging { opacity: .4; }
.les-edit.drop-before::before, .les-edit.drop-after::after, .mod-foot.drop-before::before { content: ""; position: absolute; left: 10px; right: 10px; height: 3px; border-radius: 3px; background: var(--accent); z-index: 2; }
.les-edit.drop-before::before { top: -2px; }
.les-edit.drop-after::after { bottom: -2px; }
.mod-foot { position: relative; }
.mod-foot.drop-before::before { top: -2px; }
.les-edit.flash { background: var(--accent-soft); }
@media (max-width: 900px) {
  .drag-handle { display: none; }
  .les-open .tag { display: none; }
}

/* Contenido de la clase y clases ocultas */
.les-chips { display: inline-flex; gap: 6px; flex-shrink: 0; }
.les-chips .tag .ico, .tag-hidden .ico { width: 13px; height: 13px; }
.tag-hidden { background: #efeaf3; color: var(--brand-purple); }
.les-edit.is-hidden .les-open b, .les-edit.is-hidden .les-chips { opacity: .5; }
.les-edit.is-hidden .les-num { border-style: dashed; }
.icon-btn.is-on { color: var(--brand-purple); background: #f0ebf7; }
.lesson-meta em { font-style: normal; }
@media (max-width: 900px) {
  .les-chips { display: none; }
  .lesson-meta em { display: none; }
}

/* Arrastrar módulos */
.mod-edit-head { grid-template-columns: auto 1fr 200px auto; }
.mod-handle { align-self: end; margin-bottom: 8px; height: 30px; }
.mod-edit { position: relative; transition: background .3s, box-shadow .3s; }
.mod-edit.dragging { opacity: .4; }
.mod-edit.mod-drop-before::before, .mod-edit.mod-drop-after::after { content: ""; position: absolute; left: 0; right: 0; height: 4px; border-radius: 4px; background: var(--accent); z-index: 3; }
.mod-edit.mod-drop-before::before { top: -9px; }
.mod-edit.mod-drop-after::after { bottom: -9px; }
.mod-edit.flash { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 4px var(--accent); }
.dragging-module .les-edit { pointer-events: none; }
@media (max-width: 900px) {
  .mod-edit-head { grid-template-columns: 1fr; }
  .mod-handle { display: none; }
}

/* Portada del curso */
.cover-drop { position: relative; aspect-ratio: 16 / 9; border: 1.5px dashed #d8cde0; border-radius: 14px; background: var(--soft); display: grid; place-items: center; overflow: hidden; cursor: pointer; transition: border-color .15s, background .15s; }
.cover-drop:hover, .cover-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.cover-drop.has-img { border-style: solid; border-color: var(--line); }
.cover-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 16px; color: var(--muted); font-size: .8rem; }
.cover-empty .ico { width: 30px; height: 30px; color: var(--accent); }
.cover-empty b { color: var(--ink); font-size: .92rem; }
.cover-change { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: rgba(42,32,58,.78); color: #fff; font-size: .78rem; font-weight: 600; opacity: 0; transition: opacity .15s; }
.cover-change .ico { width: 14px; height: 14px; }
.cover-drop:hover .cover-change, .cover-drop:focus-visible .cover-change { opacity: 1; }
.cover-broken { display: none; }
.cover-drop.broken img { display: none; }
.cover-drop.broken .cover-broken { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); font-size: .82rem; font-weight: 600; }
.cover-drop.loading::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='18' fill='none' stroke='%23C65393' stroke-width='4' stroke-dasharray='80 40'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center / 40px no-repeat; }
.cover-actions { margin-top: 8px; gap: 12px; }
@media (hover: none) { .cover-change { opacity: 1; } }
