/* =========================================================
   NEXUS · estilos de Club (cliente) y Panel del equipo
   Se carga después de styles.css
   ========================================================= */

/* ---------- Fondo con brillo, como la portada ---------- */
.glow-bg { position: relative; isolation: isolate; }
.glow-bg::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 85% 10%, rgba(201,168,106,.14), transparent 70%),
    radial-gradient(ellipse 40% 35% at 0% 100%, rgba(201,168,106,.06), transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 119px, rgba(255,255,255,.025) 119px 120px);
}
.outline { color: transparent; -webkit-text-stroke: 1.2px var(--text); }

/* ---------- Panel genérico ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.panel h3 { font-size: 24px; margin-bottom: 18px; }
.panel + .panel { margin-top: 20px; }
@media (max-width: 600px) { .panel { padding: 22px 18px; } }
.panel-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.panel-title h3 { margin: 0; }
.panel-title span { font-size: 12px; color: var(--muted); letter-spacing: .08em; }

/* ---------- Botones extra ---------- */
.btn-xl { height: 72px; font-size: 16px; letter-spacing: .16em; border-radius: 8px; }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-ghost:hover { border-color: var(--line-2); color: var(--text); }
.btn-danger { color: var(--err); border-color: rgba(224,128,110,.35); }
.btn-danger:hover { border-color: var(--err); }
.btn-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.btn .ico { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Progreso ---------- */
.progress-wrap { margin-top: 22px; }
.progress-bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: linear-gradient(90deg, #a98a50, var(--accent)); border-radius: 6px; transition: width .6s ease; }
.progress-meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 14px; color: var(--muted); }
.progress-meta b { color: var(--text); font-weight: 600; }
.progress-meta em { font-style: normal; color: var(--accent); }

/* ---------- Tarjeta grande ---------- */
.lcard.big { max-width: 520px; padding: 30px 32px; border-radius: 18px; }
.lcard.big .lcard-top b { font-size: 28px; }
.lcard.big .stamps { gap: 10px; }
@media (max-width: 480px) { .lcard.big { padding: 22px; } }

/* ---------- Listas tipo feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; padding-bottom: 0; }
.feed li:first-child { padding-top: 0; }
.feed .dot { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 14px; background: var(--bg); border: 1px solid var(--line-2); color: var(--muted); }
.feed .dot.gold { background: rgba(201,168,106,.12); border-color: rgba(201,168,106,.4); color: var(--accent); }
.feed .dot.ok { background: rgba(127,181,138,.1); border-color: rgba(127,181,138,.35); color: var(--ok); }
.feed .txt { flex: 1; min-width: 0; }
.feed .txt b { display: block; font-weight: 500; font-size: 15px; }
.feed .txt span { font-size: 12px; color: var(--dim); }
.empty { color: var(--dim); font-size: 14px; padding: 8px 0; }

/* =========================================================
   CLUB (cliente)
   ========================================================= */
.club-hero { padding: 72px 0 96px; border: 0; min-height: calc(100svh - 64px); }
.club-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 72px; align-items: start; }
.club-hero h1 { font-size: clamp(64px, 10vw, 140px); }
.club-hero .lead { margin: 26px 0 40px; }
.steps { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); max-width: 520px; }
.steps li { display: grid; grid-template-columns: 54px 1fr; gap: 12px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.steps b { font-family: var(--display); font-size: 28px; color: var(--accent); line-height: 1; }
.steps strong { display: block; font-weight: 600; margin-bottom: 4px; }
.steps span { color: var(--muted); font-size: 14px; }
.auth-card { position: sticky; top: 96px; }
.auth-card .tabs { margin: 0 0 26px; }
@media (max-width: 920px) {
  .club-hero { padding: 48px 0 72px; min-height: 0; }
  .club-grid { grid-template-columns: 1fr; gap: 44px; }
  .auth-card { position: static; }
}

/* Dashboard del socio */
.member-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.member-head h1 { font-size: clamp(48px, 8vw, 96px); }
.member-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: start; }
@media (max-width: 920px) { .member-grid { grid-template-columns: 1fr; gap: 24px; } }
.howto { display: flex; gap: 16px; align-items: center; margin-top: 24px; padding: 18px 20px; border: 1px dashed var(--line-2); border-radius: 10px; }
.howto .code { font-family: var(--display); font-weight: 800; font-size: 30px; color: var(--accent); letter-spacing: .06em; white-space: nowrap; }
.howto p { margin: 0; font-size: 14px; color: var(--muted); }
.wallet-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 24px 0 0; }
.wallet-btns .btn { background: #000; border-color: #333; text-transform: none; letter-spacing: .02em; font-size: 14px; }
@media (max-width: 480px) { .wallet-btns { grid-template-columns: 1fr; } }
.switch { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.switch p { margin: 0; font-size: 14px; color: var(--muted); }
.switch b { display: block; color: var(--text); font-weight: 500; font-size: 15px; margin-bottom: 2px; }
.toggle { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.toggle input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; margin: 0; }
.toggle i { position: absolute; inset: 0; border-radius: 28px; background: var(--line-2); transition: background .2s; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); transition: transform .2s; }
.toggle input:checked + i { background: var(--accent); }
.toggle input:checked + i::after { transform: translateX(20px); background: var(--accent-ink); }
.toggle input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.account-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* =========================================================
   PANEL DEL EQUIPO
   ========================================================= */
body.staff { background: var(--bg); }
.staff-login { min-height: 100svh; display: grid; grid-template-columns: 1fr 1fr; }
.staff-login .brandside { padding: 56px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); }
.staff-login .brandside h1 { font-size: clamp(64px, 8vw, 120px); }
.staff-login .formside { display: grid; place-items: center; padding: 40px 24px; }
.staff-login form { width: 100%; max-width: 400px; }
@media (max-width: 860px) {
  .staff-login { grid-template-columns: 1fr; }
  .staff-login .brandside { padding: 32px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .staff-login .brandside h1 { font-size: 64px; }
  .staff-login .brandside .hide-m { display: none; }
}

.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100svh; }
.side { position: sticky; top: 0; height: 100svh; border-right: 1px solid var(--line); padding: 28px 18px; display: flex; flex-direction: column; background: var(--bg-2); }
.side .brand { padding: 0 10px 28px; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav button { display: flex; align-items: center; gap: 12px; padding: 12px 12px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 500; text-align: left; }
.side nav button:hover { color: var(--text); background: rgba(255,255,255,.03); }
.side nav button.on { color: var(--text); background: var(--surface); box-shadow: inset 2px 0 0 var(--accent); }
.side nav svg { width: 20px; height: 20px; }
.side .me { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.side .me .txt { flex: 1; min-width: 0; font-size: 13px; }
.side .me .txt b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .me .txt span { color: var(--dim); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: .04em; background: linear-gradient(145deg, #2a2823, #17171a); border: 1px solid #3a372f; color: var(--accent); }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }

.main { padding: 36px 40px 64px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head h1 { font-size: clamp(40px, 5vw, 64px); }
.page-head p { margin: 8px 0 0; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.kpi b { display: block; font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; color: var(--text); }
.kpi span { font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.kpi.gold b { color: var(--accent); }

.split2 { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 24px; align-items: start; }
.listcol { position: sticky; top: 24px; }
.searchbox { position: relative; margin-bottom: 14px; }
.searchbox svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--dim); pointer-events: none; }
.searchbox .input { padding-left: 46px; height: 52px; border-radius: 8px; }
.mlist { display: flex; flex-direction: column; gap: 8px; max-height: calc(100svh - 300px); overflow: auto; padding-right: 2px; }
.mrow { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; width: 100%; transition: border-color .15s, background .15s; }
.mrow:hover { border-color: var(--line-2); }
.mrow.on { border-color: var(--accent); background: rgba(201,168,106,.06); }
.mrow .txt { flex: 1; min-width: 0; }
.mrow .txt b { display: block; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow .txt span { font-size: 12px; color: var(--dim); }
.pill { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 100px; background: var(--bg); border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.pill.gold { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

.detail-empty { display: grid; place-items: center; text-align: center; min-height: 420px; border: 1px dashed var(--line-2); border-radius: 10px; color: var(--dim); padding: 40px; }
.detail-empty svg { width: 44px; height: 44px; margin: 0 auto 16px; color: var(--line-2); }
.dhead { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.dhead h2 { font-size: 36px; }
.dhead .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1280px) { .dgrid { grid-template-columns: 1fr; } }
.back-m { display: none; }

/* Mensajes */
.compose textarea.input { min-height: 120px; font-size: 16px; }
.compose .foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.bubble { background: var(--bg); border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; padding: 14px 16px; }
.bubble p { margin: 0 0 8px; }
.bubble span { font-size: 12px; color: var(--dim); }
.bubbles { display: flex; flex-direction: column; gap: 10px; }
.msg-preview { display: flex; gap: 12px; align-items: flex-start; background: #1f1f22; border-radius: 14px; padding: 14px; border: 1px solid var(--line-2); margin-top: 14px; }
.msg-preview .ic { width: 38px; height: 38px; border-radius: 9px; background: var(--bg); display: grid; place-items: center; font-family: var(--display); font-weight: 800; color: var(--accent); flex-shrink: 0; border: 1px solid var(--line-2); }
.msg-preview b { font-size: 13px; display: block; }
.msg-preview p { margin: 2px 0 0; font-size: 14px; color: var(--muted); word-break: break-word; }

/* Ajustes */
.sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .sgrid { grid-template-columns: 1fr; } }
.acc { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.acc:last-of-type { border-bottom: 0; }
.acc .txt { flex: 1; min-width: 0; }
.acc .txt b { display: block; font-weight: 600; }
.acc .txt span { font-size: 12px; color: var(--dim); }
.acc.off { opacity: .5; }
.tag { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; border: 1px solid rgba(201,168,106,.4); color: var(--accent); margin-left: 6px; vertical-align: middle; }

/* Barra inferior móvil */
.tabbar { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .mtop { display: flex !important; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi b { font-size: 32px; }
  .split2 { grid-template-columns: 1fr; }
  .listcol { position: static; }
  .mlist { max-height: none; }
  .split2.show-detail .listcol { display: none; }
  .split2:not(.show-detail) .detailcol { display: none; }
  .back-m { display: inline-flex; margin-bottom: 16px; }
  .tabbar { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: rgba(18,18,20,.94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
  .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; color: var(--dim); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 6px 0; cursor: pointer; }
  .tabbar button.on { color: var(--accent); }
  .tabbar svg { width: 22px; height: 22px; }
}
.mtop { display: none; justify-content: space-between; align-items: center; margin-bottom: 20px; }

/* ---------- Diálogo ---------- */
.modal-back { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.66); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fade .2s ease; }
.modal { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 28px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.9); }
.modal h3 { font-size: 28px; margin-bottom: 10px; }
.modal p { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.modal .actions { display: flex; gap: 10px; margin-top: 22px; }
.modal .actions .btn { flex: 1; }

/* Ajustes finos */
.input.pin::placeholder { letter-spacing: normal; }
.btn-row .btn { font-size: 11px; letter-spacing: .1em; padding: 0 8px; white-space: nowrap; height: 44px; }
.panel-title { flex-wrap: wrap; }
@media (max-width: 1440px) { .dgrid { grid-template-columns: 1fr; } .dgrid .lcard, .dgrid .progress-wrap, .dgrid > div:first-child { max-width: 560px; } }
@media (max-width: 900px) {
  #p-members.detail-open .page-head, #p-members.detail-open .kpis { display: none; }
  .dhead h2 { font-size: 30px; }
}
.sgrid > .panel, .split2 .panel, .dgrid > .panel { margin-top: 0; }
