:root {
  --ink: #16202b;
  --muted: #5b6773;
  --bg: #f5f7f9;
  --surface: #ffffff;
  --border: #e3e8ee;
  --accent: #059669;
  --accent-dark: #047857;
  --accent-bright: #10b981;
  --success: #1f9d6b;
  --warning: #b26a00;
  --danger: #c0392b;
  --shadow: 0 1px 2px rgba(16,32,43,.06), 0 8px 24px rgba(16,32,43,.06);
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.5; }
h1, h2, h3 { margin: 0 0 .2em; font-weight: 650; letter-spacing: -.01em; }
a { color: var(--accent); }
button { font-family: inherit; }

/* ── Login ── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 32px; width: 100%; max-width: 380px; }
.login-card .brand { display: block; text-align: center; font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.login-card .sub { color: var(--muted); margin-bottom: 20px; }

/* ── Header / navegación ── */
.topbar {
  background: #131b25;
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 62px; padding: 0 max(24px, calc((100% - 1160px) / 2));
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.tb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar .brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: -.01em; color: #fff; text-decoration: none; font-size: 16.5px; }
.brand-logo { flex: 0 0 auto; }
.lg-bg { fill: var(--accent-bright); }
.lg-bolt { fill: #fff; }
.brand-text { white-space: nowrap; }
.login-logo { display: flex; justify-content: center; margin-bottom: 14px; }
.login-logo svg { filter: drop-shadow(0 6px 14px rgba(16,32,43,.18)); }

/* Cabecera de "Mi perfil" */
.profile-head { display: flex; align-items: center; gap: 18px; padding: 22px; }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; flex: 0 0 auto; }
.profile-name { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.profile-mail { color: var(--muted); margin-top: 2px; }

.tb-burger { display: none; background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; padding: 6px 8px; line-height: 1; border-radius: 9px; }
.tb-burger:hover { background: rgba(255,255,255,.09); }

.tb-nav { display: flex; align-items: center; gap: 2px; }
.tb-link { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: #c1cbd5; font: inherit; font-size: 14.5px; font-weight: 500; padding: 8px 14px; border-radius: 9px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, color .15s; }
.tb-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.tb-link.active { color: #fff; background: rgba(255,255,255,.10); font-weight: 600; }
.tb-chev { width: 15px; height: 15px; opacity: .65; transition: transform .18s ease; }
.tb-dd.open > .tb-dd-btn .tb-chev { transform: rotate(180deg); opacity: .9; }

.tb-dd { position: relative; }
.tb-dd-menu { position: absolute; top: calc(100% + 12px); left: 0; min-width: 224px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 34px rgba(16,32,43,.18); padding: 8px; display: none; z-index: 60; }
.tb-dd-menu::before { content: ""; position: absolute; top: -6px; left: 22px; width: 12px; height: 12px; background: var(--surface); border-left: 1px solid var(--border); border-top: 1px solid var(--border); transform: rotate(45deg); border-radius: 3px 0 0 0; }
.tb-dd.open .tb-dd-menu { display: block; animation: ddIn .15s ease; }
@keyframes ddIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.tb-dd-menu.tb-dd-right { left: auto; right: 0; }
.tb-dd-menu.tb-dd-right::before { left: auto; right: 24px; }
.tb-dd-menu a, .tb-dd-menu button { display: flex; align-items: center; width: 100%; text-align: left; padding: 10px 12px; border-radius: 9px; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; background: none; border: none; cursor: pointer; text-decoration: none; }
.tb-dd-menu a:hover, .tb-dd-menu button:hover { background: #eef4f3; }
.tb-dd-menu a.active { color: var(--accent); font-weight: 600; background: #eef4f3; }
.tb-dd-head { padding: 8px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; font-weight: 700; color: var(--ink); font-size: 14px; }
.tb-dd-sub { font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 3px; word-break: break-all; }
.tb-logout { color: var(--danger) !important; }

/* Usuario como "chip" */
.tb-user > .tb-dd-btn { color: #fff; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); border-radius: 11px; padding: 5px 11px 5px 5px; gap: 9px; }
.tb-user > .tb-dd-btn:hover { background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.16); }
.tb-avatar { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--accent-bright), var(--accent)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.tb-uname { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
.tb-user .role-badge { background: rgba(255,255,255,.14); color: #dfe7ee; }
.role-badge { background: var(--accent); color: #fff; border-radius: 999px; padding: 3px 9px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.container { max-width: 1160px; margin: 0 auto; padding: 20px; }

/* ── Controles ── */
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
input, select { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff; color: var(--ink); }
/* Misma altura para inputs de texto/fecha y selects (los checkbox/radio se excluyen) */
input:not([type=checkbox]):not([type=radio]), select { height: 40px; line-height: 1.35; }
/* Select con la misma estética que los inputs + flecha propia (evita el render nativo) */
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%235b6773' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4.5l3.5 3.5 3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
}
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; padding: 0; margin: 0; cursor: pointer; accent-color: var(--accent); vertical-align: middle; border-radius: 5px; }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; font-size: 14px; }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--border); }
.btn.secondary:hover { background: #f0f3f6; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.danger { background: var(--danger); border-color: var(--danger); }

/* ── Botones de acción por icono (tablas) ── */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.icon-btn + .icon-btn { margin-left: 6px; }
.icon-btn svg { width: 17px; height: 17px; display: block; }
.icon-btn:hover { background: #f0f3f6; color: var(--ink); border-color: #cfd6de; }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn:disabled:hover { background: #fff; color: var(--muted); border-color: var(--border); }
.icon-btn.edit:hover { color: var(--accent); border-color: var(--accent); background: #e9f6f1; }
.icon-btn.enable:hover { color: var(--success); border-color: var(--success); background: #e6f6ef; }
.icon-btn.disable:hover { color: var(--warning); border-color: var(--warning); background: #fdf3e3; }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); background: #fdecea; }

/* ── Toolbar del listado ── */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; margin: 18px 0; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filters .field { min-width: 140px; }
.filters .field.search { min-width: 220px; }

/* ── Tabla ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { background: #fafbfc; color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafcfc; }
.mono { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* ── Pills de estado ── */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.pending { color: var(--warning); background: #fdf3e3; }
.pill.success { color: var(--success); background: #e6f6ef; }
.pill.failure { color: var(--danger); background: #fdecea; }
.pill.neutral { color: var(--muted); background: #eef1f4; }
.pill.completed { color: var(--success); background: #e6f6ef; }
.pill.in_progress { color: var(--accent); background: #e4efee; }
.pill.cancelled { color: var(--muted); background: #eef1f4; }
.pill.error { color: var(--danger); background: #fdecea; }

/* ── Paginación ── */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; color: var(--muted); font-size: 13px; }
.pager .pages { display: flex; gap: 6px; }

/* ── Modal / asistente ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16,32,43,.5); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 10px; }
.x { background: none; border: none; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; }

/* Stepper (elemento distintivo: dos fases) */
.stepper { display: flex; align-items: center; gap: 7px; margin-bottom: 20px; flex-wrap: wrap; }
.stepper .step { display: inline-flex; align-items: center; }
/* Círculo con el número (pasos anteriores) */
.stepper .step .n { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; border: 1px solid var(--border); background: #fff; color: var(--muted); }
.stepper .step.done .n { background: var(--success); border-color: var(--success); color: #fff; }
/* Paso actual: pastilla desplegada con número + nombre */
.stepper .step.current { background: var(--accent); color: #fff; border-radius: 999px; padding: 3px 14px 3px 3px; gap: 8px; }
.stepper .step.current .n { background: #fff; color: var(--accent); border-color: #fff; }
.stepper .step.current .t { font-size: 13px; font-weight: 600; }
/* Pasos siguientes: solo un punto discreto */
.stepper .step.future .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); display: inline-block; margin: 0 4px; }
.stepper-count { margin-left: auto; font-size: 12px; color: var(--muted); }

.field-row { margin-bottom: 16px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Estado de fase en el asistente */
.phase-status { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 14px; }
.spinner { width: 20px; height: 20px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dropzone { position: relative; border: 2px dashed var(--border); border-radius: 10px; padding: 22px 16px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover { border-color: var(--accent); background: #fafcfc; }
.dropzone.dragover { border-color: var(--accent); background: #e9f4f3; color: var(--accent-dark); }
.dropzone.filled { border-style: solid; border-color: var(--accent); background: #f3f9f8; }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone .dz-icon { font-size: 22px; line-height: 1; }
.dropzone .dz-text { font-size: 13px; margin-top: 6px; }
.dropzone .fname { color: var(--ink); font-weight: 600; margin-top: 6px; word-break: break-all; }

/* Combobox con buscador */
.combo { position: relative; }
.combo-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); max-height: 240px; overflow: auto; }
.combo-opt { padding: 9px 12px; cursor: pointer; font-size: 14px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.combo-opt:hover { background: #f0f3f6; }
.combo-empty { padding: 9px 12px; color: var(--muted); font-size: 13px; }

.alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.alert.error { background: #fdecea; color: var(--danger); }
.alert.info { background: #e4efee; color: var(--accent-dark); }

.downloads { display: flex; flex-wrap: wrap; gap: 8px; }
.hidden { display: none !important; }

/* Placeholder "esqueleto" con brillo mientras carga */
.skel { display: inline-block; border-radius: 8px; background: linear-gradient(90deg, #eef1f4 25%, #e0e6ec 37%, #eef1f4 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
.skel-btn { width: 132px; height: 36px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* Toasts (notificaciones flotantes) */
.toast-container { position: fixed; top: 72px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; background: #fff; color: var(--ink); border-left: 4px solid var(--muted); max-width: 360px; opacity: 0; transform: translateX(24px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: none; }
.toast .ti { font-size: 16px; line-height: 1; }
.toast.error { border-color: var(--danger); } .toast.error .ti { color: var(--danger); }
.toast.info { border-color: var(--accent); } .toast.info .ti { color: var(--accent); }
.toast.success { border-color: var(--success); } .toast.success .ti { color: var(--success); }

/* Interruptor on/off */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #cbd3db; border-radius: 999px; transition: background .15s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(16,32,43,.3); transition: transform .15s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Responsive: menú colapsable en móvil/tablet ── */
@media (max-width: 820px) {
  .tb-burger { display: inline-block; }
  .tb-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--ink); padding: 8px; z-index: 60; box-shadow: var(--shadow);
    border-top: 1px solid rgba(255,255,255,.08);
  }
  .tb-nav.open { display: flex; }
  .tb-link { padding: 12px 14px; }
  .tb-user { margin-top: 4px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 4px; }
  .tb-user .tb-dd-btn { justify-content: flex-start; }
  .tb-uname { max-width: none; }
  /* submenús desplegados inline dentro del panel oscuro */
  .tb-dd { position: static; }
  .tb-dd-menu { position: static; box-shadow: none; border: none; background: rgba(255,255,255,.05); margin: 2px 0 6px; padding: 4px; min-width: 0; animation: none; }
  .tb-dd-menu::before { display: none; }
  .tb-dd-menu.tb-dd-right { right: auto; }
  .tb-user > .tb-dd-btn { background: none; border: none; border-radius: 9px; padding: 10px 12px; width: 100%; }
  .tb-dd-menu a, .tb-dd-menu button { color: #dfe6ec; }
  .tb-dd-menu a:hover, .tb-dd-menu button:hover { background: rgba(255,255,255,.08); }
  .tb-dd-menu a.active { color: #fff; }
  .tb-dd-head { color: #fff; border-color: rgba(255,255,255,.1); }
  .tb-dd-sub { color: #9aa6b2; }
}

@media (max-width: 640px) {
  .filters .field { min-width: 120px; }
  th.hide-sm, td.hide-sm { display: none; }
  .container { padding: 14px; }
  .brand-text { font-size: 15px; }
  .modal { max-width: 100%; }
  /* tablas con scroll horizontal dentro de la tarjeta */
  .card > table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ════════════════ Programa de puntos (vista simulada) ════════════════ */

/* Aviso de simulación / debug */
.sim-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; background: #fff3d6; color: #8a5a00; border: 1px solid #f0d795; }
.sim-badge.sim-debug { background: #ffe1e1; color: #a12622; border-color: #f3b9b6; margin-left: 6px; }
.pt-hero .sim-badge { background: rgba(255,214,120,.16); color: #ffd678; border-color: rgba(255,214,120,.35); }
.pt-hero .sim-badge.sim-debug { background: rgba(255,120,120,.16); color: #ff9a94; border-color: rgba(255,120,120,.35); }
.debug-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ffb020; margin-left: 4px; box-shadow: 0 0 0 0 rgba(255,176,32,.55); animation: debugPulse 1.6s infinite; vertical-align: middle; }
@keyframes debugPulse { 0% { box-shadow: 0 0 0 0 rgba(255,176,32,.55); } 70% { box-shadow: 0 0 0 7px rgba(255,176,32,0); } 100% { box-shadow: 0 0 0 0 rgba(255,176,32,0); } }

/* ── Héroe (dashboard de /app y cabecera de /puntos) ── */
.pt-hero { background: radial-gradient(1200px 420px at 8% -20%, #1d3a34 0%, transparent 60%), radial-gradient(900px 380px at 100% 0%, #16283c 0%, transparent 55%), linear-gradient(160deg, #101a24 0%, #0d1620 100%); color: #eef4f8; border: 1px solid #24313e; padding: 24px 26px; margin: 18px 0; overflow: visible; }
.pt-hero-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pt-hero-title { font-size: 20px; font-weight: 750; letter-spacing: -.01em; }
.pt-mes { color: #9fb2c0; font-weight: 500; }
.pt-hero-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.pt-hero-sub .hint { color: #8ea3ad; margin: 0; }
.pt-hero-right { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.pt-hero-main { display: flex; gap: 30px; align-items: stretch; margin-bottom: 18px; }

.pt-selector label { color: #8ea3ad; }
.pt-selector select { background-color: rgba(255,255,255,.06); border-color: #2c3a47; color: #eef4f8; min-width: 230px; }
.pt-selector select:focus { border-color: var(--accent-bright); }
.pt-selector .hint { color: #ffd678; max-width: 260px; }

/* Marcador grande de puntos + nivel */
.pt-score { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 18px 30px; border-radius: 16px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.09); min-width: 190px; }
.pt-score-num { font-size: 52px; font-weight: 800; letter-spacing: -.03em; line-height: 1; background: linear-gradient(180deg, #fff, #b9f6dd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pt-score-num.neg { background: linear-gradient(180deg, #ffd7d2, #ff8f85); -webkit-background-clip: text; background-clip: text; }
.pt-score-label { font-size: 12px; color: #9fb2c0; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.pt-hero-progress { flex: 1 1 auto; display: flex; flex-direction: column; gap: 16px; justify-content: center; min-width: 0; }

/* Insignias de nivel (degradados "metálicos") */
.nivel-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; border: 1px solid transparent; box-shadow: 0 2px 10px rgba(0,0,0,.22); }
.nivel-badge.grande { font-size: 14.5px; padding: 7px 18px; margin-top: 6px; }
.nivel-badge .nv-ico { font-size: 1.1em; }
.nv-negativo { background: linear-gradient(135deg, #7d1f18, #b03a30); color: #ffe3e0; border-color: #c96058; }
.nv-estandar { background: linear-gradient(135deg, #3c4a57, #5b6b79); color: #eef4f8; border-color: #74838f; }
.nv-bronce   { background: linear-gradient(135deg, #6d4423, #b0713b 55%, #d99a5b); color: #fff2e3; border-color: #c98d55; }
.nv-plata    { background: linear-gradient(135deg, #6f7d8a, #aebbc6 55%, #e6edf2); color: #232f38; border-color: #c3cfd8; }
.nv-oro      { background: linear-gradient(135deg, #8a6410, #d4a017 55%, #f6d365); color: #3b2c00; border-color: #e5bd4a; }
.nv-platino  { background: linear-gradient(135deg, #4d6d6a, #8fb8b3 55%, #dff5f1); color: #14332f; border-color: #a9d1cb; }
.nv-diamante { background: linear-gradient(135deg, #1c4d8f, #2e86c9 45%, #7fd4f5 80%, #c8f3ff); color: #06263c; border-color: #6ec2e8; box-shadow: 0 2px 14px rgba(88,182,235,.45); }

/* Barra de progreso hacia el siguiente nivel (fondo oscuro) */
.nivel-progress { width: 100%; }
.np-track { height: 14px; border-radius: 999px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.10); overflow: hidden; }
.np-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-bright), #7ff0c2); box-shadow: 0 0 14px rgba(16,185,129,.55); transition: width .6s cubic-bezier(.2,.8,.25,1); }
.np-legend { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; font-size: 12.5px; color: #9fb2c0; flex-wrap: wrap; }
.np-legend strong { color: #eef4f8; }

/* Tiles de estadística (fondo oscuro) */
.pt-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.pt-tile { border-radius: 12px; padding: 12px 14px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.08); border-top: 3px solid transparent; }
.pt-tile-ico { font-size: 16px; }
.pt-tile-val { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.pt-tile-label { font-size: 11px; color: #9fb2c0; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-top: 2px; }
.pt-tile-sub { font-size: 11.5px; color: #7d92a0; margin-top: 3px; }
.pt-tile.suma  { border-top-color: #34d399; } .pt-tile.suma .pt-tile-val  { color: #7ff0c2; }
.pt-tile.pend  { border-top-color: #fbbf24; } .pt-tile.pend .pt-tile-val  { color: #ffd678; }
.pt-tile.claw  { border-top-color: #f87171; } .pt-tile.claw .pt-tile-val  { color: #ff9a94; }
.pt-tile.canje { border-top-color: #a78bfa; } .pt-tile.canje .pt-tile-val { color: #c9b6ff; }
.pt-tile.disp  { border-top-color: #38bdf8; } .pt-tile.disp .pt-tile-val  { color: #8fd8ff; }

/* Panel claro de canjeo dentro del héroe */
.pt-hero-canje { background: #fff; color: var(--ink); border-radius: 14px; padding: 16px 20px 14px; box-shadow: 0 8px 26px rgba(0,0,0,.25); }
.pt-block-title { font-size: 15px; font-weight: 750; letter-spacing: -.01em; margin-bottom: 12px; }

/* ── Barra de canjeo con hitos de producto ── */
.cj-wrap { width: 100%; }
.cj-bar { position: relative; padding: 52px 14px 40px; }
.cj-hitos { position: absolute; top: 4px; left: 14px; right: 14px; height: 46px; }
.cj-hito { position: absolute; transform: translateX(-50%); text-align: center; width: 64px; opacity: .55; transition: opacity .2s; }
.cj-hito.ok { opacity: 1; }
.cj-hito-ico { font-size: 20px; line-height: 1; filter: grayscale(.7); }
.cj-hito.ok .cj-hito-ico { filter: none; }
.cj-hito-pts { font-size: 10.5px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.cj-hito.ok .cj-hito-pts { color: var(--accent-dark); }
.cj-hito::after { content: ""; position: absolute; left: 50%; top: calc(100% + 2px); width: 2px; height: 8px; background: var(--border); border-radius: 2px; }
.cj-hito.ok::after { background: var(--accent-bright); }
.cj-track { position: relative; height: 14px; border-radius: 999px; background: #edf1f5; border: 1px solid var(--border); }
.cj-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, #f6d365, #f2a65a 40%, var(--accent-bright)); box-shadow: 0 0 12px rgba(242,166,90,.4); transition: width .6s cubic-bezier(.2,.8,.25,1); }
.cj-cursor { position: absolute; top: calc(100% + 8px); transform: translateX(-50%); }
.cj-cursor span { display: inline-block; background: var(--ink); color: #fff; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; position: relative; }
.cj-cursor span::before { content: ""; position: absolute; left: 50%; top: -4px; transform: translateX(-50%) rotate(45deg); width: 8px; height: 8px; background: var(--ink); border-radius: 1px; }
.cj-msg { font-size: 13.5px; color: var(--ink); background: #f4f9f7; border: 1px solid #d9ece5; border-radius: 10px; padding: 10px 14px; margin-top: 4px; }

/* Tarjetas de catálogo */
.cj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.cj-prod { border: 1px solid var(--border); border-radius: 12px; padding: 14px 12px; text-align: center; background: #fbfcfd; transition: transform .15s, box-shadow .15s; }
.cj-prod:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cj-prod.ok { border-color: #bfe6d6; background: linear-gradient(180deg, #f2fbf7, #e9f7f1); box-shadow: 0 4px 14px rgba(16,185,129,.13); }
.cj-prod-ico { font-size: 30px; line-height: 1.1; }
.cj-prod-name { font-weight: 650; font-size: 13px; margin-top: 8px; }
.cj-prod-pts { font-size: 12.5px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.cj-prod-tag { display: inline-block; margin-top: 8px; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #eef1f4; color: var(--muted); }
.cj-prod-tag.ok { background: #d9f3e7; color: var(--accent-dark); }

/* ── Tarjetas de bloque de la página /puntos ── */
.pt-card { padding: 20px 22px; margin: 18px 0; overflow: visible; }
.pt-cols { display: grid; grid-template-columns: 1fr 1.5fr; gap: 18px; align-items: start; }
.pt-cols .pt-card { margin: 0; }

/* Escalera de niveles */
.nv-escalera { display: flex; align-items: stretch; gap: 4px; overflow-x: auto; padding: 6px 2px 10px; }
.nv-step { flex: 1 0 86px; text-align: center; border: 1px solid var(--border); border-radius: 12px; padding: 12px 6px; background: #fbfcfd; position: relative; }
.nv-step .nv-step-ico { font-size: 22px; filter: grayscale(.8); opacity: .6; }
.nv-step-name { font-size: 12px; font-weight: 750; margin-top: 5px; color: var(--muted); }
.nv-step-min { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.nv-step.alcanzado { background: #f2fbf7; border-color: #cdeade; }
.nv-step.alcanzado .nv-step-ico { filter: none; opacity: 1; }
.nv-step.alcanzado .nv-step-name { color: var(--accent-dark); }
.nv-step.actual { background: linear-gradient(180deg, #eafaf3, #dff5ec); border-color: var(--accent-bright); box-shadow: 0 0 0 3px rgba(16,185,129,.16), 0 6px 16px rgba(16,185,129,.14); transform: scale(1.04); z-index: 1; }
.nv-step.actual .nv-step-ico { filter: none; opacity: 1; font-size: 26px; }
.nv-step.actual .nv-step-name { color: var(--accent-dark); }
.nv-step.actual::before { content: "ESTÁS AQUÍ"; position: absolute; top: -9px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 8.5px; font-weight: 800; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.nv-sep { flex: 0 0 6px; align-self: center; height: 2px; background: var(--border); border-radius: 2px; }
.pt-nivel-msg { margin-top: 12px; font-size: 13.5px; background: #f4f9f7; border: 1px solid #d9ece5; border-radius: 10px; padding: 10px 14px; }

/* Avisos */
.pt-avisos { display: flex; flex-direction: column; gap: 9px; }
.pt-aviso { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border-radius: 10px; font-size: 13.5px; border: 1px solid var(--border); border-left-width: 4px; background: #fbfcfd; }
.pt-aviso-ico { font-size: 16px; line-height: 1.3; }
.pt-aviso.suma  { border-left-color: #34d399; background: #f2fbf7; }
.pt-aviso.pend  { border-left-color: #fbbf24; background: #fffaf0; }
.pt-aviso.claw  { border-left-color: #f87171; background: #fef4f3; }
.pt-aviso.canje { border-left-color: #a78bfa; background: #f8f6ff; }
.pt-aviso.reco  { border-left-color: #38bdf8; background: #f2faff; }

/* Chips de filtro y tabla de movimientos */
.pt-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.pt-chip { border: 1px solid var(--border); background: #fff; color: var(--muted); font-size: 12px; font-weight: 650; padding: 4px 12px; border-radius: 999px; cursor: pointer; transition: all .15s; }
.pt-chip:hover { border-color: var(--accent); color: var(--accent-dark); }
.pt-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pt-movs-wrap { margin: 0 -22px -20px; }
.pt-movs-wrap table { min-width: 480px; }
.pt-movs-wrap th:first-child, .pt-movs-wrap td:first-child { padding-left: 22px; }
.pt-movs-wrap th:last-child, .pt-movs-wrap td:last-child { padding-right: 22px; }
.pt-mov-pts { font-weight: 800; font-size: 13.5px; }
.pt-mov-pts.pos { color: var(--success); }
.pt-mov-pts.neg { color: var(--danger); }
.pt-mov-pts.pend { color: var(--warning); }
.pill.puntos-on { color: #8a5a00; background: #fff3d6; }

/* ── Página Inicio ── */
.inicio-saludo { margin: 22px 2px 0; }
.inicio-saludo h2 { font-size: 22px; }
.inicio-links { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 22px; }
.inicio-link { display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.inicio-link:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16,32,43,.10); }
.inicio-link .il-ico { font-size: 26px; flex: 0 0 auto; }
@media (max-width: 640px) { .inicio-links { grid-template-columns: 1fr; } }

/* Responsive del programa de puntos */
@media (max-width: 980px) {
  .pt-cols { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .pt-hero { padding: 18px; }
  .pt-hero-main { flex-direction: column; gap: 16px; }
  .pt-score { width: 100%; }
  .pt-score-num { font-size: 42px; }
  .cj-hito { width: 46px; }
  .cj-hito-pts { display: none; }
  .pt-movs-wrap { overflow-x: auto; }
}
