/* Amauta — estilos */
:root {
  --navy: #1b1650;
  --navy-2: #241e66;
  --orange: #f5a623;
  --orange-soft: #fff4dd;
  --purple: #5b3df5;
  --purple-dark: #4a2ee0;
  --purple-soft: #ece8ff;
  --bg: #f1f1f9;
  --card: #ffffff;
  --text: #1b1a33;
  --muted: #6b6888;
  --line: #e4e3f0;
  --chip: #f0eff7;
  --green: #22a06b;
  --green-soft: #e3f6ed;
  --red: #d64545;
  --red-soft: #fdeaea;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(27, 22, 80, 0.07);
  --shadow-hover: 0 16px 40px rgba(27, 22, 80, 0.13);
  --wrap: 1148px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; outline: none; }
a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Barra superior ---------- */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 40; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; flex: none; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a, .nav button.link {
  color: rgba(255, 255, 255, .78); font-weight: 600; font-size: 15px; padding: 8px 10px;
  border: 0; background: none; cursor: pointer; position: relative;
}
.nav a:hover, .nav button.link:hover { color: #fff; text-decoration: none; }
.nav a.active { color: #fff; }
.nav a.active::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: -12px; height: 2px; background: var(--orange); border-radius: 2px; }
.nav .btn-login { background: var(--orange); color: var(--navy); border-radius: 999px; padding: 7px 14px; margin-left: 6px; }
.nav .btn-login:hover { color: var(--navy); filter: brightness(1.05); }
.nav .btn-login.active::after { display: none; }
.menu-toggle { display: none; background: none; border: 0; color: #fff; padding: 8px; cursor: pointer; border-radius: 8px; }
.menu-toggle svg { width: 26px; height: 26px; display: block; }

@media (max-width: 760px) {
  .menu-toggle { display: block; }
  .nav {
    position: absolute; top: 64px; left: 0; right: 0; background: var(--navy);
    flex-direction: column; align-items: stretch; gap: 0; padding: 6px 12px 14px;
    border-top: 1px solid rgba(255,255,255,.08); display: none; box-shadow: 0 16px 30px rgba(0,0,0,.25);
  }
  .nav.open { display: flex; }
  .nav a, .nav button.link { padding: 12px 10px; text-align: left; font-size: 16px; }
  .nav a.active::after { left: 0; right: auto; top: 12px; bottom: 12px; width: 3px; height: auto; }
  .nav .btn-login { margin: 8px 0 0; text-align: center; }
}

/* ---------- Pie ---------- */
.footer { background: var(--navy); color: rgba(255,255,255,.7); font-size: 14px; margin-top: 56px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 28px; padding-bottom: 28px; }
.footer a { color: #fff; }

/* ---------- Botones y formularios ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 10px 20px; font-weight: 600; font-size: 15px; cursor: pointer;
  border: 1px solid transparent; background: var(--purple); color: #fff; white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .05s; text-decoration: none; line-height: 1.2;
}
.btn:hover { background: var(--purple-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.btn-light { background: #fff; color: var(--text); border-color: var(--line); }
.btn-light:hover { background: #f7f6fc; }
.btn-orange { background: var(--orange); color: var(--navy); }
.btn-orange:hover { background: #ffb43a; }
.btn-green { background: var(--green); }
.btn-green:hover { background: #1b8a5b; }
.btn-danger { background: #fff; color: var(--red); border-color: #f1c4c4; }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none;
}
.icon-btn:hover { background: #e9e7f5; color: var(--text); }
.icon-btn:disabled { opacity: .3; cursor: default; background: none; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.danger:hover { color: var(--red); background: var(--red-soft); }

label.field { display: block; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
label.field > span { display: block; margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  padding: 11px 13px; font-size: 15px; font-weight: 400; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(91, 61, 245, .15); }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.55; }
.hint { font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 6px; }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--purple); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.form-error { background: var(--red-soft); color: #9f2a2a; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px; }
.form-ok { background: var(--green-soft); color: #156b47; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap-row { flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }

/* ---------- Tarjetas genéricas ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card + .card { margin-top: 18px; }
.card h2 { font-size: 18px; }
.chip { display: inline-flex; align-items: center; background: var(--chip); color: #4c4a66; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.chip.free { background: var(--orange-soft); color: #9a6200; }
.chip.green { background: var(--green-soft); color: #156b47; }
.chip.red { background: var(--red-soft); color: #9f2a2a; }
.chip.purple { background: var(--purple-soft); color: var(--purple); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.page-loading { display: flex; justify-content: center; padding: 120px 0; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--purple); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h3 { color: var(--text); }

/* ---------- Hero / catálogo ---------- */
.hero { background: var(--navy); color: #fff; position: relative; padding: 56px 0 0; }
.hero-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(32px, 5vw, 50px); font-weight: 800; max-width: 600px; letter-spacing: -0.02em; }
.hero p.lead { color: rgba(255,255,255,.78); font-size: 18px; max-width: 560px; margin: 0 0 28px; }
.hero-sun { position: absolute; right: -60px; bottom: -110px; width: 420px; height: 420px; pointer-events: none; }
.hero-sun .core { position: absolute; inset: 90px; border-radius: 50%; background: var(--orange); }
.hero-sun .ring { position: absolute; border-radius: 50%; border: 3px solid rgba(245,166,35,.45); }
.hero-sun .ring.r1 { inset: 44px; }
.hero-sun .ring.r2 { inset: 0; border-color: rgba(245,166,35,.22); }
@media (max-width: 760px) {
  .hero { padding-top: 36px; }
  .hero-sun { width: 240px; height: 240px; right: -90px; top: -60px; bottom: auto; opacity: .55; }
  .hero-sun .core { inset: 50px; }
  .hero-sun .ring.r1 { inset: 24px; }
  .hero p.lead { font-size: 16px; }
}
.search { display: flex; background: #fff; border-radius: 999px; padding: 6px; max-width: 560px; box-shadow: 0 8px 28px rgba(0,0,0,.18); }
.search input { flex: 1; border: 0; outline: none; padding: 10px 16px; font-size: 16px; min-width: 0; background: none; color: var(--text); }
.search .btn { flex: none; }
.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 44px; transform: translateY(18px); }
.cat-chip {
  border: 0; background: #fff; color: var(--text); font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 999px;
  cursor: pointer; box-shadow: 0 4px 14px rgba(27,22,80,.1);
}
.cat-chip:hover { background: #faf9ff; }
.cat-chip.active { background: var(--orange); color: var(--navy); }
.catalog { padding-top: 54px; }
.catalog-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.catalog-head h2 { margin: 0; font-size: 22px; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.course-card {
  background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  color: var(--text); transition: transform .15s, box-shadow .15s;
}
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); text-decoration: none; }
.course-card .body { padding: 18px 18px 16px; display: flex; flex-direction: column; flex: 1; }
.course-card .cat { color: var(--purple); font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.course-card h3 { font-size: 17px; margin-bottom: 10px; font-weight: 700; }
.course-card .foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 16px; }
.course-card .price { font-weight: 800; font-size: 17px; }
.course-card .teacher { color: var(--muted); font-size: 14px; }

/* Portada generada */
.cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #2b5be0; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .initials { position: absolute; left: 6%; bottom: 8%; font-size: clamp(40px, 7vw, 64px); font-weight: 800; color: #fff; letter-spacing: -0.03em; line-height: 1; }
.cover .sun { position: absolute; right: 6%; top: 4%; width: 37%; aspect-ratio: 1; border-radius: 50%; background: rgba(245,166,35,.92); }
.cover .ring { position: absolute; right: -2%; top: -12%; width: 54%; aspect-ratio: 1; border-radius: 50%; border: 3px solid rgba(245,166,35,.35); }

/* ---------- Página de curso ---------- */
.course-hero { background: var(--navy); color: #fff; padding: 44px 0 64px; }
.course-hero .cat { color: var(--orange); font-weight: 700; font-size: 14px; }
.course-hero h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; margin: 6px 0 12px; }
.course-hero .sub { color: rgba(255,255,255,.8); font-size: 18px; max-width: 640px; }
.course-hero .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.course-hero .meta .chip { background: rgba(255,255,255,.1); color: #fff; }
.crumbs { font-size: 14px; color: rgba(255,255,255,.6); margin-bottom: 18px; }
.crumbs a { color: rgba(255,255,255,.85); }
.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.course-layout .main-col { padding-top: 28px; }
.buy-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-hover); overflow: hidden; margin-top: -260px; position: sticky; top: 84px; }
.buy-card .inner { padding: 22px; }
.buy-card .price { font-size: 30px; font-weight: 800; margin-bottom: 14px; }
.buy-card ul { list-style: none; padding: 0; margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.buy-card li { display: flex; gap: 10px; align-items: center; padding: 5px 0; }
.buy-card li svg { width: 18px; height: 18px; color: var(--purple); flex: none; }
.buy-card .note { font-size: 13px; color: var(--muted); margin-top: 12px; background: var(--bg); padding: 10px 12px; border-radius: var(--radius-sm); }
@media (max-width: 920px) {
  .course-layout { grid-template-columns: 1fr; }
  .buy-card { margin-top: -40px; position: static; order: -1; }
  .course-hero { padding-bottom: 64px; }
}
.prose { font-size: 16px; line-height: 1.7; }
.prose h2, .prose h3 { margin-top: 1.2em; font-size: 20px; }
.prose h4 { margin-top: 1em; font-size: 17px; }
.prose ul { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose p { margin: 0 0 .9em; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }

/* Temario */
.syllabus .mod { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.syllabus .mod > button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #fafaff; border: 0; cursor: pointer;
  font-weight: 700; font-size: 15px; text-align: left;
}
.syllabus .mod > button .count { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 13px; white-space: nowrap; }
.syllabus .mod > button svg { width: 18px; height: 18px; transition: transform .2s; flex: none; }
.syllabus .mod.open > button svg { transform: rotate(90deg); }
.syllabus .mod .lessons { display: none; }
.syllabus .mod.open .lessons { display: block; }
.syllabus .lesson-row { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 15px; color: var(--text); }
.syllabus .lesson-row svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.syllabus .lesson-row .t { flex: 1; min-width: 0; }
.syllabus .lesson-row .d { color: var(--muted); font-size: 13px; white-space: nowrap; }
.syllabus a.lesson-row:hover { background: #faf9ff; text-decoration: none; }

.mobile-cta { display: none; }
@media (max-width: 920px) {
  .mobile-cta {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(27,22,80,.12); align-items: center; gap: 12px; justify-content: space-between;
  }
  .mobile-cta .price { font-weight: 800; font-size: 20px; }
  body.has-mobile-cta .footer { padding-bottom: 76px; }
}

/* ---------- Reproductor ---------- */
.player-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; padding-top: 28px; align-items: start; }
@media (max-width: 920px) { .player-layout { grid-template-columns: 1fr; padding-top: 0; } .player-layout .video { margin: 0 -20px; } }
.video { background: var(--navy); border-radius: 22px; aspect-ratio: 16 / 9; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.75); text-align: center; padding: 0; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.video .placeholder { padding: 24px; font-size: 16px; }
.video.locked { flex-direction: column; gap: 14px; padding: 24px; }
.video.locked svg { width: 40px; height: 40px; color: var(--orange); }
@media (max-width: 920px) { .video { border-radius: 0; } }
.lesson-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 22px 0 18px; }
.lesson-head h1 { font-size: clamp(22px, 3vw, 32px); font-weight: 800; margin: 0; }
.lesson-head .btn { flex: none; }
@media (max-width: 640px) { .lesson-head { flex-direction: column; align-items: stretch; } }
.materials a { display: flex; align-items: center; gap: 10px; background: var(--bg); padding: 12px 14px; border-radius: var(--radius-sm); color: var(--text); font-weight: 600; margin-top: 8px; }
.materials a:hover { background: #e9e8f6; text-decoration: none; }
.materials svg { width: 18px; height: 18px; flex: none; }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.side-col { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 84px; }
@media (max-width: 920px) { .side-col { position: static; } }
.gauge-card { text-align: center; padding: 26px 24px 22px; }
.gauge { width: 210px; max-width: 100%; margin: 0 auto; display: block; }
.gauge-pct { font-size: 30px; font-weight: 800; margin-top: 4px; letter-spacing: -0.02em; }
.gauge-label { color: var(--muted); font-size: 14px; }
.done-card { background: linear-gradient(135deg, var(--navy), #33288c); color: #fff; text-align: center; }
.done-card h3 { color: #fff; }
.done-card p { color: rgba(255,255,255,.8); font-size: 14px; }
.outline-title { color: var(--purple); font-weight: 700; font-size: 18px; margin-bottom: 14px; display: block; }
.outline .mod { border-bottom: 1px solid var(--line); }
.outline .mod:last-child { border-bottom: 0; }
.outline .mod > button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 14px 0; background: none; border: 0; cursor: pointer; font-weight: 700; font-size: 15px; text-align: left; }
.outline .mod > button .count { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 14px; }
.outline .mod > button svg { width: 16px; height: 16px; transition: transform .2s; flex: none; }
.outline .mod.open > button svg { transform: rotate(90deg); }
.outline .lessons { display: none; padding-bottom: 10px; }
.outline .mod.open .lessons { display: block; }
.outline .l { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; color: var(--text); font-size: 15px; line-height: 1.4; }
.outline .l:hover { background: #f6f5fd; text-decoration: none; }
.outline .l.current { background: var(--purple-soft); }
.outline .l .t { flex: 1; min-width: 0; }
.outline .l .d { color: var(--muted); font-size: 13px; white-space: nowrap; }
.outline .l .st { width: 26px; height: 26px; border-radius: 50%; background: #efeef7; display: flex; align-items: center; justify-content: center; flex: none; color: var(--navy); }
.outline .l .st svg { width: 12px; height: 12px; }
.outline .l.done .st { background: var(--green); color: #fff; }
.outline .l.locked { color: var(--muted); }

/* ---------- Mis cursos ---------- */
.page-title { padding: 36px 0 20px; }
.page-title h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; margin: 0; }
.page-title p { margin: 6px 0 0; color: var(--muted); }
.progress { height: 8px; background: var(--chip); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), #ffc35c); border-radius: 99px; }
.progress-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); font-weight: 600; margin: 8px 0 4px; }
.progress-row .progress { flex: 1; }

/* ---------- Autenticación ---------- */
.auth-wrap { max-width: 440px; margin: 48px auto; padding: 0 20px; }
.auth-wrap .card { padding: 32px 28px; }
.auth-wrap h1 { font-size: 26px; font-weight: 800; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; font-size: 14px; flex-wrap: wrap; }

/* ---------- Verificación ---------- */
.verify { max-width: 640px; margin: 48px auto; padding: 0 20px; }
.verify .seal { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.verify .seal svg { width: 32px; height: 32px; }
.verify dl { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; margin: 20px 0; }
.verify dt { color: var(--muted); font-size: 14px; }
.verify dd { margin: 0; font-weight: 600; }
@media (max-width: 520px) { .verify dl { grid-template-columns: 1fr; gap: 2px; } .verify dd { margin-bottom: 10px; } }

/* ---------- Administración ---------- */
.admin-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 24px; padding-top: 24px; align-items: start; }
.admin-side { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 4px; }
.admin-side a { color: var(--muted); font-weight: 600; font-size: 15px; padding: 9px 12px; border-radius: 10px; }
.admin-side a:hover { background: #fff; text-decoration: none; color: var(--text); }
.admin-side a.active { background: #fff; color: var(--purple); box-shadow: 0 2px 10px rgba(27,22,80,.06); }
@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 1fr; padding-top: 12px; }
  .admin-side { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .admin-side a { white-space: nowrap; background: #fff; padding: 7px 12px; font-size: 14px; }
}
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-head h1 { font-size: clamp(22px, 3vw, 28px); font-weight: 800; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.stat .n { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.stat .l { color: var(--muted); font-size: 13px; font-weight: 600; }
.sku-box { background: var(--orange-soft); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14.5px; }
.sku-box b { color: #7a4a00; word-break: break-all; }
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table a.rowlink { color: var(--text); font-weight: 600; }
@media (max-width: 640px) {
  table.table.stack thead { display: none; }
  table.table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .table.stack td { border: 0; padding: 3px 0; }
  .table.stack td[data-label]::before { content: attr(data-label) ': '; color: var(--muted); font-size: 12.5px; }
}

/* Editor de contenido */
.mod-box { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 14px; }
.mod-box .mod-title { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.mod-box .mod-title .input { font-weight: 700; }
.lesson-item { display: flex; align-items: center; gap: 6px; background: var(--bg); border-radius: 10px; padding: 6px 6px 6px 12px; margin-bottom: 6px; }
.lesson-item .t { flex: 1; min-width: 0; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-item .d { font-size: 12.5px; color: var(--muted); white-space: nowrap; margin-right: 4px; }
.lesson-item .chip { font-size: 11.5px; padding: 2px 8px; }
@media (max-width: 560px) {
  .lesson-item { flex-wrap: wrap; padding: 10px 6px 6px 12px; }
  .lesson-item .t { flex-basis: 100%; white-space: normal; }
  .lesson-item .d { margin-right: auto; }
}
.add-row { display: flex; gap: 8px; margin-top: 8px; }
.add-row .input { flex: 1; min-width: 0; }
@media (max-width: 480px) { .add-row { flex-direction: column; } }
.danger-zone h2 { color: var(--text); }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

/* Diálogos */
dialog.modal { border: 0; border-radius: 20px; padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 80px rgba(0,0,0,.3); color: var(--text); }
dialog.modal::backdrop { background: rgba(27, 22, 80, .45); }
dialog.modal form, dialog.modal .modal-body { padding: 24px; }
dialog.modal h2 { font-size: 20px; }
dialog.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.material-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; margin-bottom: 8px; }
@media (max-width: 560px) { .material-row { grid-template-columns: 1fr auto; } .material-row .input:nth-child(2) { grid-column: 1; } }

/* Avisos */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: 0 12px 30px rgba(0,0,0,.25); animation: toast-in .2s ease-out; }
.toast.error { background: #a32727; }
.toast.ok { background: #1b7d54; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.notice { background: var(--orange-soft); color: #6a4300; border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 16px; }
.notice.info { background: var(--purple-soft); color: #3b2a9c; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 14.5px; }
.checklist li svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.checklist .ok svg { color: var(--green); }
.checklist .no svg { color: #c9c6dc; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--chip); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
