/* ============================================================
   Acade — Portal de Soporte
   ============================================================ */

:root {
  --primary: #1E3A8A;
  --primary-light: #3B82F6;
  --accent: #F59E0B;
  --success: #10B981;
  --danger: #DC2626;
  --dark: #0F172A;
  --text: #1E293B;
  --muted: #64748B;
  --bg: #F1F5F9;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --radius: 12px;
  --sidebar-w: 230px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
}

h1 { font-size: 1.5rem; margin: 0; color: var(--dark); }
h2 { font-size: 1.05rem; margin: 0; color: var(--dark); }
h3 { font-size: .95rem; margin: 0 0 8px; color: var(--dark); }
code { background: #EEF2FF; padding: 1px 6px; border-radius: 5px; font-size: .85em; }
a { color: var(--primary); }

:focus-visible { outline: 3px solid var(--primary-light); outline-offset: 1px; border-radius: 4px; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(170deg, #16307E, var(--dark));
  color: #CBD5E1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar__logo-chip {
  display: inline-block;
  background: #fff;
  border-radius: 10px;
  padding: 7px 12px;
}
.sidebar__logo-chip img { height: 30px; width: auto; display: block; }
.sidebar__brand-label {
  font-size: .74rem;
  font-weight: 600;
  color: #93A5CC;
  letter-spacing: .03em;
}

.sidebar__nav { display: flex; flex-direction: column; padding: 12px 10px; gap: 2px; overflow-y: auto; }
.sidebar__nav a {
  color: #CBD5E1;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: .92rem;
}
.sidebar__nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar__nav a.is-active { background: var(--accent); color: var(--dark); font-weight: 600; }
.sidebar__logout { margin-top: 14px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px !important; color: #FCA5A5 !important; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 10px 22px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar__burger { display: none; background: none; border: none; font-size: 1.3rem; cursor: pointer; }
.topbar__user { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; }
.topbar__avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }

.content { padding: 22px; max-width: 1300px; width: 100%; }

/* ---------- Badges / flash ---------- */
.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: #E2E8F0;
  color: var(--text);
  white-space: nowrap;
}
.badge--support { background: var(--accent); color: var(--dark); letter-spacing: .04em; }
.badge--ok { background: rgba(16,185,129,.15); color: #047857; }
.badge--bad { background: rgba(220,38,38,.12); color: var(--danger); }
.badge--warn { background: rgba(245,158,11,.16); color: #B45309; }
.badge--info { background: rgba(59,130,246,.13); color: var(--primary); }

.flash { margin: 14px 22px 0; padding: 12px 16px; border-radius: 10px; font-weight: 500; }
.flash--ok { background: rgba(16,185,129,.12); color: #065F46; border: 1px solid rgba(16,185,129,.3); }
.flash--error { background: rgba(220,38,38,.09); color: #991B1B; border: 1px solid rgba(220,38,38,.25); }

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  text-align: center;
  border-radius: 9px;
  padding: 9px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  background: none;
  font-family: inherit;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: #16307E; }
.btn--accent { background: var(--accent); color: var(--dark); }
.btn--accent:hover { background: #FBBF24; }
.btn--ghost { border-color: var(--border); color: var(--text); background: var(--card); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger-ghost { border-color: rgba(220,38,38,.35); color: var(--danger); background: var(--card); }
.btn--danger-ghost:hover { background: rgba(220,38,38,.07); }
.btn--sm { padding: 6px 11px; font-size: .8rem; }
.btn--block { display: block; width: 100%; }

/* ---------- Cards de estadística ---------- */
.cards-4, .cards-5 { display: grid; gap: 14px; margin-bottom: 20px; }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.cards-5 { grid-template-columns: repeat(5, 1fr); }

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.stat-card strong { display: block; font-size: 1.45rem; color: var(--dark); }
.stat-card span { font-size: .8rem; color: var(--muted); }
.stat-card--ok strong { color: #047857; }
.stat-card--bad strong { color: var(--danger); }

/* ---------- Paneles / tablas ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 20px;
}
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }

.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: .78rem;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
}
.table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table__empty { color: var(--muted); text-align: center; padding: 26px !important; }
.table__actions { display: flex; gap: 8px; }
.table__total td { background: #F8FAFC; font-weight: 600; }
.audit-details { font-size: .78rem; color: var(--muted); max-width: 380px; word-break: break-all; }

.pagination { display: flex; gap: 6px; margin-top: 12px; }
.pagination a {
  padding: 5px 11px; border: 1px solid var(--border); border-radius: 7px;
  text-decoration: none; color: var(--text); font-size: .85rem;
}
.pagination a.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

.hint { font-size: .8rem; color: var(--muted); }

/* ---------- Banner dashboard ---------- */
.banner {
  background: linear-gradient(140deg, var(--primary), #16307E);
  color: #fff;
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 20px;
}
.banner h1 { color: #fff; }
.banner p { margin: 6px 0 0; color: #C7D4F2; }

/* ---------- Cabecera de página ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head__actions { display: flex; gap: 10px; align-items: center; }

.searchbar, .filterbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.searchbar input[type="search"] { flex: 1; min-width: 200px; }

/* ---------- Formularios ---------- */
input, select, textarea {
  font-family: inherit;
  font-size: .9rem;
  color: var(--text);
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-light); background: #fff; }
input[type="checkbox"] { width: auto; }
input[type="file"] { background: none; border: none; padding: 4px 0; }

.panel--form label { display: block; margin-bottom: 14px; font-weight: 600; font-size: .85rem; color: var(--dark); }
.panel--form label input, .panel--form label select { margin-top: 5px; font-weight: 400; }
.panel--form h2 { margin: 18px 0 12px; }
.panel--form h2:first-child { margin-top: 0; }
.panel--form small { display: block; font-weight: 400; color: var(--muted); margin-top: 4px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-actions { margin-top: 10px; }

.check-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.check-pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; font-size: .88rem; background: var(--card);
}
.check-pill:has(input:checked) { border-color: var(--primary); background: rgba(30,58,138,.07); color: var(--primary); font-weight: 600; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.two-col--sidebar { grid-template-columns: 240px 1fr; }

/* ---------- Tarjetas de academia ---------- */
.academy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(390px, 1fr)); gap: 18px; }

.academy-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.academy-card__head { display: flex; align-items: flex-start; gap: 12px; }
.academy-card__head h2 { font-size: 1.05rem; }
.academy-card__head .badge { margin-left: auto; }
.academy-card__head small { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }

.academy-card__logo { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.academy-card__logo--placeholder {
  display: grid; place-items: center;
  background: rgba(30,58,138,.1); color: var(--primary);
  font-weight: 800; font-size: 1.2rem;
}

.academy-card__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.academy-card__stats--6 { grid-template-columns: repeat(3, 1fr); }
.academy-card__stats div { background: #F8FAFC; border: 1px solid var(--border); border-radius: 8px; padding: 8px; text-align: center; }
.academy-card__stats strong { display: block; color: var(--dark); }
.academy-card__stats span { font-size: .68rem; color: var(--muted); }

.academy-card__cycles { margin: 0; font-size: .85rem; color: var(--muted); }
.academy-card__meta { display: flex; gap: 14px; align-items: center; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.inline-date input { width: auto; padding: 3px 6px; font-size: .8rem; }

.academy-card__billing {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: rgba(245,158,11,.07);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: 8px; padding: 8px 12px; font-size: .85rem;
}
.academy-card__billing strong { color: var(--dark); font-size: 1rem; }
.academy-card__billing small { color: var(--muted); width: 100%; }

.academy-card__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

/* ---------- Demos ---------- */
.demo-access { border-top: 1px dashed var(--border); padding-top: 12px; }
.demo-access__row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: .85rem; flex-wrap: wrap; }
.demo-access__form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.demo-access__form input { flex: 1; min-width: 110px; }
.demo-access__form input[name="days"] { flex: 0 0 70px; }
.creds-box__row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Tutoriales ---------- */
.cat-tree { display: flex; flex-direction: column; gap: 2px; }
.cat-tree a { text-decoration: none; color: var(--text); padding: 7px 10px; border-radius: 7px; font-size: .88rem; }
.cat-tree a:hover { background: #F1F5F9; }
.cat-tree a.is-active { background: rgba(30,58,138,.09); color: var(--primary); font-weight: 600; }
.cat-tree__child { padding-left: 24px !important; font-size: .82rem !important; color: var(--muted); }

.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.video-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.video-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.video-card__body { padding: 12px 14px; }
.video-card__body h3 { margin-bottom: 6px; }
.video-card__body p { margin: 0 0 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.video-card__actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Diagnóstico ---------- */
.diag--ok { border-left: 4px solid var(--success); }
.diag--bad { border-left: 4px solid var(--danger); }
.diag__num {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: .8rem; margin-right: 6px;
}
.diag__side { display: flex; align-items: center; gap: 10px; }
.diag__list { margin: 0; padding-left: 20px; font-size: .85rem; color: var(--text); }
.diag__list li { margin-bottom: 4px; }

/* ---------- Precios ---------- */
.preview-controls { display: flex; gap: 14px; margin-bottom: 14px; }
.preview-controls label { font-size: .85rem; font-weight: 600; }
.preview-controls input { margin-top: 4px; }
.preview-amount { font-size: 1rem; }
.preview-amount strong { font-size: 1.5rem; color: var(--primary); }

/* ---------- Perfil ---------- */
.profile-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; margin-bottom: 12px; display: block; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,23,42,.5);
  display: grid; place-items: center; padding: 20px;
}
.modal[hidden] { display: none; }
.modal__box {
  background: var(--card); border-radius: var(--radius);
  padding: 22px; width: 100%; max-width: 460px;
  max-height: 90vh; overflow-y: auto;
}
.modal__box h2 { margin-bottom: 14px; }
.modal__box label { display: block; margin-bottom: 12px; font-weight: 600; font-size: .85rem; }
.modal__box label input, .modal__box label select { margin-top: 5px; font-weight: 400; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #0F1D4D, var(--primary) 70%, #2749A8);
  padding: 20px;
  margin: 0;
}
.login-card {
  background: var(--card); border-radius: 16px;
  padding: 32px; width: 100%; max-width: 400px;
  box-shadow: 0 24px 60px rgba(15,23,42,.3);
}
.login-card__brand { text-align: center; margin-bottom: 20px; }
.login-card__brand h1 { font-size: 1.3rem; margin: 10px 0 2px; }
.login-card__brand p { margin: 0; color: var(--muted); font-size: .85rem; }
.login-card label { display: block; font-weight: 600; font-size: .85rem; margin: 12px 0 5px; }
.login-card .btn { margin-top: 18px; }
.login-card .flash { margin: 0 0 6px; }

/* ---------- Barra de sesión de soporte (tenant) ---------- */
.support-bar {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  background: var(--success); color: #fff;
  padding: 8px 16px; font-size: .88rem; font-weight: 600;
  position: sticky; top: 0; z-index: 200;
}
.support-bar form { margin: 0; }
.support-bar__btn {
  background: #fff; color: #047857; border: none; border-radius: 7px;
  padding: 5px 12px; font-weight: 700; font-size: .8rem; cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .cards-4, .cards-5 { grid-template-columns: repeat(2, 1fr); }
  .two-col, .two-col--sidebar { grid-template-columns: 1fr; }
  .academy-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .sidebar {
    position: fixed; z-index: 90; left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .sidebar.is-open { transform: none; }
  .topbar__burger { display: block; }
  .content { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; }
}

/* ============================================================
   Rediseño del panel (v3): sidebar oscuro con íconos,
   banner con eyebrow, stat cards con chips y listas con filas.
   ============================================================ */

:root { --sidebar-w: 250px; }

.sidebar {
  background: #0B1526;
  border-right: 1px solid rgba(255, 255, 255, .06);
}

.sidebar__brand { border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sidebar__logo-chip { display: inline-block; background: #fff; border-radius: 10px; padding: 6px 11px; }
.sidebar__brand-label { font-size: .74rem; font-weight: 600; color: #7C8DB5; letter-spacing: .03em; }

/* Tarjeta de usuario */
.sidebar__user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sidebar__user strong { display: block; color: #fff; font-size: .95rem; }
.sidebar__avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.sidebar__avatar--initial {
  display: grid; place-items: center;
  background: var(--accent);
  color: #0B1526;
  font-weight: 800;
  font-size: 1.1rem;
}
.sidebar__role {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  color: #F5B942;
}
.sidebar__role svg { width: 12px; height: 12px; }

/* Navegación con íconos */
.sidebar__nav { flex: 1; padding: 12px 12px; }
.sidebar__nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #A7B4CE;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: .92rem;
}
.sidebar__nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar__nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar__nav a.is-active {
  background: rgba(245, 158, 11, .13);
  border-color: rgba(245, 158, 11, .3);
  color: #FBBF24;
  font-weight: 600;
}

.sidebar__logout {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 12px 14px;
  padding: 11px 12px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  border-radius: 0;
  color: #FCA5A5 !important;
  text-decoration: none;
  font-size: .92rem;
}
.sidebar__logout svg { width: 18px; height: 18px; }
.sidebar__logout:hover { color: #fff !important; }

/* Badge del topbar tipo pill con borde */
.badge--support {
  background: rgba(245, 158, 11, .1);
  border: 1px solid rgba(245, 158, 11, .45);
  color: #B45309;
  letter-spacing: .05em;
}

/* Banner del dashboard */
.banner--dash {
  background:
    radial-gradient(600px 260px at 90% 0%, rgba(59, 130, 246, .25), transparent 60%),
    linear-gradient(120deg, #0B1526 0%, #101E3C 60%, #16307E 100%);
  padding: 32px;
}
.banner__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: #FBBF24;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .08em;
}
.banner__eyebrow svg { width: 20px; height: 20px; }
.banner--dash h1 { font-size: 1.9rem; }
.banner--dash p:last-child { max-width: 46em; }

/* Stat cards con chip de ícono */
.stat-card { padding: 20px; }
.stat-card__icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 13px;
  margin-bottom: 16px;
}
.stat-card__icon svg { width: 23px; height: 23px; }
.stat-card span.stat-card__icon { color: #fff; }
.stat-card__icon--blue   { background: #6366F1; }
.stat-card__icon--green  { background: #10B981; }
.stat-card__icon--purple { background: #8B5CF6; }
.stat-card__icon--amber  { background: var(--accent); }
.stat-card strong { font-size: 1.7rem; }
.stat-card span:last-child { font-size: .88rem; }

/* Cabecera de panel con título con ícono y enlace */
.panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel__title svg { width: 19px; height: 19px; color: var(--success); }
.panel__title small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.panel__link {
  text-decoration: none;
  font-weight: 600;
  font-size: .88rem;
  color: var(--primary);
}
.panel__link:hover { text-decoration: underline; }

/* Filas de listado (últimas academias) */
.list-rows { display: flex; flex-direction: column; }
.list-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-row__icon {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(30, 58, 138, .09);
  color: var(--primary);
  flex-shrink: 0;
}
.list-row__icon svg { width: 19px; height: 19px; }
.list-row__main { flex: 1; min-width: 0; }
.list-row__main strong { display: block; color: var(--dark); font-size: .93rem; }
.list-row__main span { font-size: .8rem; color: var(--muted); }
.list-row__date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--muted);
  white-space: nowrap;
}
.list-row__date svg { width: 15px; height: 15px; }

/* ============================================================
   Modal Crear Academia (estilo con cabecera de color)
   ============================================================ */

.modal__box--lg { max-width: 540px; }
.modal__box--flush { padding: 0; overflow: hidden; display: flex; flex-direction: column; }

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(120deg, var(--primary), #2749A8);
  color: #fff;
  padding: 18px 22px;
  flex-shrink: 0;
}
.modal__header h2 { color: #fff; margin: 0 0 3px; font-size: 1.15rem; }
.modal__header p { margin: 0; color: rgba(255, 255, 255, .75); font-size: .85rem; }
.modal__x {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .8);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 7px;
}
.modal__x:hover { background: rgba(255, 255, 255, .15); color: #fff; }

.modal__body { padding: 20px 22px; overflow-y: auto; }
.modal__body label { display: block; margin-bottom: 14px; font-weight: 600; font-size: .86rem; color: var(--dark); }
.modal__body label input { margin-top: 6px; font-weight: 400; }
.modal__body label em { color: var(--danger); font-style: normal; }

.form-section {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 20px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.form-section:first-of-type { margin-top: 0; }

/* Input con prefijo/sufijo (+51, .acade.pe) */
.input-group {
  display: flex;
  align-items: stretch;
  margin-top: 6px;
}
.input-group input { margin-top: 0 !important; border-radius: 8px 0 0 8px; min-width: 0; }
.input-group .input-group__addon {
  display: flex;
  align-items: center;
  padding: 0 13px;
  background: #E8EDF5;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: .88rem;
  font-weight: 600;
  white-space: nowrap;
}
.input-group .input-group__addon:first-child { border-right: 0; border-radius: 8px 0 0 8px; }
.input-group .input-group__addon:last-child { border-left: 0; border-radius: 0 8px 8px 0; }
.input-group .input-group__addon:first-child + input { border-radius: 0 8px 8px 0; }

/* Input con botón de ojo */
.input-group--eye { position: relative; }
.input-group--eye input { border-radius: 8px; padding-right: 44px; }
.input-group__eye {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 6px;
  border-radius: 7px;
  display: grid;
  place-items: center;
}
.input-group__eye:hover { color: var(--dark); background: var(--border); }
.input-group__eye svg { width: 19px; height: 19px; }

/* Caja de solo lectura (Pago mensual) */
.readonly-box {
  display: block;
  margin-top: 6px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  font-weight: 400;
}
.readonly-box strong { color: var(--dark); }
.readonly-box small { color: var(--muted); }

/* ============================================================
   Pantalla de Precios (tarjetas de modo + vista previa)
   ============================================================ */

.pricing-wrap { max-width: 660px; margin: 0 auto; }

.panel--flush { padding: 0; overflow: hidden; }

.pricing-head {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
}
.pricing-head h2 { font-size: 1rem; margin-bottom: 3px; }
.pricing-head p { margin: 0; color: var(--muted); font-size: .85rem; }

.pricing-body { padding: 22px 24px; }

.form-icon-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: .93rem;
  color: var(--dark);
  margin: 24px 0 10px;
}
.form-icon-label:first-of-type { margin-top: 0; }
.form-icon-label svg { width: 18px; height: 18px; }
.icon--violet { color: #8B5CF6; }
.icon--green  { color: #10B981; }
.icon--blue   { color: #3B82F6; }
.icon--amber  { color: var(--accent); }

/* Tarjetas de modo de facturación */
.mode-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  background: #fff;
}
.mode-card input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.mode-card__text { flex: 1; }
.mode-card__text strong { display: block; color: var(--dark); font-size: .95rem; }
.mode-card__text small { color: var(--muted); font-size: .82rem; }
.mode-card__dot {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.mode-card:has(input:checked) {
  border-color: var(--primary-light);
  background: #EFF4FF;
}
.mode-card:has(input:checked) .mode-card__text strong { color: var(--primary); }
.mode-card:has(input:checked) .mode-card__dot {
  border-color: var(--primary-light);
}
.mode-card:has(input:checked) .mode-card__dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--primary-light);
}

.field-hint { font-size: .8rem; color: var(--muted); margin: 6px 0 0; }

/* Vista previa de cobro */
.preview-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 26px 0 20px;
}
.preview-box__title {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}
.preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.preview-row__label span { display: block; font-size: .9rem; color: var(--dark); }
.preview-row__label small { font-size: .76rem; color: var(--muted); }
.preview-row strong { color: var(--dark); white-space: nowrap; }
.preview-row .preview-row__amount--hl { color: #047857; }

.preview-box__example {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
}
.preview-box__example input { width: 90px; padding: 6px 9px; }

.pricing-foot {
  display: flex;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #fff;
}

/* Configuración de QR de Pago */
.qr-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 26px;
  align-items: start;
}

.qr-side { display: flex; flex-direction: column; align-items: center; gap: 12px; }

.qr-preview {
  width: 180px;
  height: 180px;
  border: 2px dashed var(--border);
  border-radius: 14px;
  background: var(--bg-alt);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 8px;
}
.qr-preview img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.qr-preview__empty { color: var(--muted); font-size: .82rem; text-align: center; }

.qr-upload { cursor: pointer; }

.qr-delete {
  background: none;
  border: none;
  color: var(--danger);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.qr-delete:hover { background: rgba(220, 38, 38, .08); }

.qr-fields .form-icon-label:first-child { margin-top: 0; }
.qr-fields .form-icon-label { margin-top: 18px; }

@media (max-width: 560px) {
  .qr-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Academias v2 (estilo tarjetas con franja, estado y pago)
   ============================================================ */

.page-head__sub { margin: 3px 0 0; color: var(--muted); font-size: .9rem; }

.btn__ico { width: 16px; height: 16px; vertical-align: -3px; margin-right: 7px; }

.btn--violet { background: #8B5CF6; color: #fff; }
.btn--violet:hover { background: #7C3AED; }
.btn--dark { background: #0F172A; color: #fff; }
.btn--dark:hover { background: #1E293B; }
.btn--amber-ghost { border: 1px solid rgba(245, 158, 11, .55); color: #B45309; background: #fff; }
.btn--amber-ghost:hover { background: rgba(245, 158, 11, .08); }
.btn--icon { padding: 6px 9px; }
.btn--icon svg { width: 16px; height: 16px; vertical-align: -3px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--bg-alt); color: var(--dark); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn--sm { width: 26px; height: 26px; }
.icon-btn--sm svg { width: 14px; height: 14px; }

/* Contadores como tarjetas con chip */
.filter-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.filter-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.filter-card--selected { border: 2px solid var(--dark); }
.filter-card small {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.filter-card strong { font-size: 1.45rem; color: var(--dark); line-height: 1.2; }
.filter-card__chip {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
}
.filter-card__chip svg { width: 22px; height: 22px; }
.filter-card__chip--slate { background: #EEF2F7; color: #334155; }
.filter-card__chip--green { background: rgba(16, 185, 129, .14); color: #047857; }
.filter-card__chip--teal  { background: rgba(13, 148, 136, .13); color: #0F766E; }
.filter-card__chip--amber { background: rgba(245, 158, 11, .16); color: #B45309; }
.filter-card__chip--blue  { background: rgba(59, 130, 246, .13); color: #1D4ED8; }

/* Buscador con lupa */
.searchbox {
  position: relative;
  margin-bottom: 20px;
}
.searchbox svg {
  position: absolute;
  left: 15px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--muted);
  pointer-events: none;
}
.searchbox input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  border-radius: 12px;
  background: #fff;
}

/* Tarjeta de academia */
.acad-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 16px;
}
.acad-card__strip {
  height: 6px;
  background: linear-gradient(90deg, #10B981, #34D399);
}
.acad-card__strip.is-bad { background: linear-gradient(90deg, #DC2626, #F87171); }

.acad-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 0;
}
.acad-card__logo { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); }
.acad-card__logo--placeholder {
  display: grid; place-items: center;
  background: rgba(30, 58, 138, .1); color: var(--primary);
  font-weight: 800; font-size: 1.2rem;
}
.acad-card__title { flex: 1; min-width: 0; }
.acad-card__title h2 {
  font-size: 1.02rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acad-card__url { font-size: .8rem; color: var(--muted); }

.acad-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 16px;
}
.acad-card__stats div {
  background: var(--bg-alt);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}
.acad-card__stats strong { display: block; font-size: 1.25rem; color: var(--dark); }
.acad-card__stats span { font-size: .72rem; color: var(--muted); }
.txt-blue { color: #2563EB !important; }
.txt-green { color: #059669 !important; }

.acad-card__meta { padding: 0 16px; }
.acad-card__meta p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: .84rem;
  color: var(--muted);
}
.acad-card__meta p svg { width: 15px; height: 15px; flex-shrink: 0; }
.acad-card__meta p.is-warn { color: #B45309; font-weight: 600; }
.acad-card__meta p.is-bad { color: var(--danger); font-weight: 600; }
.acad-card__meta .icon-btn--sm { margin-left: auto; }
.acad-card__expiry { padding: 4px 0 0; }
.acad-card__expiry input { width: auto; padding: 6px 9px; font-size: .84rem; }

.acad-card__status {
  margin: 0 16px;
  background: rgba(16, 185, 129, .1);
  border: 1px solid rgba(16, 185, 129, .25);
  color: #047857;
  font-weight: 600;
  font-size: .88rem;
  border-radius: 10px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.acad-card__status .dot { width: 8px; height: 8px; border-radius: 50%; background: #10B981; }
.acad-card__status.is-bad {
  background: rgba(220, 38, 38, .07);
  border-color: rgba(220, 38, 38, .25);
  color: var(--danger);
}
.acad-card__status.is-bad .dot { background: #DC2626; }

.acad-card__pay {
  margin: 0 16px;
  background: rgba(16, 185, 129, .07);
  border: 1px solid rgba(16, 185, 129, .22);
  border-radius: 12px;
  padding: 12px 14px;
}
.acad-card__pay-head {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.acad-card__pay-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: .86rem;
  color: #047857;
  margin-right: auto;
}
.acad-card__pay-title svg { width: 15px; height: 15px; }
.acad-card__amount {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--dark);
}
.acad-card__pay-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: .78rem;
}

.acad-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 2px 16px 0;
  margin-top: auto;
}

@media (max-width: 1200px) {
  .filter-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .filter-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   v10: tipografía (Inter + Plus Jakarta Sans) y tarjeta
   de academia calcada de la referencia
   ============================================================ */

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1, h2, h3, h4,
.stat-card strong,
.filter-card strong,
.btn,
.acad-card__amount,
.acad-card__stats strong {
  font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
}

.acad-card {
  border-radius: 18px;
  gap: 14px;
  padding-bottom: 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
}
.acad-card__strip { height: 7px; background: linear-gradient(90deg, #0D9488, #34D399); }
.acad-card__strip.is-bad { background: linear-gradient(90deg, #DC2626, #F87171); }

.acad-card__head { padding: 12px 18px 0; }
.acad-card__logo,
.acad-card__logo--placeholder {
  width: 52px; height: 52px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  object-fit: contain;
  padding: 3px;
}
.acad-card__logo--placeholder { display: grid; background: rgba(30, 58, 138, .08); padding: 0; }
.acad-card__title h2 { font-size: 1.14rem; font-weight: 700; }
.acad-card__url { font-size: .84rem; }
.acad-card__quick { display: flex; align-items: center; gap: 2px; }

.acad-card__stats { gap: 10px; padding: 0 18px; }
.acad-card__stats div { border-radius: 12px; padding: 13px 8px; }
.acad-card__stats strong { font-size: 1.4rem; font-weight: 800; }
.acad-card__stats span { font-size: .76rem; }

.acad-card__meta { padding: 0 18px; }
.acad-card__meta p { font-size: .87rem; margin-bottom: 6px; }
.acad-card__meta p:last-of-type:not(.is-warn):not(.is-bad) { color: var(--dark); font-weight: 600; }

.acad-card__status {
  margin: 0 18px;
  border-radius: 12px;
  padding: 11px 15px;
  font-size: .9rem;
}

.acad-card__pay {
  margin: 0 18px;
  border-radius: 14px;
  padding: 14px 16px;
  background: #ECFDF5;
  border-color: #C7F0DF;
}
.acad-card__pay-title { font-size: .9rem; }
.acad-card__pay-head .badge--info { background: #E0E7FF; color: #4338CA; }
.acad-card__pay-head .badge:not(.badge--info):not(.badge--warn) { background: #fff; border: 1px solid var(--border); }
.acad-card__amount { font-size: 1.85rem; margin: 2px 0; letter-spacing: -.01em; }

/* ---------- Modal Titular de la Cuenta ---------- */
.modal__header--indigo {
  background: linear-gradient(120deg, #4F46E5, #6366F1);
}
.modal__header-actions { display: flex; align-items: center; gap: 4px; }
.modal__header-actions a.modal__x { display: grid; place-items: center; text-decoration: none; }

.owner-body { background: #fff; }

.owner-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.owner-hero__avatar {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #E0E7FF;
  color: #4F46E5;
}
.owner-hero__avatar svg { width: 27px; height: 27px; }
.owner-hero strong { display: block; font-family: "Plus Jakarta Sans", sans-serif; font-size: 1.1rem; color: var(--dark); }
.owner-hero span { color: var(--muted); font-size: .85rem; }

.info-row {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 15px;
  margin-bottom: 10px;
}
.info-row > svg { width: 19px; height: 19px; color: var(--muted); flex-shrink: 0; }
.info-row > div { flex: 1; min-width: 0; }
.info-row small {
  display: block;
  font-size: .74rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 1px;
}
.info-row input {
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  font-size: .95rem;
  font-weight: 500;
  color: var(--dark);
  border-radius: 0;
}
.info-row input:disabled { color: var(--dark); opacity: 1; -webkit-text-fill-color: var(--dark); }
.owner-body.is-editing .info-row input:not([data-static]) {
  background: #fff;
  border: 1px solid var(--primary-light);
  border-radius: 8px;
  padding: 7px 10px;
}
.owner-body.is-editing .info-row input[data-static] { color: var(--muted); -webkit-text-fill-color: var(--muted); }

.info-row--amber {
  background: #FFFBEB;
  border-color: #FDE9C3;
}
.info-row--amber > svg,
.info-row--amber small { color: #B45309; }

.owner-edit-btn {
  margin-top: 6px;
  background: #4F46E5;
  color: #fff;
  border-radius: 12px;
  padding: 14px;
}
.owner-edit-btn:hover { background: #4338CA; }

.owner-audit-foot { text-align: center; margin: 12px 0 0; }
.owner-audit-foot a { font-size: .8rem; color: var(--muted); }
.owner-audit-foot a:hover { color: var(--primary); }

.acad-card__actions { padding: 4px 18px 0; flex-wrap: nowrap; }
.acad-card__actions .btn--sm { padding: 10px 16px; font-size: .86rem; border-radius: 12px; font-weight: 700; }
.acad-card__actions .btn--icon { padding: 10px 13px; }
.acad-card__actions .btn--icon svg { width: 17px; height: 17px; }
