/* =====================  TallerCel Academy · UI académica moderna  =====================
   Cambia los colores de marca en :root. */
:root {
  --primary: #2563ff;
  --primary-600: #1a4de0;
  --primary-50: #eaf0ff;
  --primary-100: #d6e2ff;
  --cyan: #06c4e8;
  --navy: #0b1433;
  --ink: #172036;
  --muted: #6b7694;
  --line: #e4e9f2;
  --bg: #f2f5fb;
  --card: #ffffff;
  --ok: #0f9f68; --ok-bg: #e4f7ee;
  --warn: #b7791f; --warn-bg: #fff3d6;
  --bad: #d92d3f; --bad-bg: #fde8ea;
  --info: #2563ff; --info-bg: #eaf0ff;
  --violet: #7c5cff; --coral: #ff4d6d;
  --radius: 18px; --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(23,32,54,.05), 0 10px 30px rgba(23,32,54,.07);
  --shadow-lg: 0 2px 6px rgba(23,32,54,.06), 0 24px 56px rgba(23,32,54,.14);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 15.5px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; min-height: 100vh; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.015em; color: var(--ink); }
h1 { font-size: clamp(1.55rem, 3.4vw, 2rem); font-weight: 800; } h2 { font-size: 1.2rem; font-weight: 750; } h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 1em; } a { color: var(--primary); }
.muted { color: var(--muted); } .small { font-size: .87rem; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
:focus-visible { outline: 3px solid rgba(37,99,255,.45); outline-offset: 2px; border-radius: 8px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 99; border-radius: 8px; }
main { padding: 26px 0 48px; }
#app > * { animation: rise .45s cubic-bezier(.2,.8,.2,1) backwards; }
#app > *:nth-child(2) { animation-delay: .05s; } #app > *:nth-child(3) { animation-delay: .1s; } #app > *:nth-child(n+4) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Barra superior (sitio público y portal) ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar .container { display: flex; align-items: center; gap: 14px; min-height: 68px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; }
.logo-mark { width: 42px; height: 42px; object-fit: contain; transition: transform .35s cubic-bezier(.2,.9,.3,1.4); } .logo:hover .logo-mark { transform: rotate(-8deg) scale(1.08); }
.logo small { display: block; font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); font-weight: 800; margin-top: 3px; }
.logo b { font-weight: 800; }
.topbar nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.topbar nav a, .topbar nav button { color: #44506e; text-decoration: none; padding: 9px 16px; border-radius: 999px; background: none; border: 0; font: inherit; font-weight: 650; cursor: pointer; transition: background .2s, color .2s; }
.topbar nav a:hover, .topbar nav button:hover { background: var(--primary-50); color: var(--primary); }
.topbar nav a.active { background: var(--primary-50); color: var(--primary); }

/* ---------- Tarjetas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); position: relative; color: var(--ink); }
.card .card { box-shadow: none; background: #f8faff; }
a.card { color: var(--ink); text-decoration: none; display: block; transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s; }
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary-100); }
.grid { display: grid; gap: 18px; } .grid > .card { margin-bottom: 0; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; } .row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 14px; } .section-title h2 { margin: 0; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; min-height: 44px; border-radius: 12px; border: 1px solid var(--primary); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  background: linear-gradient(180deg, #3b74ff, #2563ff); box-shadow: 0 6px 16px rgba(37,99,255,.32); transition: transform .15s, box-shadow .2s, background .2s; }
.btn:hover { background: linear-gradient(180deg, #2f6bff, #1a4de0); box-shadow: 0 10px 22px rgba(37,99,255,.4); transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn.secondary { background: #fff; color: var(--primary); border-color: var(--line); box-shadow: 0 1px 2px rgba(23,32,54,.06); }
.btn.secondary:hover { background: var(--primary-50); border-color: var(--primary-100); box-shadow: none; }
.btn.danger { background: linear-gradient(180deg, #f0485a, #d92d3f); border-color: #d92d3f; box-shadow: 0 6px 16px rgba(217,45,63,.28); }
.btn.sm { min-height: 36px; padding: 6px 14px; font-size: .88rem; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn span[aria-hidden] { display: inline-block; transition: transform .2s; } .btn:hover span[aria-hidden] { transform: translateX(4px); }

/* Botón volver */
.back { display: inline-flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; margin: 0 0 18px; border-radius: 999px; color: var(--ink) !important; text-decoration: none !important; font-weight: 700; font-size: .93rem; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .2s cubic-bezier(.2,.9,.3,1.3), box-shadow .2s, border-color .2s; }
.back::before { content: ""; width: 30px; height: 30px; border-radius: 50%; flex: none; background: var(--primary-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563ff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5l-7 7 7 7'/%3E%3C/svg%3E") center / 16px no-repeat; transition: transform .25s; }
.back:hover { transform: translateX(-3px); border-color: var(--primary-100); box-shadow: var(--shadow-lg); } .back:hover::before { transform: translateX(-2px); background-color: var(--primary-100); }

/* ---------- Formularios ---------- */
.field { margin-bottom: 14px; } .field label { display: block; font-weight: 650; font-size: .9rem; color: #2b3552; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 13px; min-height: 44px; font: inherit; color: var(--ink); background: #fff; border: 1px solid #d5ddec; border-radius: var(--radius-sm); transition: border-color .2s, box-shadow .2s; }
input:hover, select:hover, textarea:hover { border-color: #b4c2dc; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,255,.16); }
textarea { min-height: 100px; resize: vertical; } input[type=file] { padding: 9px 12px; background: #f8faff; }
input[type=checkbox], input[type=radio] { display: inline-block; width: 21px; min-height: 21px; height: 21px; margin: 0 10px 0 0; vertical-align: middle; accent-color: var(--primary); }
label.check { font-weight: 450; display: flex; align-items: flex-start; gap: 4px; }
[aria-invalid=true] { border-color: var(--bad); background: #fff8f8; }
.err { color: var(--bad); font-size: .86rem; margin: 6px 0 0; font-weight: 600; } .hint { color: var(--muted); display: block; margin-top: 4px; }
.honeypot { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.filters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; margin-bottom: 16px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.filters .field { margin: 0; }

/* ---------- Insignias y avisos ---------- */
.badge, .chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: .76rem; font-weight: 750; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); } .badge.muted { background: #eceff5; color: var(--muted); }
.chip { background: rgba(255,255,255,.22); color: #fff; border: 1px solid rgba(255,255,255,.45); } .chip.hot { background: #fff; color: var(--ok); border-color: #fff; }
.notice { padding: 13px 16px; border-radius: var(--radius-sm); background: var(--warn-bg); color: #6b4300; border: 1px solid #f6d98e; margin-bottom: 16px; }
.notice.ok { background: var(--ok-bg); color: #075c3c; border-color: #a7e3c8; }
.state { text-align: center; padding: 34px 18px; color: var(--muted); background: #fff; border: 1px dashed #cfd9ec; border-radius: var(--radius); margin-bottom: 14px; }
.state.error { color: var(--bad); background: var(--bad-bg); border: 1px solid #f6b9c0; }
.card .state { background: none; border: 0; padding: 22px 8px; margin: 0; }
.spinner { display: inline-block; width: 18px; height: 18px; margin-right: 8px; border: 3px solid var(--primary-100); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; } @keyframes spin { to { transform: rotate(360deg); } }
.skel { height: 16px; margin: 12px 0; border-radius: 10px; background: linear-gradient(90deg, #e9eef8 25%, #f6f8fd 50%, #e9eef8 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
.skel.title { height: 34px; width: 40%; } .skel.short { width: 60%; } .skel.box { height: 130px; border-radius: 18px; margin: 0; }
.skel-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 20px; } @keyframes shimmer { to { background-position: -200% 0; } }

.price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.price .total { font-size: 1.9rem; font-weight: 850; letter-spacing: -.03em; color: var(--primary); } .price .old { text-decoration: line-through; color: var(--muted); }
.price .off { background: var(--ok-bg); color: var(--ok); font-weight: 800; border-radius: 999px; padding: 2px 10px; font-size: .8rem; }

/* ---------- Tablas ---------- */
.tablewrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .tablewrap { border: 0; box-shadow: none; border-radius: 0; }
table.t { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.t th { text-align: left; padding: 12px 16px; background: #f6f8fc; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; white-space: nowrap; }
table.t td { padding: 13px 16px; border-top: 1px solid var(--line); vertical-align: top; }
table.t tr.click { cursor: pointer; transition: background .15s; } table.t tr.click:hover td { background: #f6f9ff; }
@media (max-width: 720px) {
  .tablewrap { background: none; border: 0; box-shadow: none; }
  table.t.stackable thead { display: none; } table.t.stackable, table.t.stackable tbody, table.t.stackable tr, table.t.stackable td { display: block; width: 100%; }
  table.t.stackable tr { background: #fff; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 12px; padding: 8px 0; box-shadow: var(--shadow); }
  table.t.stackable td { border: 0; padding: 5px 16px; }
  table.t.stackable td::before { content: attr(data-label); display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; }
}

/* ---------- Indicadores, medidores, pestañas ---------- */
.kpi { text-align: center; } .kpi .n { font-size: 2.2rem; font-weight: 850; color: var(--primary); } .kpi .l { color: var(--muted); font-size: .9rem; font-weight: 600; }
.meter { height: 10px; background: #e8edf7; border-radius: 999px; overflow: hidden; } .meter > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--cyan), var(--primary)); transition: width .9s cubic-bezier(.2,.8,.2,1); }
.meter.excellent > i { background: linear-gradient(90deg, #34d399, #0f9f68); } .meter.good > i { background: linear-gradient(90deg, #06c4e8, #2563ff); }
.meter.risk > i { background: linear-gradient(90deg, #fbbf24, #f59e0b); } .meter.critical > i { background: linear-gradient(90deg, #fb7185, #d92d3f); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-bottom: 20px; }
.tabs button { background: none; border: 0; padding: 11px 18px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: color .2s, border-color .2s; }
.tabs button:hover { color: var(--primary); } .tabs button[aria-selected=true] { color: var(--primary); border-color: var(--primary); }

/* ---------- Modales, toasts ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(15,23,50,.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: grid; place-items: center; padding: 12px; z-index: 60; overflow: auto; animation: fade .2s; }
.modal { position: relative; background: #fff; border-radius: 22px; padding: 28px; width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); animation: pop .28s cubic-bezier(.2,.9,.3,1.2); }
.modal .x { position: absolute; top: 14px; right: 16px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #eef2fa; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--muted); } .modal .x:hover { background: var(--primary-50); color: var(--primary); }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: scale(.95) translateY(10px); } }
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 99; display: grid; gap: 8px; width: min(92vw, 440px); }
.toast { padding: 13px 18px; border-radius: 14px; color: #fff; font-weight: 600; background: var(--navy); box-shadow: var(--shadow-lg); border-left: 5px solid var(--cyan); animation: pop .3s; } .toast.bad { background: #8f1d2b; border-left-color: #ff7a8a; }
.timeline { list-style: none; padding: 0; margin: 0; } .timeline li { padding: 8px 0 8px 18px; border-left: 3px solid var(--primary-100); margin-left: 4px; }
.pager { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 16px; color: var(--muted); }
.legal { white-space: pre-wrap; } dd { margin: 0 0 10px; }
footer.site { color: var(--muted); font-size: .85rem; padding: 30px 0 40px; text-align: center; border-top: 1px solid var(--line); margin-top: 20px; } footer.site img { height: 40px; display: block; margin: 0 auto 10px; }

/* ---------- Tarjetas de indicadores de color ---------- */
.stat { position: relative; overflow: hidden; border-radius: var(--radius); padding: 20px 22px; color: #fff; box-shadow: 0 12px 28px rgba(23,32,54,.16); text-decoration: none; display: block; transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; }
a.stat:hover { transform: translateY(-4px); box-shadow: 0 18px 38px rgba(23,32,54,.24); }
.stat::before, .stat::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.14); }
.stat::before { width: 140px; height: 140px; right: -40px; top: -50px; } .stat::after { width: 80px; height: 80px; right: 50px; bottom: -40px; background: rgba(255,255,255,.1); }
.stat .l { font-size: .9rem; font-weight: 650; opacity: .92; } .stat .n { font-size: 2.6rem; font-weight: 850; letter-spacing: -.03em; line-height: 1.1; margin-top: 6px; } .stat .s { font-size: .8rem; opacity: .85; margin-top: 4px; }
.stat.blue { background: linear-gradient(135deg, #2563ff, #4f8bff); } .stat.coral { background: linear-gradient(135deg, #ff4d6d, #ff7a59); }
.stat.violet { background: linear-gradient(135deg, #6d4dff, #9a7bff); } .stat.green { background: linear-gradient(135deg, #0f9f68, #34c98b); } .stat.slate { background: linear-gradient(135deg, #3b4a6b, #5b6d93); }

/* Bienvenida */
.welcome { display: flex; align-items: center; gap: 22px; padding: 26px 30px; margin-bottom: 20px; border-radius: 22px; border: 1px solid #d6e2ff; overflow: hidden; position: relative;
  background: linear-gradient(115deg, #e7efff 0%, #f1edff 100%); }
.welcome h1 { margin-bottom: 6px; } .welcome p { margin: 0 0 14px; color: #44506e; max-width: 520px; }
.welcome svg { flex: none; width: 210px; height: auto; margin-left: auto; } @media (max-width: 720px) { .welcome svg { display: none; } .welcome { padding: 22px; } }
.cta-card { background: linear-gradient(135deg, #0b1433, #1d2f7a); color: #fff; border: 0; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.cta-card h3 { color: #fff; font-size: 1.15rem; margin: 0; } .cta-card p { color: #b9c6ee; margin: 0; }
.dash-top { display: grid; gap: 18px; grid-template-columns: 1fr; margin-bottom: 20px; } @media (min-width: 980px) { .dash-top { grid-template-columns: 2.2fr 1fr; } } .dash-top > * { margin: 0 !important; }

/* Gráficos */
.donut-wrap { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.donut { width: 168px; height: 168px; border-radius: 50%; display: grid; place-items: center; position: relative; flex: none; box-shadow: 0 8px 22px rgba(23,32,54,.1); }
.donut::before { content: ""; position: absolute; inset: 24px; border-radius: 50%; background: #fff; }
.donut > div { position: relative; text-align: center; line-height: 1.1; } .donut b { display: block; font-size: 2rem; font-weight: 850; } .donut span { font-size: .75rem; color: var(--muted); font-weight: 650; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; flex: 1; min-width: 160px; } .legend li { display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.legend i { width: 11px; height: 11px; border-radius: 4px; flex: none; } .legend b { margin-left: auto; }
.shift-card { padding: 18px 20px; } .shift-card .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.shift-card .course { font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; } .shift-card h3 { margin: 2px 0 12px; }
.shift-card .nums { display: flex; gap: 18px; margin-top: 12px; font-size: .85rem; color: var(--muted); } .shift-card .nums b { display: block; color: var(--ink); font-size: 1.15rem; }

/* ---------- Sitio público: banner ---------- */
.hero { position: relative; overflow: hidden; display: grid; gap: 20px; align-items: center; grid-template-columns: 1fr; padding: 34px 34px; margin-bottom: 22px; border-radius: 26px; color: #fff;
  background: radial-gradient(90% 140% at 100% 0%, rgba(6,196,232,.55), transparent 55%), linear-gradient(120deg, #1a4de0 0%, #2563ff 55%, #4a3cff 100%); box-shadow: 0 24px 50px rgba(37,99,255,.32); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: linear-gradient(100deg, transparent 25%, #000); mask-image: linear-gradient(100deg, transparent 25%, #000); }
.hero > * { position: relative; } @media (min-width: 820px) { .hero.with-logo { grid-template-columns: 1.2fr .8fr; } }
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.05; letter-spacing: -.03em; } .hero p { font-size: 1.08rem; color: #dbe6ff; max-width: 520px; }
.eyebrow { display: inline-block; padding: 5px 14px; border-radius: 999px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.4); font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px; color: #fff; }
.hero .brand-full { justify-self: center; width: min(100%, 400px); animation: float 7s ease-in-out infinite; filter: drop-shadow(0 12px 24px rgba(5,20,120,.4)); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.brand-full { display: block; width: min(100%, 420px); height: auto; } .brand-full.center { margin: 0 auto 16px; width: min(80%, 300px); }
.steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 0 0 26px; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; padding: 18px 20px 18px 70px; position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; } .steps li:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.steps li::before { content: counter(s); position: absolute; left: 18px; top: 18px; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 850; color: #fff; background: linear-gradient(135deg, #2563ff, #06c4e8); box-shadow: 0 6px 14px rgba(37,99,255,.35); }
.steps b { display: block; } .steps span { color: var(--muted); font-size: .9rem; }
.course .thumb { position: relative; height: 130px; margin: -22px -22px 18px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; display: flex; align-items: flex-end; gap: 8px; padding: 14px;
  background: radial-gradient(120% 120% at 90% 0%, rgba(6,196,232,.9), transparent 55%), linear-gradient(135deg, #2563ff, #4a3cff 75%); }
.course .thumb::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.14) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.14) 1px, transparent 1px); background-size: 26px 26px; -webkit-mask-image: linear-gradient(135deg, transparent 20%, #000); mask-image: linear-gradient(135deg, transparent 20%, #000); }
.course .thumb img { position: absolute; right: 16px; top: 14px; width: 84px; height: 84px; filter: drop-shadow(0 8px 14px rgba(0,20,120,.45)); animation: float 5s ease-in-out infinite; } .course .thumb .chip { position: relative; }

/* ---------- Portal del estudiante ---------- */
.att-hero { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }

/* ---------- ADMIN: barra lateral ---------- */
body.admin { background: var(--bg); }
.shell { display: grid; grid-template-columns: 268px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #fff; border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; z-index: 40; }
.sidebar .brand { display: block; padding: 4px 8px 18px; border-bottom: 1px solid var(--line); margin-bottom: 14px; } .sidebar .brand img { width: 100%; max-width: 200px; display: block; }
.nav-label { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: #9aa5bf; font-weight: 800; padding: 14px 12px 6px; }
.sidebar nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 13px; padding: 11px 14px; border-radius: 12px; color: #4a5676; text-decoration: none; font-weight: 650; position: relative; transition: background .2s, color .2s, transform .2s; }
.nav-item svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { background: #f2f6ff; color: var(--primary); transform: translateX(2px); }
.nav-item.active { background: var(--primary-50); color: var(--primary); } .nav-item.active::before { content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--primary); }
.sidebar .foot { margin-top: auto; padding-top: 16px; }
.user-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: #f5f8ff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #2563ff, #06c4e8); color: #fff; font-weight: 800; flex: none; }
.user-card b { display: block; line-height: 1.2; font-size: .92rem; } .user-card small { color: var(--muted); font-size: .74rem; }
.logout { margin-top: 8px; width: 100%; background: none; border: 1px solid var(--line); border-radius: 12px; padding: 9px; font: inherit; font-weight: 650; color: #6b7694; cursor: pointer; } .logout:hover { background: var(--bad-bg); color: var(--bad); border-color: #f6b9c0; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.appbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 10px 28px; background: rgba(242,245,251,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.appbar .crumb { font-weight: 800; font-size: 1.05rem; } .appbar .crumb small { color: var(--muted); font-weight: 600; margin-left: 8px; }
.appbar .spacer { flex: 1; } .burger { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; place-items: center; }
.burger svg { width: 22px; height: 22px; stroke: var(--ink); fill: none; stroke-width: 2; stroke-linecap: round; }
.main-col main { padding: 26px 28px 56px; max-width: 1280px; width: 100%; margin: 0 auto; }
.scrim { display: none; }
body.auth .sidebar, body.auth .appbar { display: none; } body.auth .shell { grid-template-columns: 1fr; }
body.auth { background: radial-gradient(80% 60% at 50% -10%, #dfe9ff, transparent 70%), var(--bg); }
body.auth .main-col main { max-width: 520px; padding-top: 6vh; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; } .burger { display: grid; }
  .sidebar { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-102%); transition: transform .3s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow-lg); }
  body.menu-open .sidebar { transform: none; } body.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15,23,50,.45); z-index: 35; }
  .appbar, .main-col main { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* =====================  v4 · MÓVIL + ANIMACIÓN  ===================== */
html { -webkit-tap-highlight-color: transparent; }
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); overflow-x: hidden; }
img { max-width: 100%; }
/* iOS hace zoom al enfocar campos con fuente < 16px */
input, select, textarea { font-size: 16px; }

/* Logo del banner: sin filtros sobre elementos animados (causaban parpadeo en móviles).
   La animación solo usa transform en un contenedor propio con capa de GPU. */
.hero .brand-full { animation: none; filter: none; }
.logo-float { justify-self: center; width: min(100%, 400px); will-change: transform; transform: translateZ(0); backface-visibility: hidden; animation: float 7s ease-in-out infinite; }
.logo-float .brand-full { width: 100%; height: auto; aspect-ratio: 440 / 208; filter: none; }
.logo-float { filter: none; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(6,196,232,.45), transparent 65%); pointer-events: none; animation: breathe 6s ease-in-out infinite; }
.course .thumb img { filter: none; }
@keyframes breathe { 0%, 100% { opacity: .6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes gridpan { to { background-position: 44px 44px; } }
.hero::before { animation: gridpan 10s linear infinite; }

/* Entrada del banner por partes */
.hero-copy > * { animation: rise .6s cubic-bezier(.2,.8,.2,1) backwards; }
.hero-copy > *:nth-child(2) { animation-delay: .08s; } .hero-copy > *:nth-child(3) { animation-delay: .16s; } .hero-copy > *:nth-child(4) { animation-delay: .24s; }
.hero-btn { margin-top: 4px; background: #fff; color: var(--primary); border-color: #fff; box-shadow: 0 10px 24px rgba(5,20,120,.3); }
.hero-btn:hover { background: #f0f5ff; box-shadow: 0 14px 30px rgba(5,20,120,.4); }
.hero-btn span { animation: bob 1.6s ease-in-out infinite; } @keyframes bob { 50% { transform: translateY(4px); } }

/* Aparición al hacer scroll (la activa fx.js) */
.rv { opacity: 0; transform: translateY(18px) scale(.985); }
.rv.in { opacity: 1; transform: none; transition: opacity .6s ease calc(var(--i, 0) * 70ms), transform .6s cubic-bezier(.2,.8,.2,1) calc(var(--i, 0) * 70ms); }

/* Ondas en botones */
.btn, .nav-item, .tabs button { position: relative; overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.55); transform: scale(0); animation: ripple .6s ease-out forwards; pointer-events: none; }
.btn.secondary .ripple, .nav-item .ripple, .tabs button .ripple { background: rgba(37,99,255,.22); }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%); transform: translateX(-130%); transition: transform .7s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.btn:hover::after { transform: translateX(130%); }
.btn.cta { animation: glow 2.8s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 6px 16px rgba(37,99,255,.32), 0 0 0 0 rgba(37,99,255,.35); } 50% { box-shadow: 0 8px 20px rgba(37,99,255,.4), 0 0 0 9px rgba(37,99,255,0); } }
.hero-btn.cta { animation: none; }
.btn.is-busy::before { content: ""; width: 15px; height: 15px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; }

/* Barra de progreso superior */
#topprogress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 100; opacity: 0; background: linear-gradient(90deg, var(--cyan), var(--primary)); box-shadow: 0 0 10px rgba(37,99,255,.6); transition: width .5s cubic-bezier(.2,.8,.2,1), opacity .3s; }
#topprogress.on { opacity: 1; }

/* Formularios vivos */
.field label { transition: color .2s; } .field:focus-within label { color: var(--primary); }
.shake { animation: shake .4s; } @keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.err { animation: rise .3s backwards; }
.tabs button[aria-selected=true] { animation: tabin .3s; } @keyframes tabin { from { opacity: .5; } }

/* Éxito */
.success-ico { width: 84px; height: 84px; margin: 0 auto 14px; }
.success-ico svg { width: 100%; height: 100%; fill: none; stroke: var(--ok); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.success-ico circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .7s .1s ease forwards; fill: var(--ok-bg); }
.success-ico path { stroke-dasharray: 44; stroke-dashoffset: 44; animation: draw .45s .65s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Gráficos y paneles */
.donut { animation: donutin .9s cubic-bezier(.2,.8,.2,1) backwards; } @keyframes donutin { from { opacity: 0; transform: rotate(-90deg) scale(.7); } }
.nav-item { animation: slidein .45s cubic-bezier(.2,.8,.2,1) backwards; }
.nav-item:nth-child(2) { animation-delay: .04s; } .nav-item:nth-child(3) { animation-delay: .08s; } .nav-item:nth-child(4) { animation-delay: .12s; } .nav-item:nth-child(5) { animation-delay: .16s; } .nav-item:nth-child(6) { animation-delay: .2s; } .nav-item:nth-child(n+7) { animation-delay: .24s; }
@keyframes slidein { from { opacity: 0; transform: translateX(-14px); } }
.nav-item svg { transition: transform .3s cubic-bezier(.2,.9,.3,1.5); } .nav-item:hover svg { transform: scale(1.18) rotate(-6deg); }
.badge.warn::before { animation: ping2 1.8s infinite; } @keyframes ping2 { 0% { box-shadow: 0 0 0 0 rgba(183,121,31,.5); } 70%, 100% { box-shadow: 0 0 0 7px rgba(183,121,31,0); } }
.stat { transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; } .stat:hover { transform: translateY(-4px); }
.stat::before { transition: transform .6s cubic-bezier(.2,.8,.2,1); } .stat:hover::before { transform: scale(1.25) translate(-8px, 6px); }
table.t tr.click td:first-child { transition: transform .2s; } table.t tr.click:hover td:first-child { transform: translateX(4px); }
.avatar { transition: transform .3s cubic-bezier(.2,.9,.3,1.5); } .user-card:hover .avatar { transform: rotate(-8deg) scale(1.1); }
.meter > i { background-size: 200% 100%; animation: flow 2.4s linear infinite; } @keyframes flow { to { background-position: -200% 0; } }
.sess { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sess li { background: var(--primary-50); color: var(--primary-600); border-radius: 999px; padding: 3px 11px; font-size: .78rem; } .sess li span { color: var(--muted); }

/* ---------- Ajustes para teléfonos ---------- */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .container { padding: 0 16px; } main { padding: 16px 0 36px; }
  /* Barra superior: sólida (sin desenfoque, que parpadea en iOS) y compacta */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: #fff; padding-top: env(safe-area-inset-top); }
  .topbar .container { min-height: 58px; gap: 8px; flex-wrap: nowrap; }
  .logo { gap: 9px; min-width: 0; } .logo-mark { width: 36px; height: 36px; } .logo b { font-size: .98rem; white-space: nowrap; }
  .topbar nav { gap: 0; margin-left: auto; flex-wrap: nowrap; } .topbar nav a, .topbar nav button { padding: 8px 10px; font-size: .84rem; white-space: nowrap; }
  /* Banner: logo arriba y texto debajo, sin movimiento ni brillos pesados */
  .hero, .hero.with-logo { grid-template-columns: 1fr; padding: 20px 18px 22px; border-radius: 22px; gap: 14px; margin-bottom: 16px; }
  .hero .logo-float { order: -1; width: min(70%, 250px); animation: none; will-change: auto; }
  .hero::after { display: none; } .hero::before { animation: none; }
  .hero-copy { text-align: center; } .hero h1 { font-size: 1.9rem; } .hero p { font-size: 1rem; margin-left: auto; margin-right: auto; }
  .hero-btn { width: 100%; }
  .steps { grid-template-columns: 1fr; gap: 10px; margin-bottom: 18px; } .steps li { padding: 14px 16px 14px 64px; border-radius: 16px; }
  .steps li::before { left: 14px; top: 14px; width: 36px; height: 36px; }
  .card { padding: 18px; border-radius: 18px; } .course .thumb { margin: -18px -18px 14px; height: 108px; } .course .thumb img { width: 70px; height: 70px; animation: none; }
  .grid, .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; gap: 14px; }
  .grid.cols-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card .btn.cta, .course .btn, .card .row > .btn { width: 100%; }
  .price .total { font-size: 1.7rem; }
  .back { margin-bottom: 14px; }
  h1 { font-size: 1.55rem; } h2 { font-size: 1.12rem; }
  .modal { padding: 22px 18px; border-radius: 20px; }
  .filters { grid-template-columns: 1fr 1fr; padding: 14px; } .filters .field:first-child, .filters .btn { grid-column: 1 / -1; }
  footer.site { padding: 22px 0 calc(28px + env(safe-area-inset-bottom)); } footer.site img { height: 34px; }
  .welcome { padding: 18px; } .dash-top { gap: 14px; }
  .donut { width: 144px; height: 144px; } .donut::before { inset: 20px; }
  .btn.cta { animation: none; }
}
@media (max-width: 380px) { .hero h1 { font-size: 1.65rem; } .topbar nav a:first-child { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .rv, .rv.in { opacity: 1 !important; transform: none !important; transition: none !important; }
  .logo-float, .hero::after, .hero::before, .btn.cta, .meter > i, .hero-btn span, .success-ico circle, .success-ico path { animation: none !important; }
  .success-ico circle, .success-ico path { stroke-dashoffset: 0; }
}
