/* =========================================================================
   El Pilar Extraescolares — App styles
   ========================================================================= */
@import url("colors_and_type.css");

html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
* { box-sizing: border-box; }
button, input, select, textarea { font-family: inherit; }

#root { min-height: 100vh; }

/* ====================== APP CHROME ====================== */
.app-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.app-header .row {
  max-width: 1500px; margin: 0 auto;
  padding: 14px 32px;
  display: flex; align-items: center; gap: 32px;
}
.app-header .brand {
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; text-decoration: none; color: inherit;
}
.app-header .brand img { height: 44px; display: block; }
.app-header .brand .crumb {
  border-left: 1px solid var(--line);
  padding-left: 14px;
  font-family: var(--font-headline);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.3;
}
.app-header .brand .crumb strong { display: block; color: var(--ink); font-weight: 700; }
.app-header nav {
  display: flex; gap: 4px;
  margin-left: auto;
  font-family: var(--font-headline);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.app-header nav button {
  background: transparent;
  border: 0;
  padding: 10px 14px;
  color: var(--ink-2);
  cursor: pointer;
  letter-spacing: inherit;
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  text-transform: inherit;
  position: relative;
  transition: color 120ms;
}
.app-header nav button:hover { color: var(--brand-blue); }
.app-header nav button.active { color: var(--brand-blue); }
.app-header nav button.active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 2px; background: var(--brand-blue);
}
.app-header .curso-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--ink-2);
}
.app-header .curso-pill .dot { width: 7px; height: 7px; background: var(--brand-green); border-radius: 50%; }

/* ====================== PAGE LAYOUT ====================== */
.page {
  max-width: 1500px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

/* ====================== HERO / TITLE ====================== */
.page-hero {
  padding: 48px 0 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.page-hero .eyebrow {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--brand-blue);
}
.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(38px, 4.5vw, 56px);
  text-transform: uppercase;
  letter-spacing: -.005em;
  line-height: 1;
  margin: 14px 0 16px;
  color: var(--ink);
}
.page-hero .lead {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink-2);
  max-width: none;
  margin: 0;
}

/* ====================== FILTER BAR ====================== */
.filterbar {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 73px;
  z-index: 40;
}
.filterbar .row {
  max-width: 1500px; margin: 0 auto;
  padding: 14px 32px;
  display: flex; align-items: center; gap: 18px;
  flex-wrap: wrap;
}
.filterbar .row-etapa {
  padding: 16px 24px 14px;
  border-bottom: 1px dashed var(--line);
  justify-content: center;
  gap: 14px;
}
.filterbar .row-second {
  padding: 12px 24px;
  justify-content: center;
  gap: 18px;
  row-gap: 10px;
}
.filterbar .row-second .group { gap: 6px; }
.filterbar .results {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
}
.filterbar .results strong { color: var(--ink); font-weight: 700; }
.filterbar .results strong { color: var(--ink); font-weight: 700; }
.filterbar .clear {
  background: transparent; border: 0;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  padding: 0;
}
.filterbar .clear:hover { color: var(--brand-blue); }
.filterbar .group {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.filterbar .group-label {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 120ms;
  white-space: nowrap;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.chip.active.cat { color: #fff; }
.chip .x {
  margin-left: 2px;
  opacity: .7;
  font-size: 14px;
  line-height: 1;
}
.filterbar .results {
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-3);
}
.filterbar .results strong { color: var(--ink); font-weight: 700; }
.filterbar .clear {
  background: transparent; border: 0;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
}
.filterbar .clear:hover { color: var(--brand-blue); }

.etapa-filter {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 2px;
}
.etapa-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  flex-shrink: 0;
}
.etapa-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  background: var(--surface-2);
  border: 0;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all 120ms;
  white-space: nowrap;
}
.etapa-pill .check {
  width: 13px; height: 13px;
  background: #fff;
  border: 1.5px solid var(--line-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  flex-shrink: 0;
}
.etapa-pill .check .dash {
  width: 7px; height: 2px;
  background: #fff;
}
.etapa-pill.state-all {
  background: var(--ink);
  color: #fff;
}
.etapa-pill.state-all .check { background: #fff; border-color: #fff; color: var(--ink); }
.etapa-pill.state-partial {
  background: var(--ink);
  color: #fff;
}
.etapa-pill.state-partial .check { background: var(--ink-3); border-color: var(--ink-3); }
.etapa-pill:hover { background: var(--surface-3); }
.etapa-pill.state-all:hover, .etapa-pill.state-partial:hover { background: var(--ink-2); }
.curso-pill {
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--line-2);
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-2);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all 120ms;
  min-width: 30px;
  text-align: center;
  white-space: nowrap;
}
.curso-pill:hover { border-color: var(--ink); color: var(--ink); }
.curso-pill.active {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}
.curso-pill.active:hover { background: var(--brand-blue-deep); }

