
/* ============================================================
   ANDRAGOGÍA PRO — Design Tokens
   ============================================================ */
:root {
  --azul: #121851;
  --azul-soft: #1c2568;
  --violeta: #4C449D;
  --violeta-soft: #6a61c2;
  --turquesa: #55AFAA;
  --turquesa-soft: #e6f4f3;
  --gradiente: linear-gradient(135deg, #55AFAA, #4C449D);

  --bg: #f7f8fc;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --border: #e6e8f2;
  --text-1: #121851;
  --text-2: #4a4f72;
  --text-3: #8388a6;
  --shadow-sm: 0 1px 2px rgba(18,24,81,0.06), 0 1px 1px rgba(18,24,81,0.04);
  --shadow-md: 0 8px 24px rgba(18,24,81,0.08), 0 2px 6px rgba(18,24,81,0.05);
  --shadow-lg: 0 20px 50px rgba(18,24,81,0.14), 0 4px 12px rgba(18,24,81,0.06);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font-display: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --ease: cubic-bezier(.22,.61,.36,1);
  --sidebar-w: 280px;
  --topbar-h: 72px;
}

[data-theme="dark"] {
  --bg: #0b0e2a;
  --bg-elev: #121737;
  --surface: #151b3d;
  --border: #262d55;
  --text-1: #f1f2fb;
  --text-2: #c2c5e0;
  --text-3: #8a8fbd;
  --turquesa-soft: #16302f;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-2);
  -webkit-font-smoothing: antialiased;
  transition: background .4s var(--ease), color .4s var(--ease);
}
h1,h2,h3,h4,h5 { font-family: var(--font-display); color: var(--text-1); margin: 0 0 .5em; line-height: 1.25; }
p { line-height: 1.7; margin: 0 0 1em; }
a { color: var(--violeta); }
button { font-family: var(--font-body); cursor: pointer; }
::selection { background: var(--turquesa); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

:focus-visible { outline: 3px solid var(--turquesa); outline-offset: 2px; border-radius: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ============ WELCOME SCREEN ============ */
#welcome {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #121851 0%, #1a2264 45%, #4C449D 100%);
  overflow: hidden;
  transition: opacity .6s var(--ease), visibility .6s var(--ease);
}
#welcome.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#welcome::before, #welcome::after {
  content: ""; position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(85,175,170,.35), transparent 70%);
  filter: blur(10px);
}
#welcome::before { width: 520px; height: 520px; top: -120px; right: -120px; animation: float1 12s ease-in-out infinite; }
#welcome::after { width: 380px; height: 380px; bottom: -100px; left: -80px; background: radial-gradient(circle, rgba(76,68,157,.45), transparent 70%); animation: float2 14s ease-in-out infinite; }
@keyframes float1 { 0%,100% { transform: translate(0,0);} 50% { transform: translate(-30px,30px);} }
@keyframes float2 { 0%,100% { transform: translate(0,0);} 50% { transform: translate(20px,-25px);} }

