/* ─── RESET & VARIABLES ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:         #0067d3;
  --primary-light:   rgba(0, 103, 211, 0.08);
  --primary-mid:     rgba(0, 103, 211, 0.22);
  --secondary:       #485e89;
  --ebc-blue:        #0067d3;
  --ebc-blue-light:  rgba(0,103,211,0.08);
  --ebc-blue-mid:    #185FA5;
  --ebc-blue-dark:   #004b99;
  --bg:              #f9f9ff;
  --bg-secondary:    #eef1fa;
  --text:            #181c22;
  --text-secondary:  #414753;
  --text-tertiary:   #727785;
  --border:          rgba(255,255,255,0.5);
  --border-solid:    rgba(0,0,0,0.09);
  --glass:           rgba(255,255,255,0.28);
  --glass-card:      rgba(255,255,255,0.55);
  --glass-intense:   rgba(255,255,255,0.72);
  --blur:            blur(32px) saturate(190%);
  --blur-sm:         blur(16px) saturate(160%);
  --radius-md:       12px;
  --radius-lg:       18px;
  --radius-xl:       24px;
  --radius-2xl:      32px;
  --shadow-card:     0 2px 16px rgba(0,103,211,0.07);
  --shadow-hover:    0 8px 32px rgba(0,103,211,0.15);
  --danger-bg:       rgba(255,235,235,0.9);
  --danger-text:     #b91c1c;
  --danger-border:   rgba(185,28,28,0.25);
  --warning-bg:      rgba(255,251,235,0.9);
  --warning-text:    #92400e;
  --success-bg:      rgba(240,253,244,0.9);
  --success-text:    #166534;
  --sidebar-w:       272px;
  --topbar-h:        66px;
}

html, body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: var(--text);
  min-height: 100%;
}

body {
  background: radial-gradient(ellipse at 20% 0%, #ffffff 0%, #d8e8ff 40%, #eef2ff 80%, #f4f6ff 100%);
  background-attachment: fixed;
}

/* En la vista de licenciatura el layout es fijo: sólo scrollean las columnas. */
body.vista-licenciatura { height: 100%; overflow: hidden; }
html:has(body.vista-licenciatura) { height: 100%; overflow: hidden; }
body.modal-open { overflow: hidden; }

.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;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 8px;
}

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

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,103,211,0.2); border-radius: 10px; }

/* ═══════════════════════════════════════════════════════════
   INICIO
   ═══════════════════════════════════════════════════════════ */
.home {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px 72px;
}
.home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 56px;
}
.home-logo { display: block; color: #111111; }
.home-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0,103,211,0.09);
  color: var(--primary);
  border: 1px solid rgba(0,103,211,0.18);
  white-space: nowrap;
}
.home-title {
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 16px;
  max-width: 15ch;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.home-lead {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 58ch;
  margin-bottom: 44px;
}

.lic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.lic-card {
  position: relative;
  overflow: hidden;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  background: var(--glass-card);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: var(--radius-2xl);
  padding: 26px 24px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}
.lic-card::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(0,103,211,0.05);
  transition: transform 0.4s;
  pointer-events: none;
}
.lic-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(0,103,211,0.28);
  transform: translateY(-3px);
}
.lic-card:hover::after { transform: scale(1.3); }
.lic-card > * { position: relative; z-index: 1; }

.lic-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-lg);
  background: rgba(0,103,211,0.1);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.lic-name {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.025em;
  color: var(--text);
  transition: color 0.15s;
}
.lic-card:hover .lic-name { color: var(--primary); }
.lic-certs { display: flex; flex-wrap: wrap; gap: 6px; }
.lic-certs span {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(0,0,0,0.06);
  color: var(--text-secondary);
}
.lic-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(0,0,0,0.055);
  padding-top: 16px;
  margin-top: auto;
}
.lic-nums { display: flex; gap: 20px; font-size: 11px; color: var(--text-tertiary); font-weight: 600; }
.lic-nums b {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.lic-go {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,103,211,0.28);
  transition: transform 0.18s;
}
.lic-card:hover .lic-go { transform: translateX(3px); }

