:root {
  --bg: #f7f9fc;
  --fg: #0f1e3d;
  --muted: #64748b;
  --card: #ffffff;
  --border: #e2e8f0;
  --primary: #0a2b5c;
  --primary-soft: #1e5bb8;
  --primary-glow: #3fa9f5;
  --accent: #e6f0fb;
  --secondary: #eef3fa;
  --shadow: 0 20px 50px -25px rgba(10, 43, 92, 0.45);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* HERO */
.hero {
  background: linear-gradient(135deg, #0a2b5c, #1e5bb8 55%, #3fa9f5);
  color: #fff;
  padding: 64px 0 56px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  opacity: 0.18;
  background-image:
    radial-gradient(circle at 20% 30%, #fff 1px, transparent 1px),
    radial-gradient(circle at 70% 60%, #fff 1px, transparent 1px);
  background-size: 60px 60px, 90px 90px;
}
.hero .container { position: relative; }
.eyebrow {
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  opacity: 0.85; margin-bottom: 16px;
}
.hero h1 { margin: 0; font-size: clamp(32px, 5vw, 56px); font-weight: 700; line-height: 1.1; }
.hero h1 .accent { color: #a8d4f7; }
.lead { margin-top: 16px; font-size: 18px; max-width: 620px; opacity: 0.92; }

.stats {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stat {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: var(--radius);
  padding: 16px;
  backdrop-filter: blur(8px);
}
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 4px; }
@media (max-width: 600px) { .stats { grid-template-columns: 1fr; } }

/* MAIN */
.main { padding: 40px 24px 80px; }

.step-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--primary);
  margin: 0 0 8px;
}
.step-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 28px; margin-bottom: 8px; gap: 12px; flex-wrap: wrap;
}
.period-info { font-size: 12px; color: var(--muted); }

/* TABS */
.tabs {
  display: flex; gap: 8px; background: var(--secondary);
  padding: 8px; border-radius: var(--radius); flex-wrap: wrap;
}
.tab {
  flex: 1; min-width: 140px;
  padding: 12px 16px;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--fg);
  font-weight: 600; font-size: 14px;
  cursor: pointer; transition: all 0.15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.tab:hover { background: rgba(10, 43, 92, 0.06); }
.tab.active { background: var(--primary); color: #fff; box-shadow: var(--shadow); }

/* PERIODOS */
.period-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.period {
  padding: 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--card);
  cursor: pointer; text-align: left; transition: all 0.15s;
  font-family: inherit;
}
.period:hover { border-color: var(--primary-soft); background: var(--accent); }
.period.active {
  background: var(--primary); color: #fff;
  border-color: var(--primary); box-shadow: var(--shadow);
}
.period-label { font-size: 22px; font-weight: 700; color: var(--primary); }
.period.active .period-label { color: #fff; }
.period-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.period.active .period-sub { color: rgba(255,255,255,0.85); }
.period-count {
  display: inline-block; margin-top: 10px;
  background: var(--secondary); color: var(--primary);
  padding: 2px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.period.active .period-count { background: rgba(255,255,255,0.22); color: #fff; }

/* PLACEHOLDER */
.placeholder {
  border: 1px dashed rgba(10, 43, 92, 0.3);
  background: var(--accent);
  border-radius: 16px;
  padding: 56px 24px;
  text-align: center;
  margin-top: 8px;
}
.placeholder-icon {
  width: 56px; height: 56px; margin: 0 auto 12px;
  background: rgba(10, 43, 92, 0.1);
  color: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.placeholder h3 { margin: 8px 0; font-size: 18px; }
.placeholder p { margin: 0 auto; max-width: 480px; color: var(--muted); font-size: 14px; }

/* FILTROS */
.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
@media (max-width: 700px) { .filters { grid-template-columns: 1fr; } }
.search { position: relative; }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted);
}
input[type="text"], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: var(--fg);
}
.search input { padding-left: 36px; }
input[type="text"]:focus, select:focus {
  outline: 2px solid var(--primary-soft); outline-offset: 1px; border-color: transparent;
}

/* SEMESTRES */
.hidden { display: none !important; }
.empty {
  border: 1px dashed var(--border);
  padding: 40px 16px; text-align: center;
  color: var(--muted); border-radius: var(--radius);
}
.semestre { margin-bottom: 32px; }
.semestre-title {
  font-size: 22px; font-weight: 700; color: var(--primary);
  margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

/* ACCORDION (sección/ciclo) */
.acc-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px; overflow: hidden;
}
.acc-trigger {
  width: 100%; text-align: left; padding: 14px 16px;
  background: transparent; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; font: inherit;
}
.acc-trigger:hover { background: var(--accent); }
.acc-item.open .acc-trigger {
  background: var(--accent);
  border-left: 4px solid var(--primary);
  padding-left: 12px;
}
.acc-title {
  font-size: 14px; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.acc-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.acc-badge {
  display: inline-block; padding: 2px 10px;
  border: 1px solid rgba(10, 43, 92, 0.3); color: var(--primary);
  border-radius: 999px; font-weight: 700; font-size: 11px;
}
.acc-chevron { transition: transform 0.2s; color: var(--muted); }
.acc-item.open .acc-chevron { transform: rotate(180deg); }
.acc-content { padding: 8px 16px 16px; display: none; }
.acc-item.open .acc-content { display: block; }

/* ITEM ROW */
.item {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border: 1px solid var(--border);
  background: var(--card); border-radius: 10px; margin-bottom: 8px;
}
.item.en-curso {
  border-color: rgba(10, 43, 92, 0.4);
  box-shadow: 0 0 0 3px rgba(63, 169, 245, 0.12);
}
.item-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--primary-soft);
}
.badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border); display: inline-flex; gap: 4px; align-items: center;
}
.badge.en-curso { background: rgba(63,169,245,0.18); color: var(--primary); border-color: rgba(63,169,245,0.4); }
.badge.proximo { color: var(--primary); border-color: rgba(10,43,92,0.3); }
.badge.finalizado { color: var(--muted); }
.item-act { font-size: 14px; font-weight: 600; }
.item-dates {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 13px;
}
.item-date-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.item-date-value { font-weight: 600; }
@media (min-width: 720px) {
  .item { flex-direction: row; align-items: center; justify-content: space-between; }
  .item-dates { width: 320px; flex-shrink: 0; }
}

/* FOOTER */
footer {
  margin-top: 64px; padding: 32px 0;
  background: rgba(238, 243, 250, 0.6);
  border-top: 1px solid var(--border);
  font-size: 14px; color: var(--muted);
}
footer .muted { margin-top: 8px; }