.welcome-inner {
  position: relative; z-index: 2; text-align: center; max-width: 640px; padding: 40px;
  animation: welcomeIn 1s var(--ease) both;
}
@keyframes welcomeIn { from { opacity: 0; transform: translateY(24px);} to { opacity: 1; transform: translateY(0);} }
.welcome-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: #cfe9e7; font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 600; margin-bottom: 24px; font-family: var(--font-body);
}
.welcome-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--turquesa); box-shadow: 0 0 12px var(--turquesa); }
.welcome-inner h1 { color: #fff; font-size: clamp(32px, 5vw, 52px); font-weight: 800; margin-bottom: 18px; letter-spacing: -.02em; }
.welcome-inner h1 span { background: linear-gradient(135deg, #79d6d0, #a79bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.welcome-sub { color: #c7cbf0; font-size: 18px; line-height: 1.6; margin-bottom: 22px; }
.welcome-author { color: #a9adde; font-size: 14px; font-weight: 300; letter-spacing: .04em; font-style: italic; margin-bottom: 28px; opacity: .92; }
.btn-start {
  background: #fff; color: var(--azul); border: none; padding: 16px 38px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: .01em;
  display: inline-flex; align-items: center; gap: 10px; transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.btn-start:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 16px 40px rgba(0,0,0,.32); }
.btn-start svg { transition: transform .3s var(--ease); }
.btn-start:hover svg { transform: translateX(4px); }
.welcome-meta { margin-top: 34px; display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; }
.welcome-meta div { color: #a9adde; font-size: 13px; }
.welcome-meta strong { display: block; color: #fff; font-family: var(--font-display); font-size: 22px; font-weight: 700; }

/* ============ APP SHELL ============ */
#app { display: none; }
#app.active { display: block; }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--azul); color: #fff; z-index: 40;
  display: flex; flex-direction: column; padding: 24px 16px;
  transition: transform .35s var(--ease), background .4s var(--ease);
}
[data-theme="dark"] .sidebar { background: #0a0e2b; border-right: 1px solid #1b2350; }
.brand { display: flex; align-items: center; gap: 12px; padding: 8px 10px 28px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; background: var(--gradiente);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-family: var(--font-display); font-weight: 800; color: #fff; font-size: 16px;
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: #fff; line-height: 1.2; }
.brand-tag { font-size: 11px; color: #9ba3d6; }

.nav-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #7d84bd; padding: 18px 12px 8px; font-weight: 600; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px;
  color: #c4c9ee; text-decoration: none; font-size: 14px; font-weight: 500; border: none;
  background: none; width: 100%; text-align: left; transition: background .2s var(--ease), color .2s var(--ease);
}
.nav-item .ic { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--violeta); color: #fff; box-shadow: var(--shadow-sm); }
.nav-item .badge-count { margin-left: auto; font-size: 11px; background: rgba(255,255,255,.14); padding: 2px 7px; border-radius: 999px; }
.nav-item.active .badge-count { background: rgba(255,255,255,.25); }

.sidebar-progress { margin-top: auto; padding: 16px 12px 8px; }
.sp-label { display: flex; justify-content: space-between; font-size: 12px; color: #9ba3d6; margin-bottom: 8px; }
.sp-bar { height: 7px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; }
.sp-fill { height: 100%; background: var(--gradiente); border-radius: 999px; transition: width .6s var(--ease); }

.sidebar-toggle {
  display: none; position: fixed; top: 16px; left: 16px; z-index: 60;
  width: 44px; height: 44px; border-radius: 12px; background: var(--azul); border: none;
  align-items: center; justify-content: center; box-shadow: var(--shadow-md);
}
.sidebar-toggle svg { stroke: #fff; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(10,12,40,.5); z-index: 39; }

.main {
  margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column;
}
.topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: 30;
  background: var(--bg-elev); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 20px; padding: 0 32px;
  backdrop-filter: blur(10px); background: color-mix(in srgb, var(--bg-elev) 90%, transparent);
}
.search-box {
  flex: 1; max-width: 420px; position: relative;
}
.search-box input {
  width: 100%; padding: 11px 16px 11px 42px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-1); font-size: 14px; transition: border-color .2s, box-shadow .2s;
}
.search-box input:focus { border-color: var(--violeta); box-shadow: 0 0 0 4px rgba(76,68,157,.12); outline: none; }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); stroke: var(--text-3); }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 340px;
  overflow-y: auto; display: none; z-index: 50;
}
.search-results.show { display: block; }
.search-result-item { padding: 12px 16px; border-bottom: 1px solid var(--border); display: block; text-decoration: none; }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item:focus { background: var(--turquesa-soft); }
.search-result-item .srt-mod { font-size: 11px; color: var(--violeta); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.search-result-item .srt-title { color: var(--text-1); font-weight: 600; font-size: 14px; margin-top: 2px; }
.search-empty { padding: 20px; text-align: center; color: var(--text-3); font-size: 13px; }

.topbar-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.topbar-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.topbar-progress .ring { width: 34px; height: 34px; }
.theme-toggle {
  width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--border); background: var(--bg);
  display: flex; align-items: center; justify-content: center; transition: background .2s, transform .2s;
}
.theme-toggle:hover { background: var(--turquesa-soft); transform: rotate(12deg); }
.theme-toggle svg { stroke: var(--text-1); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.content { padding: 36px 40px 80px; max-width: 1180px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); margin-bottom: 18px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--violeta); }
.breadcrumb .sep { opacity: .5; }
.breadcrumb .current { color: var(--violeta); font-weight: 600; }

.view { display: none; animation: fadeSlideIn .5s var(--ease) both; }
.view.active { display: block; }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(14px);} to { opacity: 1; transform: translateY(0);} }

/* ============ DASHBOARD HERO ============ */
.dash-hero {
  background: var(--azul); border-radius: var(--radius-lg); padding: 44px 40px; color: #fff; position: relative;
  overflow: hidden; margin-bottom: 32px;
}
.dash-hero::after {
  content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%;
  background: var(--gradiente); opacity: .25; filter: blur(50px); top: -100px; right: -60px;
}
.dash-hero-eyebrow { position: relative; z-index: 1; color: #9ecdc9; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 12px; }
.dash-hero h1 { position: relative; z-index: 1; color: #fff; font-size: clamp(26px,3.4vw,36px); max-width: 640px; }
.dash-hero p { position: relative; z-index: 1; color: #c4c9ee; max-width: 560px; font-size: 15px; }
.dash-hero-stats { position: relative; z-index: 1; display: flex; gap: 32px; margin-top: 24px; flex-wrap: wrap; }
.dash-hero-stats div strong { display: block; font-family: var(--font-display); font-size: 26px; color: #fff; }
.dash-hero-stats div span { font-size: 12px; color: #9ba3d6; }

.section-title-row { display: flex; align-items: baseline; justify-content: space-between; margin: 40px 0 18px; }
.section-title-row h2 { font-size: 20px; }
.section-title-row .hint { font-size: 13px; color: var(--text-3); }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }

.mod-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 24px; text-decoration: none; display: block; position: relative; overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
  cursor: pointer;
}
.mod-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: transparent; }
.mod-card .mc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.mod-card .mc-icon {
  width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  background: var(--turquesa-soft); color: var(--turquesa);
}
.mod-card .mc-level { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 4px 10px; border-radius: 999px; }
.lvl-principiante { background: #e6f4f3; color: #2b7f79; }
.lvl-intermedio { background: #fff2d9; color: #9a6a05; }
.lvl-avanzado { background: #fde3e3; color: #b8342f; }
[data-theme="dark"] .lvl-principiante { background: #123231; color: #7fd8d0; }
[data-theme="dark"] .lvl-intermedio { background: #3a2c0c; color: #f0c26a; }
[data-theme="dark"] .lvl-avanzado { background: #3a1616; color: #f39a94; }
.mod-card h3 { font-size: 17px; margin-bottom: 8px; }
.mod-card p { font-size: 13.5px; color: var(--text-3); margin-bottom: 16px; }
.mod-card .mc-progress { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.mod-card .mc-progress-fill { height: 100%; background: var(--gradiente); border-radius: 999px; transition: width .5s var(--ease); }
.mod-card .mc-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); }
.mod-card.special { background: var(--gradiente); border: none; color: #fff; }
.mod-card.special h3, .mod-card.special p { color: #fff; }
.mod-card.special p { color: rgba(255,255,255,.85); }
.mod-card.special .mc-icon { background: rgba(255,255,255,.2); color: #fff; }

/* ============ BUTTONS / GENERIC ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 11px;
  font-weight: 600; font-size: 14px; border: none; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
  font-family: var(--font-body);
}
.btn-primary { background: var(--violeta); color: #fff; }
.btn-primary:hover { background: var(--violeta-soft); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-1); }
.btn-ghost:hover { border-color: var(--violeta); color: var(--violeta); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 9px; }

/* ============ TOPIC PAGE ============ */
.topic-header { margin-bottom: 28px; }
.topic-eyebrow { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; color: var(--violeta); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.topic-header h1 { font-size: clamp(24px, 3vw, 32px); }
.topic-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); margin-top: 10px; }
.topic-meta span { display: flex; align-items: center; gap: 6px; }

.callout {
  border-radius: var(--radius-md); padding: 20px 22px; margin: 20px 0; border-left: 4px solid var(--turquesa);
  background: var(--turquesa-soft); display: flex; gap: 14px;
}
.callout .co-icon { color: var(--turquesa); flex-shrink: 0; }
.callout h4 { font-size: 14px; margin-bottom: 4px; color: var(--text-1); }
.callout p { font-size: 14px; margin: 0; color: var(--text-2); }
.callout.violeta { border-left-color: var(--violeta); background: color-mix(in srgb, var(--violeta) 8%, transparent); }
.callout.violeta .co-icon { color: var(--violeta); }
.callout.azul { border-left-color: var(--azul); background: color-mix(in srgb, var(--azul) 6%, transparent); }
.callout.azul .co-icon { color: var(--azul); }

/* Tabs */
.tabs { border-bottom: 1px solid var(--border); display: flex; gap: 4px; margin: 24px 0 0; overflow-x: auto; }
.tab-btn {
  background: none; border: none; padding: 12px 18px; font-size: 14px; font-weight: 600; color: var(--text-3);
  border-bottom: 2px solid transparent; white-space: nowrap; transition: color .2s, border-color .2s;
}
.tab-btn:hover { color: var(--text-1); }
.tab-btn.active { color: var(--violeta); border-bottom-color: var(--violeta); }
.tab-panel { display: none; padding: 22px 2px; animation: fadeSlideIn .35s var(--ease) both; }
.tab-panel.active { display: block; }

/* Accordion */
.accordion { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin: 16px 0; }
.acc-item + .acc-item { border-top: 1px solid var(--border); }
.acc-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; background: var(--surface); border: none; text-align: left;
  font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text-1);
}
.acc-head:hover { background: var(--turquesa-soft); }
.acc-head .acc-num { color: var(--violeta); margin-right: 10px; font-weight: 700; }
.acc-icon { transition: transform .3s var(--ease); flex-shrink: 0; stroke: var(--violeta); }
.acc-item.open .acc-icon { transform: rotate(45deg); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height .4s var(--ease); background: var(--bg); }
.acc-item.open .acc-body { max-height: 800px; }
.acc-body-inner { padding: 4px 20px 20px; font-size: 14.5px; }

/* Cards flip */
.flip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 16px; margin: 20px 0; }
.flip-card { perspective: 1200px; height: 190px; }
.flip-inner { position: relative; width: 100%; height: 100%; transition: transform .6s var(--ease); transform-style: preserve-3d; cursor: pointer; }
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius-md);
  padding: 18px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  border: 1px solid var(--border);
}
.flip-front { background: var(--surface); }
.flip-front .ff-tag { font-size: 11px; color: var(--turquesa); font-weight: 700; text-transform: uppercase; margin-bottom: 8px; }
.flip-front h4 { font-size: 15px; }
.flip-front .ff-hint { font-size: 12px; color: var(--text-3); margin-top: 10px; }
.flip-back { background: var(--gradiente); color: #fff; transform: rotateY(180deg); }
.flip-back p { font-size: 13.5px; margin: 0; color: #fff; }

/* Stepper */
.stepper { display: flex; flex-wrap: wrap; gap: 0; margin: 26px 0; counter-reset: step; }
.step { flex: 1; min-width: 180px; position: relative; padding: 0 16px 0 0; }
.step .st-num {
  width: 34px; height: 34px; border-radius: 50%; background: var(--gradiente); color: #fff; display: flex;
  align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 14px; margin-bottom: 12px;
}
.step h4 { font-size: 14.5px; margin-bottom: 6px; }
.step p { font-size: 13px; color: var(--text-3); margin: 0; }
.step::after { content: ""; position: absolute; top: 17px; left: calc(100% - 8px); width: calc(100% - 34px); height: 2px; background: var(--border); display: none; }
@media (min-width: 720px) { .step::after { display: block; } .step:last-child::after { display: none; } }

/* Timeline (Kolb cycle etc.) */
.timeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; margin: 22px 0; }
.tl-node { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; position: relative; }
.tl-node .tl-badge { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; background: var(--turquesa-soft); color: var(--turquesa); font-weight: 700; font-family: var(--font-display); font-size: 13px; margin-bottom: 10px; }
.tl-node h4 { font-size: 14.5px; margin-bottom: 6px; }
.tl-node p { font-size: 13px; margin: 0; color: var(--text-3); }
.tl-arrow { display: none; align-items: center; justify-content: center; color: var(--violeta); }
@media (min-width: 900px) { .timeline.cycle-4 { grid-template-columns: 1fr auto 1fr auto; } .tl-arrow { display: flex; } }

/* Pyramid (Miller) */
.pyramid { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 26px 0; max-width: 560px; margin-left:auto; margin-right:auto; }
.pyr-level { color: #fff; padding: 16px; border-radius: 10px; text-align: center; font-family: var(--font-display); font-weight: 600; font-size: 14px; transition: transform .25s var(--ease); }
.pyr-level:hover { transform: scale(1.02); }
.pyr-level small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 12px; opacity: .85; margin-top: 4px; }
.pyr-1 { width: 40%; background: #2f2a70; }
.pyr-2 { width: 60%; background: #4C449D; }
.pyr-3 { width: 80%; background: #4a9a95; }
.pyr-4 { width: 100%; background: #55AFAA; }

/* Bloom levels */
.bloom-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 10px; margin: 22px 0; }
.bloom-item { border-radius: 12px; padding: 16px; color: #fff; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 14px; position: relative; }
.bloom-item span { display: block; font-family: var(--font-body); font-weight: 400; font-size: 11px; margin-top: 4px; opacity: .9; }

/* Checklist */
.checklist { list-style: none; margin: 18px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 14px; cursor: pointer; transition: background .2s, border-color .2s; }
.checklist li:hover { border-color: var(--turquesa); }
.checklist li.checked { background: var(--turquesa-soft); }
.checklist li .chk-box { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: background .2s, border-color .2s; }
.checklist li.checked .chk-box { background: var(--turquesa); border-color: var(--turquesa); }
.checklist li.checked span.chk-text { text-decoration: line-through; color: var(--text-3); }

/* Comparison table cards */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
@media (max-width: 640px) { .compare-grid { grid-template-columns: 1fr; } }
.compare-card { border-radius: var(--radius-md); padding: 20px; border: 1px solid var(--border); background: var(--surface); }
.compare-card.hl { border-color: var(--violeta); box-shadow: 0 0 0 3px rgba(76,68,157,.1); }
.compare-card h4 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.compare-card ul { margin: 12px 0 0; padding-left: 18px; font-size: 13.5px; }
.compare-card li { margin-bottom: 6px; }

/* Badges / progress bar / tooltip */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--turquesa-soft); color: var(--turquesa); text-transform: uppercase; letter-spacing: .04em; }
.badge.violeta { background: color-mix(in srgb, var(--violeta) 12%, transparent); color: var(--violeta); }
.progressbar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.progressbar-fill { height: 100%; background: var(--gradiente); border-radius: 999px; transition: width .6s var(--ease); }
[data-tip] { position: relative; cursor: help; border-bottom: 1px dashed var(--violeta); }
[data-tip]::after {
  content: attr(data-tip); position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%) translateY(4px);
  background: var(--azul); color: #fff; font-size: 12px; padding: 8px 12px; border-radius: 8px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); z-index: 20; box-shadow: var(--shadow-md);
}
[data-tip]:hover::after, [data-tip]:focus::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Key points / conclusion box */
.key-points { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 22px; margin: 20px 0; }
.key-points h4 { font-size: 14px; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.key-points ul { margin: 0; padding-left: 20px; }
.key-points li { margin-bottom: 8px; font-size: 14px; }
.conclusion-box { background: var(--gradiente); border-radius: var(--radius-md); padding: 24px; color: #fff; margin: 24px 0; }
.conclusion-box h4 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.conclusion-box p { color: rgba(255,255,255,.95); margin: 0; font-size: 14.5px; }

/* Mark complete */
.mark-complete-row { display: flex; align-items: center; justify-content: space-between; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--border); flex-wrap: wrap; gap: 14px; }
.mc-btn { display: inline-flex; align-items: center; gap: 9px; padding: 12px 22px; border-radius: 11px; border: 2px solid var(--turquesa); background: transparent; color: var(--turquesa); font-weight: 700; font-size: 14px; transition: all .25s var(--ease); }
.mc-btn.done { background: var(--turquesa); color: #fff; }
.topic-nav { display: flex; gap: 10px; }

/* Quiz */
.quiz-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; margin: 20px 0; }
.quiz-q { font-family: var(--font-display); font-weight: 600; font-size: 15px; margin-bottom: 16px; color: var(--text-1); }
.quiz-opts { display: flex; flex-direction: column; gap: 10px; }
.quiz-opt { text-align: left; padding: 13px 16px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--bg); font-size: 14px; color: var(--text-2); transition: border-color .2s, background .2s; }
.quiz-opt:hover { border-color: var(--violeta); }
.quiz-opt.correct { border-color: #2f9e6f; background: #e5f7ee; color: #1c6b49; font-weight: 600; }
.quiz-opt.wrong { border-color: #d9534f; background: #fdecec; color: #a63a36; }
[data-theme="dark"] .quiz-opt.correct { background: #103524; color: #7fe0b3; }
[data-theme="dark"] .quiz-opt.wrong { background: #391616; color: #f0928e; }
.quiz-feedback { margin-top: 14px; font-size: 13.5px; padding: 12px 14px; border-radius: 10px; display: none; }
.quiz-feedback.show { display: block; }
.quiz-feedback.ok { background: #e5f7ee; color: #1c6b49; }
.quiz-feedback.bad { background: #fdecec; color: #a63a36; }
[data-theme="dark"] .quiz-feedback.ok { background: #103524; color: #7fe0b3; }
[data-theme="dark"] .quiz-feedback.bad { background: #391616; color: #f0928e; }

/* Reflection */
.reflect-box { border: 1.5px dashed var(--violeta); border-radius: var(--radius-md); padding: 20px; margin: 18px 0; background: color-mix(in srgb, var(--violeta) 5%, transparent); }
.reflect-box h4 { font-size: 14px; color: var(--violeta); margin-bottom: 8px; }
.reflect-box textarea { width: 100%; min-height: 80px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-elev); padding: 12px; font-family: var(--font-body); font-size: 13.5px; color: var(--text-1); resize: vertical; }

/* Reveal answer */
.reveal-wrap { margin: 18px 0; }
.reveal-content { display: none; margin-top: 12px; padding: 16px; background: var(--turquesa-soft); border-radius: 10px; font-size: 14px; }
.reveal-content.show { display: block; animation: fadeSlideIn .3s var(--ease) both; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10,12,40,.55); z-index: 80; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.show { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius-lg); padding: 32px; max-width: 520px; width: 100%; box-shadow: var(--shadow-lg); animation: modalIn .35s var(--ease) both; max-height: 85vh; overflow-y: auto; }
@keyframes modalIn { from { opacity: 0; transform: scale(.94) translateY(10px);} to { opacity: 1; transform: scale(1) translateY(0);} }
.modal h3 { display: flex; align-items: center; gap: 10px; }
.modal-close { position: absolute; top: 20px; right: 20px; }

/* Matrix 80/20 */
.matrix-board { display: grid; grid-template-columns: repeat(auto-fit,minmax(300px,1fr)); gap: 20px; margin-top: 24px; }
.matrix-col { border-radius: var(--radius-lg); padding: 4px; }
.matrix-col-head { padding: 18px 20px; border-radius: var(--radius-md) var(--radius-md) 0 0; color: #fff; }
.matrix-col-head h3 { color: #fff; font-size: 16px; margin-bottom: 2px; }
.matrix-col-head span { font-size: 12px; color: rgba(255,255,255,.85); }
.matrix-col-body { background: var(--surface); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius-md) var(--radius-md); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.matrix-item { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; font-size: 13px; }
.matrix-item .mi-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 700; margin-bottom: 4px; }
.matrix-item strong { color: var(--text-1); display: block; margin-bottom: 3px; font-size: 13.5px; }
.mc-principiante .matrix-col-head { background: #2b7f79; }
.mc-intermedio .matrix-col-head { background: #b8860b; }
.mc-avanzado .matrix-col-head { background: #b8342f; }

/* Sources */
.source-mod { margin-bottom: 32px; }
.source-mod h3 { display: flex; align-items: center; gap: 10px; }
.source-list { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 10px; }
.source-list li { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--turquesa); border-radius: 10px; padding: 13px 16px; font-size: 13px; line-height: 1.55; }

/* Concept tree / mind map */
.tree { margin: 26px 0; }
.tree-root { background: var(--gradiente); color: #fff; padding: 14px 20px; border-radius: 12px; font-family: var(--font-display); font-weight: 700; text-align: center; max-width: 320px; margin: 0 auto 20px; font-size: 14px; }
.tree-branches { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 12px; }
.tree-node { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--turquesa); border-radius: 10px; padding: 12px 14px; font-size: 12.5px; text-align: center; }
.tree-node strong { display: block; font-size: 13px; margin-bottom: 4px; color: var(--text-1); }

/* Carousel */
.carousel { position: relative; margin: 24px 0; overflow: hidden; border-radius: var(--radius-md); }
.carousel-track { display: flex; transition: transform .5s var(--ease); }
.carousel-slide { min-width: 100%; padding: 30px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.carousel-slide h4 { font-size: 15px; }
.carousel-controls { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.carousel-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); border: none; }
.carousel-dot.active { background: var(--violeta); width: 22px; border-radius: 999px; }
.carousel-arrows { position: absolute; top: 50%; left: 0; right: 0; display: flex; justify-content: space-between; transform: translateY(-50%); padding: 0 10px; pointer-events: none; }
.carousel-arrow { pointer-events: auto; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; }

/* Footer */
.app-footer { margin-top: 60px; padding: 32px 40px; background: var(--azul); color: #cfd2ee; font-size: 13px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.app-footer strong { color: #fff; font-weight: 600; }
.footer-main { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.footer-sep { color: #7d84bd; }
.footer-license { display: flex; flex-direction: column; align-items: center; gap: 10px; line-height: 1.6; max-width: 680px; }
.cc-link { display: inline-flex; align-items: center; gap: 10px; color: #cfe9e7; text-decoration: none; transition: color .2s; flex-wrap: wrap; justify-content: center; }
.cc-link:hover { color: #fff; }
.cc-icon { display: inline-flex; line-height: 0; }
.cc-icon svg { display: block; border-radius: 4px; opacity: .95; transition: opacity .2s, transform .2s; }
.cc-link:hover .cc-icon svg { opacity: 1; transform: translateY(-1px); }

@media (max-width: 640px) {
  .app-footer { padding: 24px 20px; }
  .footer-main { flex-direction: column; gap: 6px; }
  .footer-sep { display: none; }
}

/* Toast */
#toast { position: fixed; bottom: 24px; right: 24px; background: var(--azul); color: #fff; padding: 14px 20px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; font-size: 14px; z-index: 90; transform: translateY(30px); opacity: 0; transition: all .4s var(--ease); pointer-events: none; }
#toast.show { transform: translateY(0); opacity: 1; }
#toast .toast-ic { color: var(--turquesa); }

/* Empty search state icon reuse */
.icon-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); }

/* Responsive */
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .sidebar-backdrop.show { display: block; }
  .main { margin-left: 0; }
  .topbar { padding: 0 20px 0 68px; }
  .content { padding: 24px 20px 70px; }
  .search-box { max-width: 100%; }
}
@media (max-width: 640px) {
  .dash-hero { padding: 30px 22px; }
  .compare-grid { grid-template-columns: 1fr; }
  .topbar { gap: 10px; }
  .topbar-progress span.tp-text { display: none; }
}
