:root {
  --bg:       #111111;
  --surface:  #1c1c1c;
  --surface2: #242424;
  --border:   #333;
  --text:     #f0f0f0;
  --muted:    #999;
  --green:    #4ade80;
  --yellow:   #fbbf24;
  --red:      #f87171;
  --accent:   #f0f0f0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 100px;
}

/* ── HEADER ── */
header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 16px 18px 0;
}

.logo-bar {
  display: flex;
  align-items: center;
  background: var(--bg);
  border-bottom: 1px solid #1e1e1e;
  padding: 0 18px;
  min-height: 170px;
  gap: 0;
}
.logo-col {
  width: 170px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-imagen {
  height: 160px;
  width: auto;
  display: block;
}
.logo-nombre-col {
  flex: 1;
  display: flex;
  justify-content: center;
  border-left: 1px solid #222;
  margin-left: 4px;
  padding-left: 0;
}
.logo-nombre {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .02em;
  line-height: 1.1;
  text-align: center;
}
.logo-nombre span  { color: #60a5fa; }
.logo-nombre .runners { color: #fb923c; }

.logo-acciones {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 12px;
}
.header-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: .82rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.icon-btn:hover { background: var(--surface2); }

/* ── TABS ── */
.tabs {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg);
}

.tab {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  font-size: .95rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: #444;
  cursor: pointer;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  transition: color .2s, background .2s, border-color .2s;
  user-select: none;
  letter-spacing: .01em;
}

.tab:hover {
  color: #888;
  background: var(--surface);
}

.tab.active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--green);
}

/* ── SECTIONS ── */
.section { display: none; }
.section.active { display: block; }

/* ── LISTA ALUMNOS ── */
#lista {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  animation: fadeUp .2s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.indicador { width: 6px; flex-shrink: 0; border-radius: 0; }
.verde    { background: var(--green); }
.amarillo { background: var(--yellow); }
.rojo     { background: var(--red); }

.card-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  flex: 1;
  min-width: 0;
}