.home-help {
  margin-top: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-tertiary);
}
.home-help i { font-size: 18px; color: var(--primary); opacity: 0.7; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   VISTA DE LICENCIATURA
   ═══════════════════════════════════════════════════════════ */

/* ─── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  z-index: 50;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-right: 1px solid rgba(255,255,255,0.5);
  box-shadow: 4px 0 28px rgba(0,103,211,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-logo {
  padding: 22px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
  color: #111111;
}
.ebc-logo {
  width: 118px;
  height: auto;
  display: block;
}
.btn-volver {
  margin: 14px 14px 0;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-tertiary);
  background: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
  align-self: flex-start;
}
.btn-volver:hover { color: var(--primary); background: rgba(255,255,255,0.45); }
.btn-volver i { font-size: 15px; }
.sidebar-lic {
  padding: 8px 20px 14px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text);
  flex-shrink: 0;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 16px;
}
.slabel {
  font-size: 10px;
  font-weight: 700;
  color: rgba(0,103,211,0.5);
  padding: 14px 10px 8px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
}
.eje-btn {
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.15s, background 0.15s;
  line-height: 1.3;
}
.eje-btn i { font-size: 17px; flex-shrink: 0; opacity: 0.75; }
.eje-btn span { flex: 1; }
.eje-n {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.eje-btn:hover {
  color: var(--primary);
  background: rgba(255,255,255,0.45);
}
.eje-btn:hover i { opacity: 1; }
.eje-btn.active {
  color: var(--primary);
  font-weight: 700;
  background: rgba(0,103,211,0.1);
  box-shadow: inset 0 0 0 1px rgba(0,103,211,0.18);
}
.eje-btn.active i { opacity: 1; }
.eje-btn.active .eje-n { color: var(--primary); }

.sidebar-scrim { display: none; }

/* ─── TOPBAR ─────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; right: 0;
  left: var(--sidebar-w);
  height: var(--topbar-h);
  z-index: 40;
  background: rgba(255,255,255,0.22);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border-bottom: 1px solid rgba(255,255,255,0.45);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 28px;
}
.tabs { display: flex; gap: 6px; }
.tab {
  padding: 7px 18px 6px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-tertiary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.tab:hover { color: var(--text-secondary); }
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.menu-toggle {
  display: none;
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.55);
  color: var(--primary);
  font-size: 20px;
  cursor: pointer;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ─── LAYOUT ─────────────────────────────────────────────── */
.main-wrapper {
  position: fixed;
  left: var(--sidebar-w);
  top: var(--topbar-h);
  right: 0;
  bottom: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.lic-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.content {
  flex: 1;
  padding: 28px 24px 40px;
  overflow-y: auto;
  min-width: 0;
}

/* ─── ENCABEZADO DE SECCIÓN ──────────────────────────────── */
.eje-hdr { margin-bottom: 22px; }
.kicker { margin-bottom: 10px; }
.kicker-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0,103,211,0.09);
  color: var(--primary);
  border: 1px solid rgba(0,103,211,0.18);
}
.kicker-badge i { font-size: 14px; }
.kicker-neutral {
  background: rgba(255,255,255,0.6);
  color: var(--text-secondary);
  border-color: rgba(0,0,0,0.08);
}
.eje-hdr h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.eje-hdr p {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.65;
  max-width: 620px;
}

/* ─── BUSCADOR Y FILTROS ─────────────────────────────────── */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}
.search {
  flex: 1 1 260px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  background: var(--glass-card);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  color: var(--text-tertiary);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search:focus-within {
  border-color: rgba(0,103,211,0.35);
  box-shadow: 0 4px 18px rgba(0,103,211,0.12);
}
.search i { font-size: 17px; flex-shrink: 0; }
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--text);
}
.search input::placeholder { color: var(--text-tertiary); }
.search input::-webkit-search-cancel-button { cursor: pointer; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-secondary);
  background: var(--glass-card);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { color: var(--primary); border-color: rgba(0,103,211,0.25); }
.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,103,211,0.28);
}
.chips-static { margin-top: 12px; }
.chip-static { cursor: default; box-shadow: none; }
.chip-static:hover { color: var(--text-secondary); border-color: rgba(255,255,255,0.7); }