@media (max-width: 1100px) {
  .etapa-filter-group { gap: 4px; padding: 3px 10px 3px 3px; }
  .etapa-pill { padding: 6px 10px; font-size: 10px; }
  .curso-pill { padding: 4px 8px; font-size: 11px; min-width: 26px; }
}

/* ====================== CARDS ====================== */
.cards-grid {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}
.cards-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cards-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cards-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card-act {
  background: #fff;
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  cursor: pointer;
  transition: transform 180ms var(--ease-out), border-color 180ms, box-shadow 180ms;
  text-decoration: none; color: inherit;
  position: relative;
  overflow: hidden;
}
.card-act:hover {
  transform: translateY(-3px);
  border-color: var(--ink-3);
  box-shadow: var(--shadow-2);
}
.card-act .cat-bar { height: 4px; background: var(--cat-color, var(--brand-blue)); }
.card-act .img { aspect-ratio: 16/10; background: var(--cat-tint, var(--surface-3)); position: relative; overflow: hidden; }
.card-act .img image-slot { display: block; width: 100%; height: 100%; }
.card-act .img .placeholder-emoji {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 64px;
  color: var(--cat-color, var(--brand-blue));
  opacity: .25;
  text-transform: uppercase;
  letter-spacing: -.02em;
}
.card-act .body {
  padding: 18px 20px 20px;
  display: flex; flex-direction: column; gap: 8px;
  flex: 1;
}
.card-act .cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  align-self: flex-start;
  padding: 4px 10px;
  background: var(--cat-tint, var(--surface-3));
  color: var(--cat-color, var(--brand-blue));
  border-radius: var(--r-pill);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.card-act .cat-chip .dot { width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.card-act h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -.01em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 4px 0 0;
}
.card-act .summary {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0;
  flex: 1;
}
.card-act .meta-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 4px;
}
.card-act .meta {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .02em;
}
.card-act .meta svg { width: 11px; height: 11px; }
.card-act .badge-novedad {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--ink);
  color: #fff;
  padding: 4px 8px;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  z-index: 2;
}
.card-act .footer-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.card-act .cta {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px;
}
.card-act:hover .cta { color: var(--brand-blue); }

/* ----- color-mode variations ----- */
.cards-grid.cat-marcado .card-act {
  background: var(--cat-tint);
  border-color: transparent;
}
.cards-grid.cat-marcado .card-act .cat-chip {
  background: #fff;
}
.cards-grid.cat-marcado .card-act .meta {
  background: rgba(255,255,255,.6);
  border-color: transparent;
}
.cards-grid.cat-marcado .card-act .footer-row { border-top-color: rgba(0,0,0,.08); }

.cards-grid.cat-off .card-act .cat-bar { display: none; }
.cards-grid.cat-off .card-act .cat-chip {
  background: var(--surface-2);
  color: var(--ink-3);
}
.cards-grid.cat-off .card-act .img { background: var(--surface-3); }
.cards-grid.cat-off .card-act .img .placeholder-emoji { color: var(--ink-4); }

/* density */
.cards-grid.density-compact .card-act .body { padding: 14px 16px 16px; gap: 6px; }
.cards-grid.density-compact .card-act h3 { font-size: 20px; }
.cards-grid.density-compact .card-act .summary { font-size: 13px; }
.cards-grid.density-compact .card-act .img { aspect-ratio: 16/8; }

.cards-grid.density-roomy .card-act .body { padding: 24px 26px 26px; gap: 12px; }
.cards-grid.density-roomy .card-act h3 { font-size: 28px; }

/* ====================== EMPTY STATE ====================== */
.empty {
  text-align: center;
  padding: 80px 24px;
  border: 1px dashed var(--line-2);
  background: var(--surface-2);
}
.empty h3 {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  margin: 0 0 8px;
}
.empty p { color: var(--ink-3); font-size: 15px; margin: 0; }

/* ====================== ACTIVITY DETAIL ====================== */
.detail-hero {
  background: linear-gradient(180deg, var(--cat-tint, var(--surface-2)) 0%, #fff 100%);
  padding: 32px 0 0;
  border-bottom: 1px solid var(--line);
}
.detail-hero .inner {
  max-width: 1500px; margin: 0 auto;
  padding: 0 32px;
}
.back-link {
  background: transparent; border: 0;
  padding: 0;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 20px;
}
.back-link:hover { color: var(--brand-blue); }
.detail-hero .head-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: end;
  padding-bottom: 32px;
}
.detail-hero .text .cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: #fff;
  color: var(--cat-color, var(--brand-blue));
  border-radius: var(--r-pill);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.detail-hero .text .cat-chip .dot { width: 7px; height: 7px; background: currentColor; border-radius: 50%; }