.nombre {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.card-actions { display: flex; gap: 6px; flex-shrink: 0; }

.card-btn {
  width: 110px;
  padding: 9px 0;
  border-radius: 8px;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
  text-align: center;
}
.card-btn:active { transform: scale(.95); }

.card-btn.pagar { background: rgba(74,222,128,.18); color: var(--green); }
.card-btn.pagar:hover { opacity: .8; }
.card-btn.pagar.done { background: #222; color: #444; cursor: default; }
.card-btn.pagar.done:hover { opacity: 1; }

.card-btn.plan { background: rgba(167,139,250,.18); color: #c4b5fd; }
.card-btn.plan:hover { opacity: .8; }
.card-btn.plan.done { background: #222; color: #444; cursor: default; }
.card-btn.plan.done:hover { opacity: 1; }

.card-btn.eliminar {
  width: auto;
  padding: 9px 12px;
  background: transparent;
  color: #444;
  font-weight: 400;
  font-size: .78rem;
}
.card-btn.eliminar:hover { color: var(--red); }

/* ── BUSCADOR ── */
.buscar-wrap { padding: 12px 16px 4px; }

#buscar {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 16px;
  font-family: 'Inter', sans-serif;
  font-size: .95rem;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}
#buscar:focus { border-color: #555; }
#buscar::placeholder { color: var(--muted); }
#buscar::-webkit-search-cancel-button { cursor: pointer; }

.empty {
  text-align: center;
  padding: 70px 24px;
  color: var(--muted);
  font-size: .95rem;
}
.empty-icon { font-size: 2.4rem; display: block; margin-bottom: 12px; }

/* ── FAB ── */
#btn-agregar {
  position: fixed;
  bottom: 22px;
  right: 18px;
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 16px;
  padding: 16px 24px;
  font-family: 'Inter', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 28px rgba(0,0,0,.55);
  transition: transform .15s, box-shadow .15s;
  z-index: 30;
}
#btn-agregar:hover  { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,.65); }
#btn-agregar:active { transform: scale(.97); }

/* ── RESUMEN ── */
#resumen-content {
  padding: 20px 18px 60px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 800px;
  margin: 0 auto;
}

#resumen-inner {
  background: rgba(28,28,28,.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 24px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}

.rs-dos-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.rs-col-izq { display: flex; flex-direction: column; gap: 14px; }
.rs-col-der { display: flex; flex-direction: column; gap: 14px; }

.rs-logo-row { padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.07); text-align: center; }
.rs-logo-name { font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem; font-weight: 700; color: #f0f0f0; }
.rs-logo-sub  { font-size: .75rem; color: #555; margin-top: 3px; }

.rs-hero {
  background: #f0f0f0;
  border-radius: 16px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rs-periodo-mes   { font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; font-weight: 700; color: #111; line-height: 1; }
.rs-periodo-label { font-size: .75rem; font-weight: 600; color: #555; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .06em; }
.rs-total-num     { font-family: 'Space Grotesk', sans-serif; font-size: 3rem; font-weight: 700; color: #111; line-height: 1; text-align: right; }
.rs-total-label   { font-size: .75rem; font-weight: 600; color: #555; text-transform: uppercase; letter-spacing: .06em; text-align: right; margin-top: 4px; }

.rs-ingresos { background: #1c1c1c; border: 1px solid #333; border-radius: 16px; overflow: hidden; }
.rs-ingreso-row { padding: 20px 24px; border-bottom: 1px solid #2a2a2a; }
.rs-ingreso-row:last-child { border-bottom: none; }
.rs-ingreso-label { font-size: .75rem; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.rs-ingreso-valor { font-family: 'Space Grotesk', sans-serif; font-size: 2rem; font-weight: 700; color: #f0f0f0; line-height: 1; }
.rs-ingreso-row.principal .rs-ingreso-label { color: #bbb; }
.rs-ingreso-row.principal .rs-ingreso-valor { font-size: 2.6rem; color: #fff; }

.rs-alumnos-wrap { background: #1c1c1c; border: 1px solid #333; border-radius: 16px; padding: 20px 24px; display: flex; align-items: center; gap: 24px; }
.rs-donut-wrap { position: relative; flex-shrink: 0; }
.rs-donut-wrap svg { display: block; }
.rs-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.rs-donut-pct { font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem; font-weight: 700; color: #f0f0f0; }
.rs-donut-sub { font-size: .6rem; font-weight: 600; color: #666; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.rs-alumnos-legend { flex: 1; }
.rs-legend-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.rs-legend-row:last-child { margin-bottom: 0; }
.rs-legend-num   { font-family: 'Space Grotesk', sans-serif; font-size: 1.8rem; font-weight: 700; color: #f0f0f0; line-height: 1; min-width: 36px; }
.rs-legend-label { font-size: .78rem; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: .05em; }
.rs-legend-dot   { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.rs-plan-wrap   { background: #1c1c1c; border: 1px solid #333; border-radius: 16px; padding: 20px 24px; }
.rs-plan-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.rs-plan-titulo { font-size: .75rem; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: .06em; }
.rs-plan-pct    { font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem; font-weight: 700; color: #f0f0f0; }
.rs-plan-nums   { display: flex; gap: 32px; margin-bottom: 18px; }
.rs-plan-num    { font-family: 'Space Grotesk', sans-serif; font-size: 2.2rem; font-weight: 700; color: #f0f0f0; line-height: 1; }
.rs-plan-label  { font-size: .75rem; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
.rs-plan-enviadas .rs-plan-num { color: #c4b5fd; }
.rs-bar-wrap  { background: #2a2a2a; border-radius: 99px; height: 10px; overflow: hidden; margin-bottom: 6px; }
.rs-bar-fill  { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #7c3aed, #c4b5fd); transition: width .6s ease; }
.rs-bar-label { font-size: .75rem; font-weight: 600; color: #666; text-align: right; }

/* ── MODAL BASE ── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 40;
  align-items: flex-end;
  justify-content: center;
}
.overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px 22px 0 0;
  padding: 30px 20px 40px;
  width: 100%;
  max-width: 500px;
  animation: slideUp .25s ease;
}

@keyframes slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.modal input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: var(--text);
  outline: none;
  margin-bottom: 12px;
  transition: border-color .2s;
}
.modal input:focus { border-color: #555; }
.modal input::placeholder { color: var(--muted); }

.modal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.modal-btns button {
  padding: 15px;
  border-radius: 12px;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.modal-btns button:hover { opacity: .85; }

#btn-confirmar { background: var(--accent); color: #111; }
#btn-cancelar  { background: var(--border);  color: var(--text); }

/* ── MODAL BTN ── */
.modal-btn {
  flex: 1;
  padding: 15px;
  border-radius: 14px;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.modal-btn:active { transform: scale(.97); }
.modal-btn:hover  { opacity: .88; }
.modal-btn.primario   { background: var(--accent); color: #111; }
.modal-btn.secundario { background: #2a2a2a; color: var(--muted); border: 1px solid #3a3a3a; }

/* ── CONFIRM MODAL ── */
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.8);
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.confirm-overlay.open { display: flex; }

.confirm-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  animation: popIn .2s ease;
}

@keyframes popIn {
  from { transform: scale(.92); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.confirm-icon { font-size: 2rem; margin-bottom: 12px; }
.confirm-msg  { font-size: 1rem; line-height: 1.5; margin-bottom: 24px; }
.confirm-name { font-weight: 700; color: var(--green); }

.confirm-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.confirm-btns button {
  padding: 14px;
  border-radius: 12px;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
}

#confirm-si { background: var(--green);  color: #111; }
#confirm-no { background: var(--border); color: var(--text); }

/* ── MODAL CONFIGURACIÓN ── */
#config-overlay {
  align-items: center;
}

#config-overlay .modal {
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 22px;
  margin-bottom: 5vh;
}

.config-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 8px;
  margin-top: 20px;
  display: block;
}

.config-colores-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  justify-content: flex-start;
  padding-left: 16px;
}

.config-color-item {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
}

.config-color-item span {
  font-size: .72rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.config-color-item input[type="color"] {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid #333;
  background: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color .2s, transform .15s;
}
.config-color-item input[type="color"]:hover { border-color: #666; transform: scale(1.08); }
.config-color-item input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; border-radius: 50%; }
.config-color-item input[type="color"]::-webkit-color-swatch { border: none; border-radius: 50%; }

.config-split-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.config-split-desc { flex: 1; font-size: .88rem; color: var(--muted); line-height: 1.4; }
.config-split-desc strong { color: var(--text); font-weight: 600; }

.config-split-input {
  width: 72px !important;
  height: 52px !important;
  text-align: center !important;
  font-family: 'Space Grotesk', sans-serif !important;
  font-size: 1.4rem !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex-shrink: 0;
}

.config-preview-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  margin-bottom: 24px;
}

.config-preview-label {
  font-size: .7rem;
  font-weight: 600;
  color: #444;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}

#config-preview {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.config-btns { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }

/* ── LOGIN ── */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: #000;
}

.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 440px;
}

.login-logo {
  width: 100%;
  max-width: 440px;
  height: auto;
  object-fit: contain;
  margin-bottom: 48px;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.login-card input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid #444;
  border-radius: 0;
  padding: 18px 4px;
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  color: #fff;
  outline: none;
  margin-bottom: 8px;
  transition: border-color .2s;
}
.login-card input:focus { border-bottom-color: #888; }
.login-card input::placeholder { color: #fff; opacity: .5; }

#login-error {
  color: var(--red);
  font-size: .85rem;
  min-height: 24px;
  padding: 4px 4px 0;
}

#login-btn {
  width: 100%;
  background: #f0f0f0;
  color: #111;
  border: none;
  border-radius: 14px;
  padding: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 36px;
  transition: opacity .15s, transform .1s;
  letter-spacing: .02em;
}
#login-btn:hover  { opacity: .88; }
#login-btn:active { transform: scale(.98); }


/* ── SLIDER CONFIG ── */
.config-slider-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 0 4px;
}

.config-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 99px;
  background: #333;
  outline: none;
  cursor: pointer;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

.config-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform .15s;
}

.config-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.config-slider-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  min-width: 28px;
  text-align: center;
}

.config-colores-preview-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.config-colores-preview-row .config-colores-row {
  margin-bottom: 0;
  flex-shrink: 0;
}

.config-colores-preview-row .config-preview-wrap {
  flex: 1;
  margin-bottom: 0;
}


/* ── RESPONSIVE MOBILE ── */
@media (max-width: 600px) {

  /* HEADER */
  .logo-bar {
    min-height: auto;
    padding: 10px 12px;
    gap: 8px;
  }
  .logo-col {
    width: 64px;
  }
  .logo-imagen {
    height: 56px;
  }
  .logo-nombre {
    font-size: 1.3rem;
  }
  .logo-acciones {
    margin-left: 6px;
  }
  .header-actions {
    gap: 5px;
  }
  .icon-btn {
    padding: 6px 10px;
    font-size: .75rem;
  }

  /* CARDS ALUMNOS */
  .card-inner {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
  }
  .nombre {
    width: 100%;
    font-size: .95rem;
  }
  .card-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .card-btn {
    width: auto;
    flex: 1;
    padding: 8px 6px;
    font-size: .78rem;
  }
  .card-btn.eliminar {
    flex: 0;
    padding: 8px 10px;
  }

  /* FAB */
  #btn-agregar {
    bottom: 16px;
    right: 14px;
    padding: 14px 20px;
    font-size: .9rem;
  }

  /* RESUMEN */
  .rs-dos-col {
    grid-template-columns: 1fr;
  }
  .rs-total-num {
    font-size: 2rem;
  }
  .rs-ingreso-valor { font-size: 1.6rem; }
  .rs-ingreso-row.principal .rs-ingreso-valor { font-size: 2rem; }

  /* MODAL */
  .modal {
    padding: 24px 16px 32px;
  }

  /* CONFIG colores preview en mobile: apilados */
  .config-colores-preview-row {
    flex-direction: column;
  }
}
/* ══════════════════════════════════════════════
   PERFIL EXPANDIDO
══════════════════════════════════════════════ */

/* Hero del perfil */
.perfil-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #1e1e1e;
}

.perfil-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}

.perfil-hero-info {
  flex: 1;
  min-width: 0;
}

.perfil-hero-nombre {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f0f0f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.perfil-hero-meta {
  font-size: .76rem;
  color: #555;
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.perfil-hero-meta span {
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: .72rem;
  color: #666;
}

/* Tabs internos */
.perfil-tabs {
  display: flex;
  padding: 10px 16px 0;
  gap: 4px;
  border-bottom: 1px solid #1a1a1a;
}

.perfil-tab {
  padding: 8px 16px;
  font-family: 'Inter', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  color: #444;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  transition: color .15s, background .15s;
  user-select: none;
}

.perfil-tab:hover { color: #888; }

.perfil-tab.active {
  color: #f0f0f0;
  background: #1c1c1c;
  border-color: #282828;
}

/* Paneles internos */
.perfil-panel { display: none; }
.perfil-panel.active { display: block; }

/* Botones de sexo */
.perfil-sexo-row,
.perfil-nivel-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.perfil-sexo-btn,
.perfil-nivel-btn {
  flex: 1;
  min-width: 80px;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid #2a2a2a;
  background: #111;
  color: #555;
  font-family: 'Inter', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  text-align: center;
}

.perfil-sexo-btn:hover,
.perfil-nivel-btn:hover {
  color: #aaa;
  border-color: #444;
}

.perfil-sexo-btn.selected {
  background: rgba(59,130,246,.15);
  border-color: rgba(96,165,250,.5);
  color: #60a5fa;
}

.perfil-nivel-btn.selected {
  background: rgba(74,222,128,.1);
  border-color: rgba(74,222,128,.35);
  color: #4ade80;
}

/* Badge de edad */
#perfil-edad-badge {
  font-size: .72rem;
  background: rgba(96,165,250,.15);
  border: 1px solid rgba(96,165,250,.3);
  color: #60a5fa;
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 600;
}


/* ══════════════════════════════════════════════
   SUB-TABS DEL RESUMEN
══════════════════════════════════════════════ */

.resumen-subtabs {
  display: flex;
  gap: 6px;
  padding: 10px 14px 0;
  background: var(--bg);
  border-bottom: 1px solid #1a1a1a;
}

.resumen-subtab {
  padding: 10px 18px;
  font-family: 'Inter', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  color: #444;
  cursor: pointer;
  border-radius: 10px 10px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  transition: color .15s, background .15s;
  user-select: none;
}

.resumen-subtab:hover { color: #888; }

.resumen-subtab.active {
  color: #f0f0f0;
  background: var(--surface);
  border-color: #282828;
}


/* ══════════════════════════════════════════════
   MÉTRICAS — Dashboard profesional
══════════════════════════════════════════════ */

#metricas-content {
  padding: 0 0 80px;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 860px;
  margin: 0 auto;
}

/* Header del dashboard */
.dash-header {
  padding: 20px 18px 14px;
  border-bottom: 1px solid #171717;
}

.dash-header-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: .65rem;
  font-weight: 700;
  color: #333;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.dash-header-subtitle {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #e0e0e0;
  margin-top: 2px;
}

/* Grid de KPI cards superiores */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid #171717;
}

.dash-kpi {
  padding: 18px 16px;
  border-right: 1px solid #171717;
  position: relative;
  transition: background .15s;
}

.dash-kpi:last-child { border-right: none; }
.dash-kpi:hover { background: rgba(255,255,255,.018); }

.dash-kpi-label {
  font-size: .62rem;
  font-weight: 700;
  color: #3a3a3a;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 8px;
}

.dash-kpi-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: #f0f0f0;
}

.dash-kpi-value.accent-green { color: #4ade80; }
.dash-kpi-value.accent-blue  { color: #60a5fa; }
.dash-kpi-value.accent-red   { color: #f87171; }
.dash-kpi-value.accent-amber { color: #fbbf24; }

.dash-kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 6px;
  font-size: .7rem;
  font-weight: 600;
  color: #333;
}

.dash-kpi-delta.up   { color: #4ade80; }
.dash-kpi-delta.down { color: #f87171; }

.dash-kpi-sub {
  font-size: .7rem;
  color: #383838;
  margin-top: 5px;
  line-height: 1.3;
}

/* Barra de progreso inline dentro de KPI */
.dash-kpi-progress {
  margin-top: 10px;
  height: 2px;
  background: #1e1e1e;
  border-radius: 99px;
  overflow: hidden;
}

.dash-kpi-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .5s ease;
}

/* Sección de dos columnas */
.dash-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #171717;
}

.dash-panel {
  padding: 20px 18px;
  border-right: 1px solid #171717;
}

.dash-panel:last-child { border-right: none; }

/* Sección de una columna full */
.dash-full {
  padding: 20px 18px;
  border-bottom: 1px solid #171717;
}

/* Títulos de sección internos */
.dash-section-label {
  font-size: .62rem;
  font-weight: 700;
  color: #333;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-section-label span {
  font-size: .68rem;
  font-weight: 600;
  color: #2a2a2a;
  text-transform: none;
  letter-spacing: 0;
}

/* Barras horizontales */
.dash-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
}

.dash-bar-row:last-child { margin-bottom: 0; }

.dash-bar-label {
  font-size: .8rem;
  color: #666;
  width: 72px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-bar-track {
  flex: 1;
  height: 6px;
  background: #1a1a1a;
  border-radius: 99px;
  overflow: hidden;
}

.dash-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .5s ease;
}

.dash-bar-pct {
  font-family: 'Space Grotesk', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  color: #555;
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

.dash-bar-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  color: #888;
  width: 22px;
  text-align: right;
  flex-shrink: 0;
}

/* Tabla de inscripciones por mes */
.dash-month-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #161616;
}

.dash-month-row:last-child { border-bottom: none; }

.dash-month-name {
  font-size: .82rem;
  color: #777;
  width: 130px;
  flex-shrink: 0;
}

.dash-month-bar-wrap {
  flex: 1;
  height: 4px;
  background: #181818;
  border-radius: 99px;
  overflow: hidden;
}

.dash-month-bar {
  height: 100%;
  background: #60a5fa;
  border-radius: 99px;
  transition: width .5s ease;
}

.dash-month-bar.is-max { background: #4ade80; }
.dash-month-bar.is-min { background: #f87171; }

.dash-month-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  color: #444;
  width: 24px;
  text-align: right;
  flex-shrink: 0;
}

.dash-month-badge {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.dash-month-badge.max { background: rgba(74,222,128,.1); color: #4ade80; border: 1px solid rgba(74,222,128,.2); }
.dash-month-badge.min { background: rgba(248,113,113,.1); color: #f87171; border: 1px solid rgba(248,113,113,.2); }

/* Stat fila simple */
.dash-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid #161616;
}

.dash-stat-row:last-child { border-bottom: none; }

.dash-stat-name {
  font-size: .82rem;
  color: #666;
}

.dash-stat-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: .9rem;
  font-weight: 700;
  color: #ccc;
}

/* Empty state */
.dash-empty {
  padding: 60px 24px;
  text-align: center;
  color: #2a2a2a;
  font-size: .9rem;
  letter-spacing: .02em;
}

.dash-empty-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #2e2e2e;
  margin-bottom: 6px;
}

/* Donut chart wrapper */
.dash-donut-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

.dash-donut-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-legend-name {
  font-size: .78rem;
  color: #666;
  flex: 1;
}

.dash-legend-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: .8rem;
  font-weight: 700;
  color: #888;
}

@media (max-width: 600px) {
  .dash-kpi-grid { grid-template-columns: 1fr 1fr; }
  .dash-two-col  { grid-template-columns: 1fr; }
  .dash-kpi      { border-bottom: 1px solid #171717; }
  .dash-kpi-value { font-size: 1.6rem; }
}

/* ── CONFIG BLOQUE PRINCIPAL ── */
.config-bloque-principal {
  background: #0e0e0e;
  border: 1px solid #f97316;
  border-radius: 16px;
  padding: 16px 16px 18px;
  margin-bottom: 4px;
  position: relative;
}

.config-bloque-label {
  font-size: .6rem;
  font-weight: 700;
  color: #f97316;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 14px;
}

.config-bloque-principal .pt-input {
  background: #141414;
  border-color: #1e1e1e;
}

.config-bloque-principal .pt-input:focus {
  border-color: rgba(249,115,22,.4);
}

/* ── INSIGHTS ── */
.dash-insights {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-insight-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: #0e0e0e;
  border: 1px solid #1a1a1a;
  border-radius: 10px;
}

.dash-insight-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.dash-insight-text {
  font-size: .82rem;
  color: #666;
  line-height: 1.5;
}

.dash-insight-text strong {
  color: #aaa;
  font-weight: 700;
}

/* ── SEXO BARS ── */
.dash-sexo-bars { display: flex; flex-direction: column; gap: 10px; }
.dash-sexo-bar-row { display: flex; align-items: center; gap: 10px; }
.dash-sexo-label { font-size: .7rem; font-weight: 700; color: #444; width: 16px; flex-shrink: 0; letter-spacing: .04em; text-transform: uppercase; }
.dash-sexo-track { flex: 1; height: 8px; background: #1a1a1a; border-radius: 99px; overflow: hidden; }
.dash-sexo-fill  { height: 100%; border-radius: 99px; transition: width .5s ease; }
.dash-sexo-stat  { display: flex; gap: 6px; align-items: baseline; width: 64px; flex-shrink: 0; }
.dash-sexo-stat strong { font-family: 'Space Grotesk', sans-serif; font-size: .88rem; font-weight: 700; color: #ccc; }
.dash-sexo-stat span   { font-size: .72rem; color: #3a3a3a; }

/* ── INSIGHT PILL ── */
.dash-insight-pill {
  font-size: .75rem;
  color: #555;
  background: #141414;
  border: 1px solid #1e1e1e;
  border-radius: 8px;
  padding: 7px 10px;
  line-height: 1.4;
}
.dash-insight-pill strong { color: #aaa; font-weight: 700; }

/* ── NO DATA ── */
.dash-no-data { font-size: .75rem; color: #2a2a2a; padding: 4px 0; }

/* ── BADGE CUR ── */
.dash-month-badge.cur { background: rgba(96,165,250,.08); color: #60a5fa; border: 1px solid rgba(96,165,250,.18); }

/* ── BAR PCT ── */
.dash-bar-pct {
  font-family: 'Space Grotesk', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  color: #777;
  width: 64px;
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
}