.results-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.empty {
  padding: 44px 24px;
  text-align: center;
  color: var(--text-tertiary);
  background: rgba(255,255,255,0.4);
  border: 1px dashed rgba(0,103,211,0.22);
  border-radius: var(--radius-xl);
}
.empty i { font-size: 30px; color: rgba(0,103,211,0.35); }
.empty p { font-size: 13px; margin: 10px 0 14px; }
.btn-clear-filters {
  padding: 8px 16px;
  background: rgba(0,103,211,0.07);
  color: var(--primary);
  border: 1px solid rgba(0,103,211,0.18);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-clear-filters:hover { background: rgba(0,103,211,0.14); }

/* ─── SECCIONES POR GRUPO ────────────────────────────────── */
.cert-sec { margin-bottom: 26px; }
.cert-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  padding: 7px 0 10px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(0,103,211,0.1);
}
.cert-name-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
}
.cert-name-wrap::before {
  content: '';
  display: block;
  width: 4px;
  height: 18px;
  background: var(--primary);
  border-radius: 3px;
  flex-shrink: 0;
}
.cert-title-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.cert-count { font-size: 10px; color: var(--text-tertiary); font-weight: 600; }

/* ─── TARJETAS DE MATERIA ────────────────────────────────── */
.mgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mc {
  background: var(--glass-card);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s, background 0.15s, opacity 0.2s;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.mc::after {
  content: '';
  position: absolute;
  top: -24px; right: -24px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(0,103,211,0.04);
  transition: transform 0.4s;
  pointer-events: none;
}
.mc:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(0,103,211,0.28);
  transform: translateY(-2px);
}
.mc:hover::after { transform: scale(1.5); }
.mc > * { position: relative; z-index: 1; }

.mc-grupo {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 5px;
}
.mc-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 7px;
  color: var(--text);
  transition: color 0.15s;
}
.mc:hover .mc-name { color: var(--primary); }
.mc-req {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--text-tertiary);
  line-height: 1.35;
  margin-bottom: 9px;
}
.mc-req i { font-size: 13px; flex-shrink: 0; opacity: 0.7; }
.mc-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.055);
}
.mc-code { font-size: 10px; color: var(--text-tertiary); font-weight: 500; }
.mc-cr   { font-size: 10px; color: var(--text-secondary); margin-left: auto; font-weight: 600; }
.mc-info { font-size: 13px; color: var(--text-tertiary); margin-left: auto; opacity: 0.55; }
.mc-cr + .mc-info { margin-left: 0; }

/* Badges de modalidad */
.mc-stag {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
}
.mtag-mac {
  background: rgba(255,251,235,0.95);
  color: #92400e;
  border: 1px solid rgba(146,64,14,0.18);
}
.mtag-linea {
  background: rgba(236,253,245,0.95);
  color: #0b6a52;
  border: 1px solid rgba(11,106,82,0.18);
}
.mtag-semi {
  background: rgba(243,240,255,0.95);
  color: #4a3aa8;
  border: 1px solid rgba(74,58,168,0.18);
}

/* ─── PLAN DE ESTUDIOS ───────────────────────────────────── */
.route-hint {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--ebc-blue-dark);
  line-height: 1.45;
  background: rgba(0,103,211,0.06);
  border: 1px solid rgba(0,103,211,0.15);
  border-radius: var(--radius-lg);
  padding: 12px 15px;
  margin-bottom: 22px;
}
.route-hint i { font-size: 18px; color: var(--primary); flex-shrink: 0; }
.route-group-title { margin-top: 24px; }

.route {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 8px;
}
.route-col {
  flex: 1 0 236px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.route-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  padding: 2px 2px 4px;
}
.route-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,103,211,0.1);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.mc-route { padding: 12px 14px; }
.mc-route .mc-name { font-size: 12.5px; }
.mc-dim { opacity: 0.3; }
.mc-hl {
  border-color: rgba(0,103,211,0.55) !important;
  box-shadow: 0 0 0 3px rgba(0,103,211,0.12), var(--shadow-hover);
}
/* La materia a la que se llegó desde el modal conserva su marca aunque el
   resaltado por hover se recalcule. */
.mc-hl-self {
  background: rgba(0,103,211,0.08);
  border-color: rgba(0,103,211,0.55) !important;
  box-shadow: 0 0 0 3px rgba(0,103,211,0.12), var(--shadow-hover);
}