.detail-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(44px, 5.5vw, 76px);
  line-height: .95;
  letter-spacing: -.01em;
  text-transform: uppercase;
  margin: 16px 0 16px;
  color: var(--ink);
}
.detail-hero .summary {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 600px;
  margin: 0;
}
.detail-hero .photo {
  aspect-ratio: 5/4;
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,.5);
}
.detail-hero .photo image-slot { width: 100%; height: 100%; display: block; }
.detail-hero .badge-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.badge.pendiente { background: var(--warning); }
.badge.novedad { background: var(--brand-blue); }

.detail-body {
  max-width: 1500px;
  margin: 0 auto;
  padding: 48px 32px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 44px;
  align-items: start;
}
.detail-body section + section { margin-top: 40px; }
.detail-body h2 {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 14px;
}
.detail-body p {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
  margin: 0 0 14px;
}
.detail-body .objetivos-list {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  gap: 10px;
}
.detail-body .objetivos-list li {
  padding-left: 26px;
  position: relative;
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink-2);
}
.detail-body .objetivos-list li::before {
  content: ''; position: absolute;
  left: 0; top: 9px;
  width: 14px; height: 2px;
  background: var(--cat-color, var(--brand-blue));
}

/* ----- Subficha tabs ----- */
.subtabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  overflow-x: auto;
}
.subtabs button {
  background: transparent; border: 0;
  padding: 14px 18px;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color 120ms;
}
.subtabs button:hover { color: var(--ink); }
.subtabs button.active { color: var(--ink); }
.subtabs button.active::after {
  content: ''; position: absolute;
  left: 18px; right: 18px; bottom: -1px;
  height: 3px;
  background: var(--cat-color, var(--brand-blue));
}

.sub-content {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 24px 28px;
}
.sub-content .sub-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: -.005em;
  margin: 0 0 14px;
  color: var(--ink);
}

/* ----- Datos table (aside) ----- */
.aside-card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 26px 26px 28px;
  position: sticky;
  top: 200px;
}
.aside-card h2 {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 16px;
}
.kv {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 14px;
  align-items: start;
}
.kv:last-child { border-bottom: 0; }
.kv .k {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 2px;
}
.kv .v { color: var(--ink); line-height: 1.5; }
.kv .v ul { margin: 0; padding-left: 16px; }
.kv .v ul li { line-height: 1.55; }

.cta-inscribir {
  margin-top: 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 22px;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: all 120ms;
  text-decoration: none;
  line-height: 1;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--brand-blue-deep); }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--line-2); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-sm { padding: 9px 14px; font-size: 11px; }
.btn-ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

.aside-card .note {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.5;
  margin-top: 12px;
}

