/* TodoCalls Hub — estilos (sitio público + panel). Mobile first. */
:root {
  --green: #1FE08A;
  --green-600: #12b56d;
  --green-50: #e9fdf3;
  --ink: #10151C;
  --ink-2: #1b232d;
  --text: #2a3441;
  --muted: #667085;
  --line: #e4e7ec;
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --danger: #d92d20;
  --danger-50: #fef3f2;
  --warn: #b54708;
  --warn-50: #fffaeb;
  --info: #175cd3;
  --info-50: #eff8ff;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(16,21,28,.05), 0 1px 3px rgba(16,21,28,.06);
  --shadow-lg: 0 10px 30px rgba(16,21,28,.10);
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4.5rem;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --container: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img, video { max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 var(--s3); font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 var(--s4); }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 200; }
.skip-link:focus { left: 0; }

.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.2em; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--s4); }
.section { padding-block: var(--s7); }
.section-soft { background: var(--bg-soft); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s5); }
.section-head p { margin: 0; color: var(--muted); }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--green-600); margin-bottom: var(--s2); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font: inherit; font-weight: 600; font-size: .95rem; padding: .7rem 1.25rem; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.2; transition: background .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: var(--ink); }
.btn-primary:hover { background: #3cf0a0; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }
.btn-outline { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-danger { background: var(--danger-50); color: var(--danger); border-color: #fecdca; }
.btn-danger:hover { background: #fee4e2; }
.btn-sm { padding: .4rem .8rem; font-size: .85rem; }
.btn-lg { padding: .9rem 1.6rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: not-allowed; }

/* Encabezado */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-in { display: flex; align-items: center; gap: var(--s4); min-height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 800; color: var(--ink); letter-spacing: -.02em; font-size: 1.1rem; }
.brand img { height: 34px; width: auto; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: var(--green); display: grid; place-items: center; font-size: .95rem; }
.nav { display: none; flex: 1; align-items: center; gap: var(--s1); }
.nav a { text-decoration: none; padding: .5rem .8rem; border-radius: 8px; font-weight: 500; font-size: .95rem; color: var(--text); }
.nav a:hover { background: var(--bg-soft); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 700; box-shadow: inset 0 -2px 0 var(--green); border-radius: 0; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.menu-toggle { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; font-size: 1.1rem; }
.mobile-nav { display: none; border-top: 1px solid var(--line); padding: var(--s3) var(--s4) var(--s4); background: #fff; }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: .7rem .4rem; text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--line); }
.mobile-nav .btn { margin-top: var(--s3); }
.header-actions .btn-label { display: none; }
@media (min-width: 900px) {
  .nav { display: flex; margin-left: var(--s4); }
  .menu-toggle, .mobile-nav { display: none !important; }
  .header-actions .btn-label { display: inline; }
}

/* Flash y alertas */
.flash-wrap { padding-top: var(--s4); }
.alert { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg-soft); font-size: .93rem; margin-bottom: var(--s3); }
.alert .icon { margin-top: .15rem; }
.alert-ok { background: var(--green-50); border-color: #a6f4c5; color: #05603a; }
.alert-error { background: var(--danger-50); border-color: #fecdca; color: #912018; }
.alert-info { background: var(--info-50); border-color: #b2ddff; color: #175cd3; }
.alert-warn { background: var(--warn-50); border-color: #fedf89; color: var(--warn); }
.alert form { margin-left: auto; }

/* Hero */
.hero { padding-block: var(--s7) var(--s8); background: radial-gradient(900px 400px at 85% -10%, rgba(31,224,138,.18), transparent 60%), #fff; }
.hero h1 { max-width: 18ch; margin-bottom: var(--s4); }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 58ch; margin-bottom: var(--s5); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
.page-hero { padding-block: var(--s6) var(--s5); border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.page-hero h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin-bottom: var(--s2); }
.page-hero p { color: var(--muted); max-width: 62ch; margin: 0; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: var(--s3); display: flex; flex-wrap: wrap; gap: .4rem; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; }

/* Grids y tarjetas */
.grid { display: grid; gap: var(--s4); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s2); text-decoration: none; position: relative; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.card:hover, .card.is-link:hover { border-color: var(--green); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card h3 { margin: 0; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: .93rem; }
.card-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--green-50); color: var(--green-600); display: grid; place-items: center; font-size: 1.35rem; margin-bottom: var(--s2); }
.card-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.card-foot { margin-top: auto; padding-top: var(--s3); display: flex; align-items: center; justify-content: space-between; gap: var(--s2); font-size: .85rem; color: var(--muted); }
.card.is-soon { background: var(--bg-soft); box-shadow: none; }
.card.is-soon .card-icon { background: #eaecf0; color: var(--muted); }
.card-media { margin: calc(var(--s5) * -1) calc(var(--s5) * -1) var(--s3); aspect-ratio: 16/9; background: linear-gradient(135deg, var(--ink), #243142); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; display: grid; place-items: center; color: var(--green); font-size: 2.2rem; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }

.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; background: #eaecf0; color: var(--text); letter-spacing: .02em; white-space: nowrap; }
.badge-green { background: var(--green-50); color: #05603a; }
.badge-dark { background: var(--ink); color: var(--green); }
.badge-warn { background: var(--warn-50); color: var(--warn); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-info { background: var(--info-50); color: var(--info); }
.card .badges { position: absolute; top: var(--s3); right: var(--s3); display: flex; gap: .3rem; }

/* Filtros */
.filters { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-bottom: var(--s5); }
.search { position: relative; flex: 1 1 240px; max-width: 420px; }
.search input { width: 100%; padding: .65rem .9rem .65rem 2.4rem; border: 1px solid var(--line); border-radius: 999px; font: inherit; background: #fff; }
.search .icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { padding: .4rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: .88rem; font-weight: 500; text-decoration: none; color: var(--text); }
.chip:hover { border-color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Rutas */
.path-card { background: var(--ink); color: #cbd5e1; border: 0; }
.path-card h3 { color: #fff; }
.path-card p { color: #9aa7b8; }
.path-card .card-icon { background: rgba(31,224,138,.15); color: var(--green); }
a.path-card:hover { border-color: var(--green); }
.section-link { font-weight: 600; text-decoration: none; color: var(--ink); display: inline-flex; gap: .4rem; align-items: center; }
.section-link:hover { color: var(--green-600); }

/* Formularios */
.form { display: grid; gap: var(--s4); }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label, .field .label { font-weight: 600; font-size: .9rem; color: var(--ink); }
.field .help { font-size: .8rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=search], select, textarea { width: 100%; font: inherit; font-size: .97rem; padding: .65rem .8rem; border: 1px solid #d0d5dd; border-radius: var(--radius-sm); background: #fff; color: var(--ink); }
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(31,224,138,.35); border-color: var(--green-600); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; }
.check input { margin-top: .25rem; width: 1.05rem; height: 1.05rem; accent-color: var(--green-600); flex: none; }
.form-row { display: grid; gap: var(--s4); }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.hp { position: absolute; left: -9999px; }
.auth-wrap { max-width: 460px; margin: var(--s6) auto var(--s7); }
.auth-wrap.wide { max-width: 640px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--s5); }
.panel + .panel { margin-top: var(--s4); }
.panel h2 { font-size: 1.15rem; }

/* Academia */
.course-grid .card { padding-top: var(--s5); }
.meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .85rem; color: var(--muted); align-items: center; }
.meta span { display: inline-flex; align-items: center; gap: .3rem; }
.premium { background: linear-gradient(135deg, var(--ink), #1f2c3b); color: #cbd5e1; border-radius: var(--radius-lg); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); border: 1px solid #243142; }
.premium h3 { color: #fff; margin: 0; }
.premium p { margin: 0; color: #9aa7b8; }
.premium .btn { align-self: flex-start; }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); padding-block: var(--s5) var(--s7); }
.lesson-layout > * { min-width: 0; }
@media (min-width: 960px) { .lesson-layout { grid-template-columns: 300px minmax(0, 1fr); align-items: start; } .lesson-side { position: sticky; top: 84px; } }
.toc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.toc summary { list-style: none; cursor: pointer; padding: .9rem 1rem; font-weight: 700; color: var(--ink); display: flex; justify-content: space-between; align-items: center; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow: auto; }
.toc li a { display: flex; gap: .7rem; padding: .7rem 1rem; text-decoration: none; border-top: 1px solid var(--line); font-size: .92rem; align-items: flex-start; }
.toc li a:hover { background: var(--bg-soft); }
.toc li a.active { background: var(--green-50); font-weight: 600; box-shadow: inset 3px 0 var(--green); }
.toc .num { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 1.4rem; }
.toc .dur { margin-left: auto; color: var(--muted); font-size: .8rem; white-space: nowrap; }
@media (min-width: 960px) { .toc summary { pointer-events: none; } .toc summary .icon { display: none; } }
.video { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.video button, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video button { padding: 0; cursor: pointer; background: #000 center/cover no-repeat; display: grid; place-items: center; }
.video .play { width: 74px; height: 74px; border-radius: 50%; background: var(--green); color: var(--ink); display: grid; place-items: center; font-size: 1.8rem; box-shadow: 0 8px 24px rgba(0,0,0,.35); transition: transform .15s; }
.video button:hover .play { transform: scale(1.08); }
.lesson-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s4) 0; }
.pager { display: grid; gap: var(--s3); grid-template-columns: 1fr 1fr; margin-top: var(--s6); }
.pager a { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) var(--s4); text-decoration: none; display: flex; flex-direction: column; gap: .2rem; background: #fff; }
.pager a:hover { border-color: var(--green); }
.pager a small { color: var(--muted); }
.pager a strong { color: var(--ink); font-size: .95rem; }
.pager .next { text-align: right; align-items: flex-end; grid-column: 2; }

/* Contenido largo */
.prose { font-size: 1.05rem; line-height: 1.75; color: #1d2733; max-width: 75ch; }
.prose h2 { margin-top: 2.2rem; font-size: 1.5rem; }
.prose h3 { margin-top: 1.8rem; font-size: 1.2rem; }
.prose img { border-radius: var(--radius-sm); margin-block: var(--s4); }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 var(--s4); }
.prose li { margin-bottom: .35rem; }
.prose blockquote { margin: var(--s5) 0; padding: .6rem 1.2rem; border-left: 4px solid var(--green); background: var(--green-50); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink); font-weight: 500; }
.prose blockquote p:last-child { margin: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: var(--s4) 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: .55rem .8rem; text-align: left; }
.prose th { background: var(--bg-soft); }
.prose a { color: var(--green-600); font-weight: 600; }
.prose :not(pre) > code { background: #eef1f4; padding: .12em .4em; border-radius: 5px; font-family: var(--mono); font-size: .9em; color: var(--ink); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }

/* Bloques de código */
.codeblock { position: relative; margin: var(--s4) 0; border-radius: var(--radius); overflow: hidden; background: #0d1219; border: 1px solid #1f2937; }
.codeblock .code-head { display: flex; justify-content: space-between; align-items: center; padding: .4rem .6rem .4rem 1rem; background: #151c26; color: #94a3b8; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.codeblock .copy { display: inline-flex; align-items: center; gap: .35rem; background: transparent; border: 1px solid #2a3647; color: #cbd5e1; border-radius: 6px; padding: .25rem .6rem; font: inherit; font-size: .75rem; cursor: pointer; text-transform: none; letter-spacing: 0; }
.codeblock .copy:hover { border-color: var(--green); color: var(--green); }
.codeblock pre { margin: 0; padding: 1rem; overflow-x: auto; font-family: var(--mono); font-size: .88rem; line-height: 1.6; color: #e2e8f0; background: none; }
.codeblock code { font-family: inherit; background: none; padding: 0; color: inherit; }
.tok-k { color: #7dd3fc; font-weight: 600; } .tok-f { color: #86efac; } .tok-s { color: #fcd34d; } .tok-n { color: #f9a8d4; } .tok-c { color: #6b7a90; font-style: italic; } .tok-o { color: #cbd5e1; }

/* Paginación */
.pagination { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; margin-top: var(--s6); }
.pagination a, .pagination span { min-width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-size: .9rem; padding-inline: .6rem; background: #fff; }
.pagination a:hover { border-color: var(--ink); }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Pie */
.site-footer { background: var(--ink); color: #9aa7b8; padding-block: var(--s7) var(--s5); margin-top: var(--s7); }
.footer-grid { display: grid; gap: var(--s5); }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.site-footer h4 { color: #fff; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: var(--s3); }
.site-footer a { text-decoration: none; display: block; padding: .2rem 0; font-size: .93rem; }
.site-footer a:hover { color: var(--green); }
.site-footer .brand { color: #fff; margin-bottom: var(--s3); }
.socials { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: var(--s3); }
.socials a { width: 38px; height: 38px; border: 1px solid #2a3647; border-radius: 10px; display: grid; place-items: center; padding: 0; font-size: 1.1rem; }
.socials a:hover { border-color: var(--green); }
.footer-bottom { border-top: 1px solid #1f2937; margin-top: var(--s6); padding-top: var(--s4); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); font-size: .85rem; }

/* Cookies */
.cookie-banner { position: fixed; left: var(--s3); right: var(--s3); bottom: var(--s3); z-index: 100; max-width: 620px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: var(--s4); display: none; gap: var(--s3); flex-direction: column; font-size: .9rem; }
.cookie-banner.show { display: flex; }
.cookie-banner .row { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* Estados vacíos y varios */
.empty { text-align: center; padding: var(--s7) var(--s4); color: var(--muted); border: 1px dashed #d0d5dd; border-radius: var(--radius); background: var(--bg-soft); }
.empty .icon { font-size: 2rem; margin-bottom: var(--s2); }
.error-page { text-align: center; padding-block: var(--s8); }
.error-page .code { font-size: 5rem; font-weight: 800; color: var(--green); line-height: 1; letter-spacing: -.05em; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; margin: 0; font-size: .93rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; color: var(--ink); }
.resource-hero { display: grid; gap: var(--s5); padding-block: var(--s5) var(--s6); }
@media (min-width: 860px) { .resource-hero { grid-template-columns: 1.6fr 1fr; align-items: start; } }

/* ==================== Panel de administración ==================== */
body.admin { background: var(--bg-soft); }
.admin-shell { display: block; min-height: 100vh; }
.admin-top { background: var(--ink); color: #fff; display: flex; align-items: center; gap: var(--s3); padding: .6rem var(--s4); position: sticky; top: 0; z-index: 60; }
.admin-top .brand { color: #fff; font-size: 1rem; }
.admin-top .menu-toggle { background: transparent; color: #fff; border-color: #2a3647; }
.admin-top .who { margin-left: auto; font-size: .85rem; color: #9aa7b8; display: flex; gap: var(--s3); align-items: center; }
.admin-side { display: none; background: var(--ink); padding: var(--s3); }
.admin-side.open { display: block; }
.admin-side a { display: flex; gap: .7rem; align-items: center; color: #cbd5e1; text-decoration: none; padding: .6rem .8rem; border-radius: 8px; font-size: .93rem; font-weight: 500; }
.admin-side a:hover { background: #1b232d; color: #fff; }
.admin-side a.active { background: rgba(31,224,138,.14); color: var(--green); }
.admin-side .grp { color: #6b7a90; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; padding: .9rem .8rem .3rem; font-weight: 700; }
.admin-main { padding: var(--s4); min-width: 0; }
.admin-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.admin-head h1 { font-size: 1.5rem; margin: 0; }
.admin-head .actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
@media (min-width: 960px) {
  .admin-shell { display: grid; grid-template-columns: 250px 1fr; grid-template-rows: auto 1fr; }
  .admin-top { grid-column: 1 / -1; }
  .admin-top .menu-toggle { display: none; }
  .admin-side { display: block; position: sticky; top: 52px; height: calc(100vh - 52px); overflow-y: auto; }
  .admin-main { padding: var(--s5) var(--s6); }
}
.stats { display: grid; gap: var(--s3); grid-template-columns: repeat(2, 1fr); margin-bottom: var(--s4); }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .stats { grid-template-columns: repeat(6, 1fr); } }
.wa-cta { display: flex; flex-direction: column; gap: var(--s4); align-items: flex-start; background: var(--green-50); border: 1px solid #a6f4c5; border-radius: var(--radius-lg); padding: var(--s5); }
.wa-cta .wa-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--ink); color: var(--green); display: grid; place-items: center; font-size: 1.6rem; flex: none; }
.wa-cta h3 { margin: 0 0 .25rem; } .wa-cta p { margin: 0; color: var(--text); }
@media (min-width: 760px) { .wa-cta { flex-direction: row; align-items: center; } .wa-cta .wa-text { flex: 1; } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); box-shadow: var(--shadow); }
.stat .n { font-size: 1.9rem; font-weight: 800; color: var(--ink); letter-spacing: -.03em; line-height: 1.1; }
.stat .l { font-size: .8rem; color: var(--muted); }
.bars { display: grid; gap: .55rem; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 38%) 1fr auto; gap: .6rem; align-items: center; font-size: .86rem; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: #eef1f4; border-radius: 99px; height: 10px; overflow: hidden; }
.bar-fill { background: var(--green); height: 100%; border-radius: 99px; }
.bar-row .val { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .7rem .9rem; background: var(--bg-soft); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.actions { white-space: nowrap; text-align: right; }
.table .handle { cursor: grab; color: var(--muted); width: 28px; }
.table tr.dragging { opacity: .4; }
.table tr.drop-target td { box-shadow: inset 0 2px 0 var(--green); }
.table td form { display: inline; }
.table select.inline { padding: .3rem .5rem; font-size: .82rem; width: auto; }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-bottom: var(--s3); }
.toolbar select, .toolbar input { width: auto; padding: .5rem .7rem; font-size: .88rem; }
.form-grid { display: grid; gap: var(--s4); }
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.tabs { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: var(--s4); border-bottom: 1px solid var(--line); }
.tabs a { padding: .6rem 1rem; text-decoration: none; font-weight: 600; font-size: .9rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--ink); border-color: var(--green); }
.img-field { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.img-field img { height: 64px; width: auto; max-width: 140px; border-radius: 8px; border: 1px solid var(--line); object-fit: cover; }
.icon-picker { display: flex; flex-wrap: wrap; gap: .4rem; }
.icon-picker label { cursor: pointer; }
.icon-picker input { position: absolute; opacity: 0; }
.icon-picker span { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; font-size: 1.15rem; background: #fff; }
.icon-picker input:checked + span { border-color: var(--green-600); background: var(--green-50); color: var(--green-600); box-shadow: 0 0 0 2px rgba(31,224,138,.3); }
.icon-picker input:focus-visible + span { outline: 3px solid var(--green); }
.media-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.media-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; font-size: .78rem; }
.media-item img { aspect-ratio: 4/3; width: 100%; object-fit: cover; display: block; }
.media-item .in { padding: .5rem; display: grid; gap: .3rem; }
.block-list { display: grid; gap: .5rem; }
.block-item { display: flex; gap: .8rem; align-items: center; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .8rem; }
.block-item input[type=number] { width: 64px; margin-left: auto; padding: .35rem; }
.login-note { font-size: .85rem; color: var(--muted); }
.pre-box { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: .8rem; font-family: var(--mono); font-size: .8rem; overflow-x: auto; }

/* Editor de texto enriquecido */
.rte { border: 1px solid #d0d5dd; border-radius: var(--radius-sm); background: #fff; overflow: hidden; }
.rte-bar { display: flex; flex-wrap: wrap; gap: .25rem; padding: .4rem; background: var(--bg-soft); border-bottom: 1px solid var(--line); align-items: center; }
.rte-bar button, .rte-bar select { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: .3rem .55rem; font: inherit; font-size: .85rem; cursor: pointer; color: var(--ink); width: auto; min-width: 32px; height: 32px; }
.rte-bar button:hover { background: #fff; border-color: var(--line); }
.rte-bar button.on { background: var(--green-50); border-color: var(--green-600); }
.rte-bar .sep { width: 1px; height: 22px; background: var(--line); margin-inline: .25rem; }
.rte-area { min-height: 320px; max-height: 70vh; overflow: auto; padding: 1rem 1.2rem; outline: none; }
.rte-area:focus { box-shadow: inset 0 0 0 2px rgba(31,224,138,.35); }
.rte-area pre { background: #0d1219; color: #e2e8f0; padding: 1rem; border-radius: 8px; font-family: var(--mono); font-size: .88rem; position: relative; margin: var(--s3) 0; }
.rte-area pre::before { content: attr(data-lang); position: absolute; top: 4px; right: 8px; font-size: .68rem; text-transform: uppercase; color: #6b7a90; letter-spacing: .06em; }
.rte-area pre code { color: inherit; background: none; }
.rte-source { width: 100%; min-height: 320px; border: 0; font-family: var(--mono); font-size: .85rem; display: none; border-radius: 0; }
.rte.source .rte-area { display: none; } .rte.source .rte-source { display: block; }
@media print { .site-header, .site-footer, .cookie-banner, .lesson-side { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