/* ─── COMPARAR LICENCIATURAS ─────────────────────────────── */
.cmp {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.cmp-col {
  background: var(--glass-card);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: var(--radius-xl);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}
.cmp-col-active {
  border-color: rgba(0,103,211,0.45);
  box-shadow: 0 0 0 3px rgba(0,103,211,0.1), var(--shadow-card);
}
.cmp-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 4px;
}
.cmp-sub { font-size: 11px; color: var(--text-tertiary); margin-bottom: 14px; }
.cmp-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.cmp-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: var(--radius-md);
  padding: 9px 11px;
  line-height: 1.3;
}
.cmp-list em {
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.btn-cmp-go {
  margin-top: 14px;
  padding: 8px 14px;
  background: rgba(0,103,211,0.07);
  color: var(--primary);
  border: 1px solid rgba(0,103,211,0.18);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-cmp-go:hover { background: rgba(0,103,211,0.14); }
.cmp-here {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.cmp-shared {
  margin-top: 18px;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.cmp-shared-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.cmp-shared-title i { color: var(--primary); font-size: 18px; }
.cmp-shared-sub { font-size: 12px; color: var(--text-tertiary); line-height: 1.55; }

/* ─── PANEL DERECHO ──────────────────────────────────────── */
.right-panel {
  width: 310px;
  flex-shrink: 0;
  padding: 20px 16px 24px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rp-card {
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.75);
  border-radius: var(--radius-2xl);
  padding: 22px 20px 18px;
  box-shadow: 0 8px 32px rgba(0,103,211,0.1), 0 1px 4px rgba(0,0,0,0.04);
}
.rp-header { margin-bottom: 16px; }
.rp-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 3px;
  line-height: 1.25;
}
.rp-sub { font-size: 12px; color: var(--text-tertiary); }

.rp-stats {
  display: flex;
  gap: 10px;
  background: rgba(255,255,255,0.38);
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 20px;
  padding: 16px 12px;
  margin-bottom: 16px;
}
.rp-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.rp-stat b {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--primary);
}
.rp-stat:last-child b { color: var(--secondary); }
.rp-stat span {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: rgba(0,103,211,0.65);
}
.rp-stat:last-child span { color: rgba(72,94,137,0.65); }

.rp-bars-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.55px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
  line-height: 1.4;
}
/* Separador entre el bloque híbrido y el de 100% a distancia. */
.rp-bars + .rp-bars {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.rp-bar { margin-bottom: 10px; }
.rp-bar:last-child { margin-bottom: 0; }
.rp-bar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
.rp-bar-label em {
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
}
.rp-bar-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(0,0,0,0.055);
  overflow: hidden;
}
.rp-bar-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.rp-bar-track i.mtag-mac   { background: #d97706; }
.rp-bar-track i.mtag-linea { background: #0b6a52; }
.rp-bar-track i.mtag-semi  { background: #4a3aa8; }

/* ─── ASESORÍA DE CARRERA ────────────────────────────────── */
.advisory-card {
  background: linear-gradient(135deg, rgba(0,103,211,0.11) 0%, rgba(72,94,137,0.07) 100%);
  border: 1px solid rgba(0,103,211,0.18);
  border-radius: var(--radius-xl);
  padding: 18px 16px;
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}
.advisory-card::after {
  content: '\ea61'; /* ti-school-like decoration */
  font-family: 'tabler-icons';
  position: absolute;
  right: -12px; bottom: -14px;
  font-size: 72px;
  color: rgba(0,103,211,0.05);
  pointer-events: none;
}
.advisory-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 7px;
  display: flex; align-items: center; gap: 7px;
}
.advisory-body {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 13px;
}
.btn-advisory {
  display: inline-block;
  padding: 7px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,103,211,0.28);
  transition: background 0.15s;
  position: relative;
}
.btn-advisory:hover { background: #0054b3; }

/* ─── MODAL ──────────────────────────────────────────────── */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-bg.open { display: flex; }
.modal {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.75);
  border-radius: var(--radius-2xl);
  width: 540px;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,103,211,0.16), 0 2px 8px rgba(0,0,0,0.06);
}
.modal-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex; align-items: flex-start; gap: 12px;
  flex-shrink: 0;
}
.modal-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: rgba(0,103,211,0.1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.modal-icon i { font-size: 19px; color: var(--primary); }
.modal-title-wrap { flex: 1; min-width: 0; }
.modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.06);
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
  align-self: flex-start;
}
.modal-close:hover { background: rgba(0,0,0,0.12); color: var(--text); }
.modal-title { font-size: 14px; font-weight: 700; line-height: 1.3; }
.modal-code  { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.modal-code:empty { display: none; }
.modal-body  { padding: 18px 22px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-row   { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
.modal-row > div { min-width: 0; }
.modal-slabel {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.55px;
  color: var(--text-tertiary);
  margin-bottom: 3px;
}
.modal-mods { display: flex; gap: 4px; flex-wrap: wrap; }
.modal-desc {
  font-size: 13px;
  color: var(--text);
  line-height: 1.65;
}
.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex; gap: 8px; justify-content: flex-end;
  align-items: center; flex-wrap: wrap;
  flex-shrink: 0;
}

/* Materia previa */
.modal-prereq {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.45;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 14px;
}
.modal-prereq i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.prereq-warn { background: rgba(255,248,225,0.95); border: 1px solid rgba(249,168,37,0.5); color: #5d4037; }
.prereq-ok   { background: rgba(232,245,233,0.95); border: 1px solid rgba(67,160,71,0.4); color: #1b5e20; }
.prereq-label { font-weight: 700; margin-right: 3px; }
.prereq-code  { opacity: 0.55; font-size: 10.5px; margin-left: 4px; }
.prereq-link {
  font: inherit;
  font-weight: 600;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prereq-link:hover { color: var(--primary); }

/* Temario */
.modal-temas { margin-top: 12px; }
.temas-list  { margin: 6px 0 0; padding-left: 18px; list-style: decimal; }
.temas-list li {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  padding: 3px 0;
}

/* Te abre paso a */
.modal-nexts:not(:empty) { margin-top: 16px; }
.nexts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.nexts button {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: var(--primary);
  background: rgba(0,103,211,0.07);
  border: 1px solid rgba(0,103,211,0.18);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s;
}
.nexts button:hover { background: rgba(0,103,211,0.14); }

/* Botones del pie del modal */
.btn-route {
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  transition: background 0.15s;
}
.btn-route:hover { background: #0054b3; }
.btn-cancel {
  padding: 8px 14px;
  background: none;
  border: 1px solid rgba(0,0,0,0.14);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-secondary);
}
.btn-cancel:hover { background: rgba(0,0,0,0.04); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1180px) {
  .right-panel { width: 280px; }
  .lic-grid { gap: 14px; }
}

/* El panel derecho pasa a ser una sección más del contenido. */
@media (max-width: 1040px) {
  .lic-layout { flex-direction: column; overflow-y: auto; }
  .content { overflow: visible; flex: 0 0 auto; padding-bottom: 8px; }
  .right-panel {
    width: auto;
    overflow: visible;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0 24px 32px;
  }
  .right-panel > * { flex: 1 1 280px; }
  .cmp { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .lic-grid { grid-template-columns: 1fr; }
  .home-title { max-width: none; }
}

/* Barra lateral como cajón deslizante. */
@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 8px 0 40px rgba(0,103,211,0.14);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(15,23,42,0.28);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  body.sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }

  .topbar { left: 0; padding: 0 16px; }
  .menu-toggle { display: flex; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 7px 12px 6px; font-size: 14px; }

  .main-wrapper { left: 0; }
  .content { padding: 22px 16px 24px; }
  .right-panel { padding: 0 16px 28px; }
}

@media (max-width: 680px) {
  .mgrid { grid-template-columns: 1fr; }
  .home { padding: 24px 16px 56px; }
  .home-top { margin-bottom: 36px; }
  .eje-hdr h2 { font-size: 23px; }
  .route-col { flex: 1 0 220px; }

  /* El modal se comporta como una hoja inferior. */
  .modal-bg { padding: 0; align-items: flex-end; }
  .modal {
    width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  }
  .modal-foot .btn-route { flex: 1; justify-content: center; }
  .modal-foot .btn-cancel { display: none; }
}