/* ====================== HORARIO ====================== */
.horario-wrap {
  margin-top: 16px;
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
}
.horario-table {
  display: grid;
  grid-template-columns: 100px repeat(5, 1fr);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.horario-table .h-cell {
  padding: 14px 14px;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}
.horario-table .h-cell:last-child { border-right: 0; }
.horario-table .h-cell.time { color: var(--ink-3); }

.horario-row {
  display: grid;
  grid-template-columns: 100px repeat(5, 1fr);
  border-bottom: 1px solid var(--line);
  min-height: 80px;
}
.horario-row:last-child { border-bottom: 0; }
.horario-row .time-label {
  padding: 14px 12px;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 11px;
  color: var(--ink);
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  gap: 4px;
}
.horario-row .time-label .franja-tag {
  font-size: 9px;
  letter-spacing: .14em;
  color: var(--ink-3);
  font-weight: 500;
}
.horario-row .slot {
  border-right: 1px solid var(--line);
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.horario-row .slot:last-child { border-right: 0; }

.h-block {
  background: var(--cat-tint, var(--surface-2));
  border-left: 3px solid var(--cat-color, var(--brand-blue));
  padding: 8px 10px;
  cursor: pointer;
  transition: transform 120ms;
}
.h-block:hover { transform: translateY(-1px); }
.h-block .h-title {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 12px;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 3px;
}
.h-block .h-sub {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.3;
}
.h-block .h-time {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  color: var(--cat-color, var(--brand-blue));
  letter-spacing: .04em;
  margin-top: 4px;
}
.h-band-header {
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.h-band-header .icon { display: inline-flex; }

/* ====================== ADMIN ====================== */
.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 73px);
  background: var(--surface-2);
}
.admin-side {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 24px 0;
  position: sticky;
  top: 73px;
  height: calc(100vh - 73px);
  overflow-y: auto;
}
.admin-side h4 {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 18px 24px 8px;
}
.admin-side a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 24px;
  color: var(--ink-2);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 120ms;
}
.admin-side a:hover { background: var(--surface-2); color: var(--ink); }
.admin-side a.active {
  border-left-color: var(--brand-blue);
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 700;
}
.admin-side .curso-switcher {
  margin: 8px 16px 16px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.admin-side .curso-switcher .lbl {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.admin-side .curso-switcher select {
  width: 100%;
  margin-top: 6px;
  padding: 8px 8px;
  border: 1px solid var(--line-2);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}
.admin-side .pub-status {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-3);
}
.admin-side .pub-status .dot { width: 7px; height: 7px; background: var(--success); border-radius: 50%; }
.admin-side .pub-status.draft .dot { background: var(--warning); }

.admin-main {
  padding: 32px 40px 80px;
  max-width: 1280px;
  min-width: 0;
}
.admin-main .page-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.admin-main .page-title h1 {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 28px;
  margin: 0;
  letter-spacing: -.005em;
}
.admin-main .page-title .sub {
  color: var(--ink-3);
  font-size: 14px;
  margin-top: 4px;
}

.admin-table {
  background: #fff;
  border: 1px solid var(--line);
}
.admin-table .head, .admin-table .row {
  display: grid;
  grid-template-columns: 32px 2.2fr 1.2fr 1fr 1fr 0.8fr 90px;
  gap: 12px;
  padding: 14px 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.admin-table .row:last-child { border-bottom: 0; }
.admin-table .head {
  background: var(--surface-2);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.admin-table .row:hover { background: var(--surface-2); }
.admin-table .row .name {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}
.admin-table .row .sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}
.admin-table .row input[type="checkbox"] { accent-color: var(--brand-blue); }
.admin-table .row .cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  background: var(--cat-tint);
  color: var(--cat-color);
  border-radius: var(--r-pill);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.admin-table .row .cat-chip .dot { width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.admin-table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.admin-table .icon-btn {
  width: 28px; height: 28px;
  background: transparent; border: 1px solid var(--line);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  transition: all 120ms;
}
.admin-table .icon-btn:hover { color: var(--ink); border-color: var(--ink); }
.admin-table .pub-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px;
  font-weight: 700;
}
.admin-table .pub-toggle .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.admin-table .pub-toggle.off { color: var(--ink-4); }
.admin-table .pub-toggle.off .dot { background: var(--line-2); }

.bulk-bar {
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 16px;
  font-size: 13px;
}
.bulk-bar .count { font-family: var(--font-headline); font-weight: 700; letter-spacing: .04em; }
.bulk-bar .actions { margin-left: auto; display: flex; gap: 8px; }
.bulk-bar button {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  padding: 6px 12px;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
}
.bulk-bar button:hover { background: rgba(255,255,255,.22); }
.bulk-bar button.primary { background: var(--brand-blue); border-color: var(--brand-blue); }
.bulk-bar button.primary:hover { background: var(--brand-blue-deep); border-color: var(--brand-blue-deep); }

.admin-toolbar {
  display: flex; gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}
.admin-toolbar .search {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  background: #fff;
  font-size: 14px;
}
.admin-toolbar .search:focus { outline: none; border-color: var(--ink); }
.admin-toolbar select {
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  background: #fff;
  font-size: 14px;
}

/* ====================== CONDICIONES & FAQ ====================== */
.prose {
  max-width: 800px;
  margin: 0 auto;
}
.prose h2 {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--brand-blue);
  margin: 48px 0 16px;
}
.prose .item {
  border-top: 1px solid var(--line);
  padding: 22px 0;
}
.prose .item h3 {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 8px;
  color: var(--ink);
  letter-spacing: 0;
}
.prose .item .body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
}
.prose .item .body ul { padding-left: 22px; margin: 8px 0; }
.prose .item .body li { margin: 4px 0; }

.faq-item {
  border-bottom: 1px solid var(--line);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 22px 0;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .arrow {
  width: 28px; height: 28px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 200ms;
  color: var(--ink-3);
}
.faq-item[open] summary .arrow {
  transform: rotate(180deg);
  border-color: var(--ink);
  color: var(--ink);
}
.faq-item .answer {
  padding: 0 0 22px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-2);
}
.faq-item .answer ul { padding-left: 22px; }
.faq-item .answer a { color: var(--brand-blue); }

/* ----- Etapa + curso picker ----- */
.etapa-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.etapa-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
}
.etapa-row:last-child { border-bottom: 0; }
.etapa-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid var(--line-2);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  min-width: 132px;
  transition: all 120ms;
}
.etapa-label .check {
  width: 14px; height: 14px;
  border: 1.5px solid var(--line-2);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.etapa-label .check .dash {
  width: 7px; height: 2px;
  background: var(--ink);
}
.etapa-label.state-all {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.etapa-label.state-all .check {
  background: #fff;
  border-color: #fff;
  color: var(--ink);
}
.etapa-label.state-partial {
  background: #fff;
  color: var(--ink);
  border-color: var(--ink-3);
}
.etapa-label.state-partial .check {
  background: var(--ink-3);
  border-color: var(--ink-3);
}
.etapa-label.state-partial .check .dash {
  background: #fff;
}
.etapa-label:hover { border-color: var(--ink); }
.etapa-label .all-tag {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 9px;
  letter-spacing: .04em;
  text-transform: lowercase;
  color: var(--ink-4);
  margin-left: auto;
}
.etapa-label.state-all .all-tag { color: rgba(255,255,255,.6); }

.etapa-row .cursos {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.curso-chip {
  padding: 5px 10px;
  background: #fff;
  border: 1px solid var(--line-2);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  transition: all 120ms;
}
.curso-chip:hover { border-color: var(--ink); color: var(--ink); }
.curso-chip.active {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
}
.curso-chip.active:hover { background: var(--brand-blue-deep); border-color: var(--brand-blue-deep); }

/* ----- View toggle (Detallado / Rápido) ----- */
.view-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 2px;
}
.view-toggle button {
  background: transparent;
  border: 0;
  padding: 6px 12px;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 120ms;
}
.view-toggle button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-1);
}
.view-toggle button:hover:not(.active) { color: var(--ink); }

/* ----- Rapid (Excel-like) table ----- */
.rapid-wrap { margin-top: 8px; }
.rapid-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
}
.rapid-table {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
}
.rapid-table th {
  background: var(--surface-2);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.rapid-table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 13px;
}
.rapid-table .rapid-num {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
  background: var(--surface-2);
}
.rapid-table tbody tr:hover td { background: var(--surface-2); }
.rapid-table tbody tr:hover .rapid-num { background: var(--surface-3); }
.rapid-table input,
.rapid-table select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--ink);
}
.rapid-table input:focus, .rapid-table select:focus {
  outline: none;
  border-color: var(--ink-3);
  background: #fff;
}
.rapid-table .num-input { text-align: center; }
.rapid-summary-btn {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: transparent;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  text-align: left;
  line-height: 1.3;
}
.rapid-summary-btn:hover {
  border-color: var(--line-2);
  background: #fff;
}
.rapid-summary-btn .icon { margin-left: auto; opacity: .5; }
.rapid-summary-btn:hover .icon { opacity: 1; }
.rapid-summary-btn strong { color: var(--ink); margin-right: 4px; }
.rapid-summary-btn .muted { color: var(--ink-4); font-style: italic; }

/* ====================== EDITOR ====================== */
.editor-shell {
  background: var(--surface-2);
  min-height: 100%;
}
.editor-topbar {
  position: sticky;
  top: 73px;
  z-index: 30;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--line);
  padding: 14px 32px;
  display: flex; align-items: center; gap: 24px;
  margin: -32px -40px 24px;
}
.editor-crumb {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-3);
  overflow: hidden;
}
.editor-crumb strong {
  color: var(--ink);
  font-family: var(--font-headline);
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.editor-actions {
  margin-left: auto;
  display: flex; align-items: center; gap: 12px;
}
.editor-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.editor-body.single { max-width: 100%; }
.editor-stack { display: flex; flex-direction: column; gap: 16px; }

.editor-card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 22px 26px 26px;
}
.editor-card .card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.editor-card .card-head > div { flex: 1; min-width: 0; }
.editor-card h2 {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 18px;
  margin: 0;
  letter-spacing: -.005em;
  color: var(--ink);
}
.editor-card .card-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.5;
  font-family: var(--font-body);
}

/* ====================== STATS ROW ====================== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stats-row .stat {
  background: #fff;
  border: 1px solid var(--line);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 3px solid var(--cat-color, var(--brand-blue));
}
.stats-row .stat-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
}
.stats-row .stat-lbl {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ====================== INFO GRID (info + image) ====================== */
.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 32px;
  align-items: start;
}
.info-fields { min-width: 0; }
.info-image {
  display: flex;
  flex-direction: column;
}
.info-image .image-label {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.info-image-slot {
  aspect-ratio: 5/4;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.info-image-slot image-slot {
  display: block;
  width: 100%; height: 100%;
}

/* ====================== BOTTOM GALLERY ====================== */
.bottom-gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.bottom-gallery image-slot {
  display: block;
  aspect-ratio: 1/1;
  background: var(--surface-2);
}

/* ====================== AREA PICKER (in editor) ====================== */
.area-pick {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.area-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 120ms;
}
.area-chip .swatch {
  width: 8px; height: 8px;
  display: inline-block;
}
.area-chip:hover { border-color: var(--ink); }
.area-chip.active .swatch { background: #fff !important; }

/* ----- Char count ----- */
.char-count {
  font-size: 11px;
  color: var(--ink-4);
  text-align: right;
  margin-top: 2px;
}

/* ====================== ETAPA PICKER (editor) ====================== */
.etapa-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.etapa-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
}
.etapa-row:last-child { border-bottom: 0; }
.etapa-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid var(--line-2);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  min-width: 132px;
  transition: all 120ms;
}
.etapa-label .check {
  width: 14px; height: 14px;
  border: 1.5px solid var(--line-2);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.etapa-label .check .dash {
  width: 7px; height: 2px;
  background: var(--ink);
}
.etapa-label.state-all {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.etapa-label.state-all .check {
  background: #fff;
  border-color: #fff;
  color: var(--ink);
}
.etapa-label.state-partial {
  background: #fff;
  color: var(--ink);
  border-color: var(--ink-3);
}
.etapa-label.state-partial .check {
  background: var(--ink-3);
  border-color: var(--ink-3);
}
.etapa-label.state-partial .check .dash {
  background: #fff;
}
.etapa-label:hover { border-color: var(--ink); }
.etapa-label .all-tag {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 9px;
  letter-spacing: .04em;
  text-transform: lowercase;
  color: var(--ink-4);
  margin-left: auto;
}
.etapa-label.state-all .all-tag { color: rgba(255,255,255,.6); }

.etapa-row .cursos {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.curso-chip {
  padding: 5px 10px;
  background: #fff;
  border: 1px solid var(--line-2);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  transition: all 120ms;
}
.curso-chip:hover { border-color: var(--ink); color: var(--ink); }
.curso-chip.active {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
}

/* ====================== VIEW TOGGLE ====================== */
.view-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 2px;
}
.view-toggle button {
  background: transparent;
  border: 0;
  padding: 6px 12px;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 120ms;
}
.view-toggle button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-1);
}
.view-toggle button:hover:not(.active) { color: var(--ink); }

/* ====================== RAPID GRUPOS (2-row card list) ====================== */
.rapid-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.rapid-headers {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 0 8px;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.rapid-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--cat-color, var(--brand-blue));
  transition: box-shadow 120ms;
}
.rapid-card:hover { box-shadow: var(--shadow-1); }
.rapid-card.is-expanded {
  box-shadow: var(--shadow-2);
}
.rapid-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
}
.rapid-line.line-2 {
  padding-top: 0;
  padding-bottom: 10px;
}
.rapid-line.line-3 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 16px 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.rapid-num {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 11px;
  color: var(--ink-3);
  width: 24px;
  text-align: center;
  background: var(--surface-2);
  padding: 4px 0;
  flex-shrink: 0;
}
.rapid-etiqueta {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid transparent;
  background: transparent;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  min-width: 100px;
}
.rapid-etiqueta:hover { border-color: var(--line); }
.rapid-etiqueta:focus { outline: none; border-color: var(--ink-3); background: #fff; }

.rapid-cell {
  position: relative;
}
.rapid-cell input,
.rapid-cell select {
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink);
  min-width: 140px;
}
.rapid-cell.narrow input { min-width: 0; width: 56px; text-align: center; }
.rapid-cell select { min-width: 160px; }
.rapid-cell input:focus,
.rapid-cell select:focus { outline: none; border-color: var(--ink); }

.rapid-card .expand-btn {
  transition: transform 200ms;
}
.rapid-card.is-expanded .expand-btn {
  transform: rotate(180deg);
}

/* Summaries (line 2) */
.rapid-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding: 6px 12px 6px 30px;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  text-align: left;
  transition: all 120ms;
  line-height: 1.3;
}
.rapid-summary .lbl {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-4);
  flex-shrink: 0;
}
.rapid-summary .val {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rapid-summary .val strong { color: var(--ink); margin-right: 4px; }
.rapid-summary .val .muted { color: var(--ink-4); font-style: italic; }
.rapid-summary .icon { color: var(--ink-4); flex-shrink: 0; }
.rapid-summary:hover {
  border-color: var(--ink-3);
  border-style: solid;
  background: #fff;
  color: var(--ink);
}
.rapid-summary:hover .icon { color: var(--ink); }

.rapid-half {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.rapid-mini-label {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ====================== GRUPO CARD (detallado) ====================== */
.grupo-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-top: 16px;
}
.grupo-card-head {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.grupo-num {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cat-color, var(--brand-blue));
  background: var(--cat-tint, var(--surface-2));
  padding: 4px 10px;
  white-space: nowrap;
}
.grupo-title {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 16px;
  padding: 6px 0;
  color: var(--ink);
}
.grupo-title:focus {
  outline: none;
  border-bottom: 2px solid var(--cat-color, var(--brand-blue));
}
.grupo-card-body {
  padding: 18px 22px 22px;
  display: flex; flex-direction: column; gap: 14px;
}

/* ====================== HORARIOS EDITOR ====================== */
.horarios-section {
  background: #fff;
  border: 1px solid var(--line);
  padding: 14px 16px 16px;
}
.horarios-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.horarios-label {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.horario-row-edit {
  display: grid;
  grid-template-columns: 120px 1fr 16px 1fr 1fr 36px;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}
.horario-row-edit:last-of-type { border-bottom: 0; }
.horario-row-edit select,
.horario-row-edit input {
  padding: 7px 10px;
  border: 1px solid var(--line-2);
  background: #fff;
  font-size: 13px;
  font-family: var(--font-body);
}
.horario-row-edit .dash {
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
}
.horario-empty {
  padding: 14px;
  text-align: center;
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 13px;
  border: 1px dashed var(--line-2);
  margin-bottom: 10px;
}

/* ====================== STRING/LINKS LIST ====================== */
.string-list { display: flex; flex-direction: column; gap: 8px; }
.sl-row, .link-row {
  display: grid;
  gap: 8px;
  align-items: center;
}
.sl-row { grid-template-columns: 1fr 32px; }
.link-row { grid-template-columns: 1fr 1fr 32px; }
.sl-row input, .link-row input {
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  background: #fff;
  font-size: 13px;
  font-family: var(--font-body);
}

.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }

/* ====================== PUB SWITCH ====================== */
.pub-switch {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer;
  user-select: none;
}
.pub-switch input { display: none; }
.pub-switch .track {
  width: 36px; height: 20px;
  background: var(--line-2);
  border-radius: 999px;
  position: relative;
  transition: background 120ms;
}
.pub-switch .track::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: left 120ms;
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.pub-switch input:checked + .track { background: var(--success); }
.pub-switch input:checked + .track::after { left: 18px; }
.pub-switch .lbl {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ====================== ORDEN CONTROLS (cond/faq) ====================== */
.orden-controls { display: flex; align-items: center; gap: 4px; }
.orden-num {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-3);
  width: 28px; text-align: center;
}
.orden-controls .icon-btn { width: 24px; height: 24px; }
.orden-controls .icon-btn:first-of-type svg { transform: rotate(180deg); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ====================== COBRO INPUT ====================== */
.cobro-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid transparent;
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.cobro-input:focus {
  outline: none;
  border-color: var(--ink-3);
  background: #fff;
}
.cobro-input:hover { border-color: var(--line); }

/* ====================== RICH TEXT EDITOR ====================== */
.rte {
  border: 1px solid var(--line-2);
  background: #fff;
}
.rte-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.rte-toolbar button {
  width: 28px; height: 28px;
  background: transparent;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 120ms;
}
.rte-toolbar button:hover {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}
.rte-toolbar .sep {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 4px;
}
.rte-content {
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  min-height: 120px;
  outline: none;
}
.rte-content:empty::before {
  content: attr(data-placeholder);
  color: var(--ink-4);
  pointer-events: none;
}
.rte-content ul, .rte-content ol { padding-left: 24px; margin: 8px 0; }
.rte-content li { margin: 2px 0; }
.rte-content a { color: var(--brand-blue); }
.rte-content p { margin: 0 0 8px; }
.rte-content strong { font-weight: 700; }
.rte-content:focus { outline: none; }

@media (max-width: 1100px) {
  .info-grid { grid-template-columns: 1fr; }
  .info-image { order: -1; max-width: 320px; }
  .bottom-gallery { grid-template-columns: repeat(3, 1fr); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .rapid-line.line-3 { grid-template-columns: 1fr; }
}

/* ====================== USER PILL (in nav) ====================== */
.app-header .user-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: border-color 120ms;
}
.app-header .user-pill:hover { border-color: var(--ink); }
.app-header .user-pill .avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: #fff;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.app-header .user-pill .label {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink);
}
.app-header .user-pill .label .role {
  display: block;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 1px;
}

/* ====================== LOGIN ====================== */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-card {
  padding: 64px 64px;
  display: flex; flex-direction: column;
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
  justify-content: center;
}
.login-logo {
  height: 56px;
  margin-bottom: 32px;
  align-self: flex-start;
}
.login-card h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 48px;
  text-transform: uppercase;
  letter-spacing: -.005em;
  line-height: 1;
  margin: 14px 0 16px;
  color: var(--ink);
}
.login-card .lead {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
}
.login-error {
  background: #FCEAEA;
  border-left: 3px solid var(--danger);
  padding: 10px 14px;
  font-size: 13px;
  color: #8B2522;
  margin-bottom: 14px;
}
.login-hint {
  margin-top: 20px;
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
}
.login-aside {
  background: #0B1620;
  color: #fff;
  position: relative;
  overflow: hidden;
  display: flex; align-items: center;
}
.login-aside::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 6px;
  background: linear-gradient(180deg,
    var(--brand-green) 0% 33%,
    var(--brand-teal) 33% 66%,
    var(--brand-blue) 66% 100%);
}
.login-aside::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(0,124,88,.25) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 70%, rgba(0,134,205,.22) 0%, transparent 55%);
  pointer-events: none;
}
.login-aside-inner {
  padding: 64px;
  max-width: 480px;
  position: relative; z-index: 2;
}
.login-aside h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 44px;
  text-transform: uppercase;
  letter-spacing: -.005em;
  line-height: .98;
  margin: 14px 0 18px;
  color: #fff;
}
.login-aside p {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255,255,255,.8);
  margin: 0;
}
.login-roles {
  margin-top: 40px;
  display: grid;
  gap: 18px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.login-roles .role-name {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .04em;
  color: #fff;
  margin-bottom: 4px;
}
.login-roles .role-desc {
  font-size: 13px;
  color: rgba(255,255,255,.6);
}

/* ====================== ROLE BADGE ====================== */
.role-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  background: var(--surface-2);
  color: var(--ink-2);
  border-radius: var(--r-pill);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.role-badge[data-role="superadmin"] {
  background: rgba(0,134,205,.12);
  color: var(--brand-blue-deep);
}

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-aside { display: none; }
}

/* ====================== GALLERY ====================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.gallery-grid image-slot {
  display: block;
  aspect-ratio: 4/3;
  width: 100%;
}
.gallery-grid image-slot:first-child {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: 1/1;
}

/* ====================== MODAL ====================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,20,26,.55);
  z-index: 200;
  display: flex; justify-content: center; align-items: flex-start;
  padding: 64px 24px;
  overflow-y: auto;
  animation: fade 200ms ease-out;
}
.modal {
  background: #fff;
  max-width: 720px;
  width: 100%;
  padding: 32px 36px 36px;
  position: relative;
  animation: pop 280ms cubic-bezier(.16,1,.3,1);
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(20px); opacity: 0; } }
.modal h2 {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 24px;
  margin: 0 0 6px;
}
.modal .sub { color: var(--ink-3); font-size: 14px; margin-bottom: 24px; }
.modal .close-x {
  position: absolute; top: 18px; right: 22px;
  background: none; border: 0; cursor: pointer;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  font-size: 22px;
  line-height: 1;
}
.modal .close-x:hover { color: var(--ink); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.field input, .field select, .field textarea {
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  background: #fff;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--ink);
}
.modal .actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* ====================== UTIL ====================== */
.hidden { display: none !important; }
.icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon svg { width: 1em; height: 1em; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 14px 22px;
  font-family: var(--font-body);
  font-size: 14px;
  z-index: 300;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-3);
  animation: slidein 240ms var(--ease-out);
}
@keyframes slidein { from { transform: translate(-50%, 20px); opacity: 0; } }

/* ====================== RESPONSIVE ====================== */
@media (max-width: 1100px) {
  .cards-grid.cols-4 { grid-template-columns: repeat(3, 1fr); }
  .detail-body { grid-template-columns: 1fr; }
  .aside-card { position: static; }
}
@media (max-width: 820px) {
  .cards-grid.cols-3, .cards-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .detail-hero .head-grid { grid-template-columns: 1fr; gap: 24px; }
  .filterbar .row { gap: 12px; }
  /* En móvil la cabecera es más alta (nav en 2 filas): que la barra de filtros
     no se quede pegada solapándola. */
  .filterbar { position: static; top: auto; }

  /* Navegación accesible en móvil: pasa a su propia fila y se desplaza en horizontal
     (en vez de ocultarse). Sin menú hamburguesa, solo CSS. */
  .app-header .row { flex-wrap: wrap; gap: 8px 16px; padding: 10px 16px; }
  .app-header .brand img { height: 38px; }
  .app-header nav {
    order: 3; width: 100%; margin-left: 0;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    border-top: 1px solid var(--line);
  }
  .app-header nav button { padding: 9px 12px; white-space: nowrap; }
  .app-header .curso-pill { display: none; }
}

/* ---- Teléfono ---- */
@media (max-width: 600px) {
  /* Tarjetas a una sola columna */
  .cards-grid,
  .cards-grid.cols-2, .cards-grid.cols-3, .cards-grid.cols-4 { grid-template-columns: 1fr; }

  /* Menos padding lateral para aprovechar el ancho del teléfono */
  .page-hero { padding: 28px 16px 20px !important; }
  .filterbar .row { padding-left: 16px; padding-right: 16px; }
  .detail-hero .inner { padding-left: 16px; padding-right: 16px; }
  .detail-body { padding: 28px 16px 48px; }

  /* Título de la ficha más contenido */
  .detail-hero h1 { font-size: clamp(26px, 8vw, 34px); }

  /* Filtro de etapas: que envuelva a varias filas en vez de salirse */
  .etapa-filter { flex-wrap: wrap; }

  /* Horario: desplazable en horizontal para que las columnas no se aplasten */
  .horario-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
  .horario-table, .horario-row { min-width: 560px; }
}

/* ====================== PANEL (admin) RESPONSIVE ====================== */
@media (max-width: 820px) {
  /* La barra lateral pasa a la parte de arriba (en vez de robar ancho fijo) */
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side {
    position: static; height: auto;
    border-right: 0; border-bottom: 1px solid var(--line);
    padding: 12px 0 16px;
  }
  .admin-main { padding: 20px 16px 60px; }

  /* La barra del editor deja de ser pegajosa (la cabecera es más alta en móvil) */
  .editor-topbar { position: static; }

  /* Tablas del panel: desplazables en horizontal para no aplastar columnas */
  .admin-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-table .head, .admin-table .row { min-width: 680px; }

  /* Formularios del editor y modales a una columna */
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .bottom-gallery { grid-template-columns: repeat(2, 1fr); }
}

/* ====================== ACCESIBILIDAD ====================== */
/* Foco visible para navegación por teclado (no afecta al clic con ratón). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
  border-radius: 2px;
}
