/* =========================================================================
   OIKOS · Portal de clientes (portal_cliente.php)
   Requiere oikos.css. Las clases del panel las arma el JavaScript de la página.
   ========================================================================= */

/* Alias que usa el JavaScript del portal en estilos en línea */
:root {
  --green: var(--ok);
  --blue2: var(--t1);
  --red: var(--error);
  --dark: var(--t1);
  --gray: var(--t2);
  --linea: var(--l2);
  --verde-osc: var(--ok);
}

.contenedor { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 28px); }
.oculto { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pg-portal .nav, .pg-portal .hero, .pg-portal .main, .pg-portal .seccion, .pg-portal .pie { position: relative; z-index: 1; }

/* ── Barra superior ────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: var(--z-nav);
  background: rgba(9, 9, 11, .72);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--l1);
}
.nav .contenedor { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.nav-brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; min-width: 0; }
.nav-brand img { height: 30px; width: auto; }
.nav-brand-text {
  padding-left: 14px; border-left: 1px solid var(--l2);
  font-family: var(--f-titulo); font-size: 15px; font-weight: 600; color: var(--t2); white-space: nowrap;
}
.nav-right { display: flex; align-items: center; gap: 6px; }
.nav-link {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: var(--r-sm);
  font-size: 14.5px; font-weight: 500; color: var(--t2); text-decoration: none;
  transition: color .2s ease, background-color .2s ease;
}
.nav-link:hover { color: var(--t1); background: rgba(255, 255, 255, .04); }
.nav-wsp { --alto: 40px; padding: 0 14px; font-size: 14px; margin-left: 6px; }
.nav-wsp i { color: var(--rojo-txt); }

/* ── Portada ───────────────────────────────────────────────────────────── */
.hero { padding: clamp(36px, 7vh, 80px) 0 clamp(28px, 5vh, 56px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero-title { font-size: clamp(42px, 5.4vw, 72px); line-height: 1; letter-spacing: -0.045em; }
.hero-sub { margin-top: 18px; max-width: 42ch; font-size: clamp(16px, 1.25vw, 18px); color: var(--t2); }

.search-card { margin-top: clamp(26px, 4vh, 38px); padding: 20px; max-width: 560px; }
.search-label { display: block; margin-bottom: 10px; font-size: 13.5px; font-weight: 600; color: var(--t2); }
.search-row { display: flex; gap: 10px; }
.search-field { position: relative; flex: 1; min-width: 0; }
.search-field i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--t3); font-size: 16px; pointer-events: none; transition: color .2s ease; }
.search-field:focus-within i { color: var(--rojo-txt); }
.search-input {
  width: 100%; min-height: 56px; padding: 0 16px 0 46px;
  border: 0; border-radius: var(--r-md); background: var(--s2);
  box-shadow: inset 0 0 0 1px var(--l2);
  font-family: var(--f-mono); font-size: 19px; letter-spacing: .08em; color: var(--t1);
  transition: box-shadow .2s ease, background-color .2s ease;
}
.search-input::placeholder { font-family: var(--f-texto); letter-spacing: 0; font-size: 16px; color: var(--t3); }
.search-input:focus { outline: none; background: var(--s1); box-shadow: inset 0 0 0 1px var(--rojo), 0 0 0 4px rgba(var(--rojo-rgb), .16); }
.btn-buscar { --alto: 56px; padding: 0 26px; }
.btn-buscar .spinner { width: 18px; height: 18px; border-width: 2px; }
.search-hint { margin-top: 12px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--t3); }
.search-hint i { font-size: 12px; }

/* Collage de fotos de la portada */
.hero-fotos { position: relative; aspect-ratio: 5 / 4.4; }
.hero-foto {
  position: absolute; overflow: hidden; border-radius: var(--r-xl);
  background: var(--s2); box-shadow: var(--sombra-2), inset 0 0 0 1px var(--l1);
}
.hero-foto img { width: 100%; height: 100%; object-fit: cover; }
.hero-foto::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); border-radius: inherit; background: linear-gradient(180deg, transparent 55%, rgba(9, 9, 11, .45)); }
.hero-fotos.n1 .hero-foto { inset: 0; }
.hero-fotos.n2 .hero-foto:nth-child(1) { left: 0; top: 0; width: 66%; height: 78%; }
.hero-fotos.n2 .hero-foto:nth-child(2) { right: 0; bottom: 0; width: 52%; height: 58%; }
.hero-fotos.n3 .hero-foto:nth-child(1) { left: 0; top: 6%; width: 50%; height: 62%; }
.hero-fotos.n3 .hero-foto:nth-child(2) { right: 0; top: 0; width: 46%; height: 44%; }
.hero-fotos.n3 .hero-foto:nth-child(3) { right: 6%; bottom: 0; width: 60%; height: 50%; z-index: 2; }
.hero-fotos .hero-foto { opacity: 0; transform: translateY(18px) scale(.98); animation: sube .9s var(--ease-out) forwards; }
.hero-fotos .hero-foto:nth-child(2) { animation-delay: .12s; }
.hero-fotos .hero-foto:nth-child(3) { animation-delay: .24s; }
.hero-fotos.vacio {
  display: grid; place-items: center; border-radius: var(--r-xl);
  background: radial-gradient(70% 60% at 70% 20%, rgba(var(--rojo-rgb), .18), transparent 60%), linear-gradient(160deg, var(--s2), var(--s0));
  box-shadow: inset 0 0 0 1px var(--l1);
}
.hero-isotipo { width: 72%; opacity: .5; }

/* Aparición al hacer scroll (la activa el JavaScript) */
.revela { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.revela.is-visible { opacity: 1; transform: none; }

/* ── Modo cuenta: con resultados, la pantalla se dedica al cliente ─────── */
body.modo-cuenta .hero,
body.modo-cuenta .seccion { display: none; }
.main { max-width: 1200px; min-width: 0; margin: 0 auto; padding: 0 clamp(16px, 3vw, 28px) 24px; }
body.modo-cuenta .main { padding-top: clamp(24px, 4vh, 40px); padding-bottom: 64px; min-height: 70vh; }

/* Carga: esqueleto con la forma del panel */
.loader { display: grid; gap: 14px; padding: 8px 0 24px; }
.loader::before, .loader::after {
  content: ''; display: block; border-radius: var(--r-xl);
  background: linear-gradient(100deg, var(--s1) 30%, var(--s2) 50%, var(--s1) 70%);
  background-size: 300% 100%; animation: brillo 1.4s ease-in-out infinite;
  box-shadow: inset 0 0 0 1px var(--l1);
}
.loader::before { height: 190px; }
.loader::after { height: 96px; }
.loader .spinner { display: none; }
.spinner { display: inline-block; width: 28px; height: 28px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: giro .7s linear infinite; }
@keyframes brillo { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* Estado vacío */
.empty {
  display: grid; justify-items: center; gap: 4px; text-align: center;
  padding: 44px 20px; margin: 8px 0 24px;
  border-radius: var(--r-xl); background: var(--s1); box-shadow: inset 0 0 0 1px var(--l1);
  color: var(--t2);
}
.empty i { font-size: 30px; color: var(--t3); margin-bottom: 10px; }
.empty p:first-of-type { font-family: var(--f-titulo); font-size: 18px; font-weight: 600; color: var(--t1); }
.tab-panel .empty { margin: 0; }

/* ── Cabecera de la cuenta ─────────────────────────────────────────────── */
.cuenta-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; animation: sube .5s var(--ease-out) both; }
.cuenta-top__quien { display: flex; align-items: center; gap: 14px; min-width: 0; }
.avatar {
  width: 52px; height: 52px; border-radius: var(--r-lg); flex-shrink: 0;
  display: grid; place-items: center;
  font-family: var(--f-titulo); font-size: 18px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, var(--rojo), var(--rojo-osc));
  box-shadow: 0 12px 24px -12px rgba(var(--rojo-rgb), .8), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.cuenta-top__hola { font-family: var(--f-titulo); font-size: clamp(22px, 2.4vw, 28px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.cuenta-top__hola b { font-weight: 800; }
.cuenta-top__sub { font-size: 14px; color: var(--t3); font-family: var(--f-mono); }
.btn-nueva { --alto: 44px; font-size: 14.5px; }

/* Selector de lotes (cuando hay más de uno) */
.lotes-cliente { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 20px; }
.lotes-cliente.solo-uno { display: none; }
.contrato-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--r-lg); cursor: pointer;
  background: var(--s1); box-shadow: inset 0 0 0 1px var(--l1);
  animation: sube .5s var(--ease-out) both;
  transition: box-shadow .2s ease, background-color .2s ease, transform .16s var(--ease-out);
}
.contrato-card:hover { background: var(--s2); box-shadow: inset 0 0 0 1px var(--l2); }
.contrato-card:active { transform: scale(.985); }
.contrato-card.activo { background: var(--s2); box-shadow: inset 0 0 0 1px rgba(var(--rojo-rgb), .6), 0 0 0 4px rgba(var(--rojo-rgb), .1); }
.contrato-card__anillo { position: relative; width: 52px; height: 52px; }
.contrato-card__anillo .anillo { width: 52px; height: 52px; }
.contrato-card__anillo span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-mono); font-size: 12px; }
.contrato-proyecto { font-size: 12.5px; color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contrato-nombre { font-family: var(--f-titulo); font-size: 17px; font-weight: 700; margin: 1px 0 6px; }
.contrato-card__ir { color: var(--t3); font-size: 13px; transition: transform .25s var(--ease-out), color .2s ease; }
.contrato-card.activo .contrato-card__ir { color: var(--rojo-txt); transform: translateX(2px); }

/* Anillos de avance */
.anillo { transform: rotate(-90deg); display: block; }
.anillo circle { fill: none; stroke-width: 3; }
.anillo__base { stroke: rgba(255, 255, 255, .08); }
.anillo__val { stroke: var(--rojo); stroke-linecap: round; transition: stroke-dasharray 1.3s var(--ease-out); }
.anillo--grande { width: 100%; height: 100%; }
.anillo--grande circle { stroke-width: 2.4; }

/* Chips de estado */
.chip-estado {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 600; line-height: 1.3;
}
.chip-estado i { font-size: 11px; }
.chip-estado.fin { color: var(--rojo-txt); background: rgba(var(--rojo-rgb), .12); }
.chip-estado.res { color: var(--aviso); background: var(--aviso-bg); }
.chip-estado.ok  { color: var(--ok); background: var(--ok-bg); }
.chip-estado.sobre-oscuro { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }

/* Avisos de vouchers */
.avisos { display: grid; gap: 10px; margin-bottom: 16px; }
.notif-banner {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg);
  animation: sube .5s var(--ease-out) both;
}
.notif-banner.aprobado { background: var(--ok-bg); box-shadow: inset 0 0 0 1px rgba(63, 207, 142, .24); }
.notif-banner.rechazado { background: var(--error-bg); box-shadow: inset 0 0 0 1px rgba(255, 107, 107, .24); }
.notif-banner-icon { font-size: 20px; line-height: 1; margin-top: 1px; }
.notif-banner.aprobado .notif-banner-icon { color: var(--ok); }
.notif-banner.rechazado .notif-banner-icon { color: var(--error); }
.notif-titulo { font-weight: 700; font-size: 14.5px; }
.notif-texto { font-size: 13.5px; color: var(--t2); margin-top: 2px; }

/* ── Panel del lote ───────────────────────────────────────────────────── */
.dashboard { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; animation: sube .55s var(--ease-out) both; }

.dash-header {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center;
  padding: clamp(22px, 3.4vw, 40px);
  border-radius: var(--r-xl);
  background:
    radial-gradient(60% 120% at 100% 0%, rgba(var(--rojo-rgb), .22), transparent 60%),
    linear-gradient(160deg, var(--s2), var(--s1));
  box-shadow: inset 0 0 0 1px var(--l1), var(--sombra-2);
}
/* Plano arquitectónico tenue detrás de la cabecera del lote */
.dash-header::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(80% 100% at 100% 50%, #000, transparent 70%);
          mask-image: radial-gradient(80% 100% at 100% 50%, #000, transparent 70%);
}
.dash-header__info { min-width: 0; display: grid; gap: 12px; }
.dash-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; color: var(--t2);
  background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px var(--l1);
}
.badge i { font-size: 12px; color: var(--t3); }
.dash-lote { font-size: clamp(30px, 4.2vw, 52px); letter-spacing: -0.04em; line-height: 1.02; }
.dash-lote span { color: var(--rojo); }
.dash-sub { font-size: 15px; color: var(--t2); }
.dash-header__anillo { position: relative; width: clamp(130px, 15vw, 172px); aspect-ratio: 1; }
.anillo-texto { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.anillo-texto b { font-family: var(--f-titulo); font-size: clamp(28px, 3vw, 38px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.anillo-texto span { font-size: 12.5px; color: var(--t3); margin-top: 4px; }

/* Cifras */
.dash-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat-item {
  display: flex; align-items: center; gap: 14px; min-width: 0;
  padding: 18px; border-radius: var(--r-lg);
  background: var(--s1); box-shadow: inset 0 0 0 1px var(--l1);
}
.stat-ico {
  width: 42px; height: 42px; border-radius: var(--r-md); flex-shrink: 0;
  display: grid; place-items: center; font-size: 16px;
  color: var(--t2); background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px var(--l1);
}
.stat-ico.verde { color: var(--ok); background: var(--ok-bg); box-shadow: none; }
.stat-ico.rojo { color: var(--rojo-txt); background: rgba(var(--rojo-rgb), .12); box-shadow: none; }
.stat-ico.azul { color: var(--t1); }
.stat-val { font-family: var(--f-mono); font-size: clamp(16px, 1.5vw, 19px); font-weight: 500; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-lbl { font-size: 13px; color: var(--t3); margin-top: 2px; }

/* Próxima acción */
.proxima {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 18px; border-radius: var(--r-lg);
  background: var(--s1); box-shadow: inset 0 0 0 1px var(--l2);
}
.proxima__ico {
  width: 44px; height: 44px; border-radius: var(--r-md); flex-shrink: 0;
  display: grid; place-items: center; font-size: 17px;
  color: var(--rojo-txt); background: rgba(var(--rojo-rgb), .12);
}
.proxima__txt { flex: 1; min-width: 200px; display: grid; gap: 2px; }
.proxima__txt b { font-family: var(--f-titulo); font-size: 17px; font-weight: 700; }
.proxima__txt span { font-size: 14px; color: var(--t2); }
.proxima__txt em { font-style: normal; font-weight: 600; color: var(--t1); }
.proxima.mal { box-shadow: inset 0 0 0 1px rgba(255, 107, 107, .35); background: linear-gradient(90deg, var(--error-bg), var(--s1) 60%); }
.proxima.mal .proxima__ico { color: var(--error); background: var(--error-bg); }
.proxima.mal em { color: #FFB4B4; }
.proxima.ok .proxima__ico { color: var(--ok); background: var(--ok-bg); }
.proxima.ok { box-shadow: inset 0 0 0 1px rgba(63, 207, 142, .3); }
.proxima.info .proxima__ico { color: var(--aviso); background: var(--aviso-bg); }

/* Botones de pago (los arma el JavaScript) */
.btn-yape, .btn-pagar-todo {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border: 0; border-radius: var(--r-md); cursor: pointer;
  font-family: var(--f-titulo); font-size: 14.5px; font-weight: 700; white-space: nowrap;
  color: #fff; background: var(--rojo);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 10px 20px -12px rgba(var(--rojo-rgb), .9);
  transition: background-color .2s ease, transform .16s var(--ease-out);
}
.btn-yape:hover, .btn-pagar-todo:hover { background: var(--rojo-hv); }
.btn-yape:active, .btn-pagar-todo:active { transform: scale(.97); }
.proxima .btn-yape { min-height: 46px; padding: 0 20px; font-size: 15px; }
.btn-pagar-todo {
  width: 100%; min-height: 48px; margin-bottom: 14px;
  color: var(--t1); background: var(--s2); box-shadow: inset 0 0 0 1px var(--l2);
}
.btn-pagar-todo:hover { background: var(--s3); box-shadow: inset 0 0 0 1px rgba(var(--rojo-rgb), .5); }
.btn-pagar-todo i { color: var(--rojo-txt); }

/* ── Pestañas ─────────────────────────────────────────────────────────── */
.tabs {
  position: relative; display: flex; gap: 2px; padding: 5px;
  overflow-x: auto; scrollbar-width: none;
  border-radius: var(--r-lg); background: var(--s1); box-shadow: inset 0 0 0 1px var(--l1);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs__ind {
  position: absolute; left: 5px; top: 5px; bottom: 5px; z-index: 0;
  border-radius: 10px; background: var(--s3); box-shadow: inset 0 0 0 1px var(--l2);
  transition: transform .35s var(--ease-out), width .35s var(--ease-out);
}
.tab-btn {
  position: relative; z-index: 1; flex: 1 0 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  font-size: 14.5px; font-weight: 600; color: var(--t3); white-space: nowrap;
  transition: color .2s ease;
}
.tab-btn i { font-size: 14px; }
.tab-btn:hover { color: var(--t2); }
.tab-btn.active { color: var(--t1); }
.tab-btn.active i { color: var(--rojo-txt); }
.tab-n {
  min-width: 22px; height: 20px; padding: 0 6px; border-radius: 6px;
  display: inline-grid; place-items: center;
  font-family: var(--f-mono); font-size: 11.5px; color: var(--t2); background: rgba(255, 255, 255, .07);
}
.tab-n.alerta { color: #fff; background: var(--rojo); }

.tab-content { min-height: 200px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: aparecePanel .3s var(--ease-out); }
@keyframes aparecePanel { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Mi lote */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.info-card {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 14px; border-radius: var(--r-lg); background: var(--s1); box-shadow: inset 0 0 0 1px var(--l1);
}
.info-icon { grid-row: span 2; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 14px; color: var(--t2); background: rgba(255, 255, 255, .05); }
.info-lbl { font-size: 12.5px; color: var(--t3); }
.info-val { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.nota {
  display: flex; gap: 12px; align-items: flex-start; margin-top: 12px;
  padding: 14px 16px; border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--l1);
}
.nota > i { color: var(--t2); margin-top: 3px; }
.nota b { font-family: var(--f-titulo); font-size: 15.5px; }
.nota p { font-size: 14px; color: var(--t2); margin-top: 3px; }
.nota.mal { background: var(--aviso-bg); box-shadow: inset 0 0 0 1px rgba(245, 184, 61, .25); }
.nota.mal > i { color: var(--aviso); }
.tab-panel > .nota:first-child { margin-top: 0; }

/* Pagos */
.pago-progress-wrap { padding: 18px; margin-bottom: 14px; border-radius: var(--r-lg); background: var(--s1); box-shadow: inset 0 0 0 1px var(--l1); }
.pago-progress-label, .pago-progress-pie { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13.5px; }
.pago-progress-label span:first-child { font-weight: 700; }
.pago-progress-label span:last-child { color: var(--t2); font-family: var(--f-mono); font-size: 12.5px; }
.pago-progress-pie { color: var(--t3); font-size: 12.5px; }
.pago-progress-bar { height: 8px; margin: 12px 0 10px; border-radius: 8px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.pago-progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--rojo-osc), var(--rojo)); transition: width 1.1s var(--ease-out); }

.linea-tiempo { list-style: none; position: relative; display: grid; gap: 8px; }
.linea-tiempo::before { content: ''; position: absolute; left: 15px; top: 14px; bottom: 14px; width: 1px; background: var(--l2); }
.linea-tiempo li { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: center; animation: sube .45s var(--ease-out) both; }
.lt-punto { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: var(--ok); background: var(--s0); box-shadow: inset 0 0 0 1px rgba(63, 207, 142, .45); }
.lt-cuerpo { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--s1); box-shadow: inset 0 0 0 1px var(--l1); }
.lt-cuerpo b { display: block; font-size: 14.5px; }
.lt-cuerpo span { font-size: 13px; color: var(--t3); }
.lt-tipo { font-style: normal; text-transform: capitalize; }
.td-num { font-family: var(--f-mono); font-weight: 500; font-size: 14.5px; white-space: nowrap; }

/* Cronograma */
.cron-info { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.cron-info-item { display: grid; gap: 2px; padding: 14px; border-radius: var(--r-lg); background: var(--s1); box-shadow: inset 0 0 0 1px var(--l1); }
.cron-info-lbl { font-size: 12.5px; color: var(--t3); }
.cron-info-val { font-family: var(--f-mono); font-size: 18px; font-weight: 500; }

.filtros-cuotas { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filtro {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px;
  border: 0; border-radius: var(--r-sm); cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--t2);
  background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--l1);
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .16s var(--ease-out);
}
.filtro span { font-family: var(--f-mono); font-size: 11.5px; color: var(--t3); }
.filtro:hover { color: var(--t1); }
.filtro:active { transform: scale(.97); }
.filtro.activo { color: var(--t1); background: var(--s3); box-shadow: inset 0 0 0 1px rgba(var(--rojo-rgb), .55); }
.filtro.activo span { color: var(--rojo-txt); }

.cuotas { list-style: none; display: grid; gap: 6px; }
.cuota {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
  padding: 10px 12px 10px 10px; border-radius: var(--r-md);
  background: var(--s1); box-shadow: inset 0 0 0 1px var(--l1);
  animation: sube .4s var(--ease-out) both;
}
.cuota[hidden] { display: none; }
.cuota-num { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-family: var(--f-mono); font-size: 14px; color: var(--t2); background: rgba(255, 255, 255, .05); }
.cuota-datos b { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; }
.cuota-datos span { font-family: var(--f-mono); font-size: 13px; color: var(--t2); }
.tag-proxima { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; color: #fff; background: var(--rojo); }
.cuota.es-proxima { box-shadow: inset 0 0 0 1px rgba(var(--rojo-rgb), .55); background: linear-gradient(90deg, rgba(var(--rojo-rgb), .08), var(--s1) 50%); }
.cuota.pagada .cuota-num { color: var(--ok); background: var(--ok-bg); }
.cuota.vencida .cuota-num { color: var(--error); background: var(--error-bg); }
.cuota.pagada .cuota-datos b { color: var(--t2); }
.badge-pagada, .badge-yape-pendiente, .badge-vencida, .badge-pendiente {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.badge-pagada { color: var(--ok); background: var(--ok-bg); }
.badge-yape-pendiente { color: var(--aviso); background: var(--aviso-bg); }
.badge-vencida { color: var(--error); background: var(--error-bg); }
.badge-pendiente { color: var(--t2); background: rgba(255, 255, 255, .05); }
.cuota-accion { display: flex; justify-content: flex-end; min-width: 92px; }
.cuota-ok { color: var(--ok); font-size: 20px; }
.cuota-nota { font-size: 12.5px; color: var(--t3); }

/* Documentos */
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.doc-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 14px; border-radius: var(--r-lg); cursor: pointer;
  background: var(--s1); box-shadow: inset 0 0 0 1px var(--l1);
  animation: sube .4s var(--ease-out) both;
  transition: background-color .2s ease, box-shadow .2s ease, transform .16s var(--ease-out);
}
.doc-card:hover { background: var(--s2); box-shadow: inset 0 0 0 1px var(--l2); }
.doc-card:active { transform: scale(.985); }
.doc-icon { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 18px; color: var(--t2); background: rgba(255, 255, 255, .05); }
.doc-icon.pdf { color: var(--rojo-txt); background: rgba(var(--rojo-rgb), .12); }
.doc-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 12.5px; color: var(--t3); margin: 2px 0 6px; font-family: var(--f-mono); }
.doc-origen { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; color: var(--t2); background: rgba(255, 255, 255, .06); }
.doc-bajar { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--t2); box-shadow: inset 0 0 0 1px var(--l2); transition: background-color .2s ease, color .2s ease; }
.doc-card:hover .doc-bajar { color: #fff; background: var(--rojo); box-shadow: none; }

/* ── Secciones de la página (álbum y equipo) ─────────────────────────── */
.seccion { padding: clamp(56px, 9vh, 104px) 0; }
.seccion h2 { font-size: clamp(32px, 3.6vw, 48px); letter-spacing: -0.035em; }
.seccion .bajada { margin-top: 12px; max-width: 52ch; font-size: 16.5px; color: var(--t2); }

.album-cabecera { margin-bottom: 32px; }
.album { columns: 4 240px; column-gap: 12px; }
.polaroid {
  position: relative; display: block; width: 100%; margin: 0 0 12px; padding: 0; border: 0;
  break-inside: avoid; cursor: zoom-in; overflow: hidden;
  border-radius: var(--r-lg); background: var(--s2); box-shadow: inset 0 0 0 1px var(--l1);
  opacity: 0; transform: translateY(18px);
  transition: opacity .6s var(--ease-out) var(--d, 0s), transform .6s var(--ease-out) var(--d, 0s);
}
.polaroid.is-visible { opacity: 1; transform: none; }
.polaroid img { width: 100%; height: auto; transition: transform .6s var(--ease-out); }
.polaroid__pie {
  position: absolute; right: 10px; bottom: 10px;
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  color: #fff; background: rgba(9, 9, 11, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(4px); transition: opacity .25s ease, transform .25s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .polaroid:hover img { transform: scale(1.04); }
  .polaroid:hover .polaroid__pie { opacity: 1; transform: none; }
}

.visor {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: grid; place-items: center; padding: 64px 72px;
  background: rgba(5, 5, 7, .94);
  opacity: 0; transition: opacity .3s ease;
}
.visor[hidden] { display: none; }
.visor.is-abierto { opacity: 1; }
.visor__img { max-width: 100%; max-height: calc(100dvh - 128px); border-radius: var(--r-lg); opacity: 0; transform: scale(.98); transition: opacity .3s ease, transform .35s var(--ease-out); }
.visor__img.is-lista { opacity: 1; transform: none; }
.visor__btn {
  position: absolute; width: 46px; height: 46px; border: 0; border-radius: var(--r-md); cursor: pointer;
  display: grid; place-items: center; font-size: 17px; color: var(--t1);
  background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px var(--l2);
  transition: background-color .2s ease, transform .16s var(--ease-out);
}
.visor__btn:hover { background: rgba(255, 255, 255, .14); }
.visor__btn:active { transform: scale(.94); }
.visor__cerrar { top: 16px; right: 16px; }
.visor__ant { left: 16px; top: 50%; margin-top: -23px; }
.visor__sig { right: 16px; top: 50%; margin-top: -23px; }
.visor__cuenta { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); font-size: 13px; color: var(--t2); }

.equipo-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.equipo-foto { position: relative; aspect-ratio: 4 / 3.4; border-radius: var(--r-xl); overflow: hidden; background: linear-gradient(160deg, var(--s2), var(--s0)); box-shadow: inset 0 0 0 1px var(--l1), var(--sombra-2); }
.equipo-foto img { width: 100%; height: 100%; object-fit: cover; }
.equipo-foto.sin-foto { display: grid; place-items: center; background: radial-gradient(70% 60% at 30% 20%, rgba(var(--rojo-rgb), .2), transparent 60%), linear-gradient(160deg, var(--s2), var(--s0)); }
.equipo-foto .equipo-foto__isotipo { width: 64%; height: auto; opacity: .55; }
.equipo-valores { margin: 28px 0 30px; display: grid; gap: 18px; }
.valor { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.valor__icono { width: 42px; height: 42px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 16px; color: var(--rojo-txt); background: rgba(var(--rojo-rgb), .1); box-shadow: inset 0 0 0 1px rgba(var(--rojo-rgb), .22); }
.valor h3 { font-size: 17px; letter-spacing: -0.01em; }
.valor p { font-size: 14.5px; color: var(--t2); margin-top: 3px; }

.pie { border-top: 1px solid var(--l1); }
.pie .contenedor { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 72px; font-size: 13.5px; color: var(--t3); }
.pie a { display: inline-flex; align-items: center; gap: 8px; color: var(--t2); text-decoration: none; transition: color .2s ease; }
.pie a:hover { color: var(--t1); }

/* ── Toast ─────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: var(--z-toast);
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px);
  padding: 12px 16px; border-radius: var(--r-md);
  font-size: 14.5px; font-weight: 600; color: var(--t1);
  background: var(--s3); box-shadow: inset 0 0 0 1px var(--l2), 0 20px 40px -16px rgba(0, 0, 0, .9);
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none;
  transition: opacity .25s ease, transform .35s var(--ease-out);
}
.toast i { color: var(--ok); }
.toast.error i { color: var(--error); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Modal de pago ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(5, 5, 7, .74); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; transition: opacity .22s ease, visibility 0s linear .22s;
}
.modal-overlay.open { opacity: 1; visibility: visible; transition: opacity .22s ease; }
.modal-box {
  width: 100%; max-width: 520px; max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
  transform: translateY(12px) scale(.98); opacity: 0;
  transition: transform .3s var(--ease-out), opacity .22s ease;
}
.modal-overlay.open .modal-box { transform: none; opacity: 1; }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; background: rgba(15, 15, 18, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--l1); border-radius: var(--r-xl) var(--r-xl) 0 0; }
.yape-cab { display: flex; align-items: center; gap: 12px; }
.yape-icon-big { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 18px; color: #fff; background: var(--rojo); box-shadow: 0 10px 20px -10px rgba(var(--rojo-rgb), .9); }
.yape-titulo { font-family: var(--f-titulo); font-size: 19px; font-weight: 700; }
.yape-subtitulo { font-size: 13.5px; color: var(--t2); }
.modal-close { width: 36px; height: 36px; border: 0; border-radius: 10px; display: grid; place-items: center; cursor: pointer; color: var(--t2); background: var(--s3); transition: background-color .2s ease, color .2s ease, transform .16s var(--ease-out); }
.modal-close:hover { background: var(--s4); color: var(--t1); }
.modal-close:active { transform: scale(.94); }
.modal-body { padding: 18px 20px 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }

.yape-monto { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r-lg); background: rgba(var(--rojo-rgb), .08); box-shadow: inset 0 0 0 1px rgba(var(--rojo-rgb), .3); }
.yape-monto__lbl { font-size: 13.5px; font-weight: 600; color: var(--t2); display: inline-flex; align-items: center; gap: 8px; }
.yape-monto__lbl i { color: var(--rojo-txt); }
.yape-monto__val { font-size: 22px; font-weight: 500; color: var(--t1); }

#mediosPagoWrap { display: grid; gap: 12px; }
.mp-group { padding: 14px; border-radius: var(--r-lg); background: var(--s2); box-shadow: inset 0 0 0 1px var(--l1); }
.mp-group-titulo { font-family: var(--f-titulo); font-weight: 700; font-size: 15.5px; margin-bottom: 10px; }
.mp-fotos { display: grid; gap: 8px; }
.mp-fotos-2 { grid-template-columns: 1fr 1fr; }
.mp-foto { width: 100%; max-height: 240px; object-fit: contain; border-radius: var(--r-md); background: #fff; cursor: zoom-in; }
.mp-fotos-hint { font-size: 12px; color: var(--t3); margin: 6px 0 10px; display: flex; align-items: center; gap: 6px; }
.mp-filas { display: grid; gap: 6px; }
.mp-data-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); background: var(--s1); box-shadow: inset 0 0 0 1px var(--l1); }
.mp-data-lbl { font-size: 12px; color: var(--t3); }
.mp-data-val { font-family: var(--f-mono); font-size: 15px; overflow-wrap: anywhere; }
.mp-copy { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 0; border-radius: var(--r-sm); cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--t1); background: var(--s3); transition: background-color .2s ease, transform .16s var(--ease-out); }
.mp-copy:hover { background: var(--s4); }
.mp-copy:active { transform: scale(.95); }
.mp-row-titular { font-size: 12.5px; color: var(--t3); padding: 0 4px; }
.mp-row-titular b { color: var(--t2); }
.mp-empty { padding: 14px; border-radius: var(--r-md); font-size: 14px; color: var(--t2); background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--l1); }

.yape-aviso { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); font-size: 13.5px; color: #F8D58C; background: var(--aviso-bg); box-shadow: inset 0 0 0 1px rgba(245, 184, 61, .25); }
.yape-aviso i { margin-top: 3px; }

.upload-label { display: block; cursor: pointer; }
.upload-area {
  display: grid; justify-items: center; gap: 4px; padding: 26px 16px; text-align: center;
  border-radius: var(--r-lg); border: 1.5px dashed var(--l3); background: rgba(255, 255, 255, .02);
  transition: border-color .2s ease, background-color .2s ease;
}
.upload-area i { font-size: 28px; color: var(--rojo-txt); margin-bottom: 6px; }
.upload-area__t { font-weight: 700; font-size: 15px; }
.upload-area__s { font-size: 13px; color: var(--t3); }
.upload-label:hover .upload-area, #yapeArchivo:focus-visible + .upload-area { border-color: var(--rojo); background: rgba(var(--rojo-rgb), .05); }
.yape-preview { text-align: center; }
.yape-preview img { max-width: 100%; max-height: 220px; margin: 0 auto; border-radius: var(--r-md); }
#yapePreviewPdf { padding: 14px; border-radius: var(--r-md); font-size: 14px; color: var(--t2); background: var(--s2); }

.modal-campo-lbl .opcional { font-weight: 400; color: var(--t3); }
.modal-textarea { padding-left: 16px; min-height: 76px; }
.modal-acciones { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 4px; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cron-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero-grid, .equipo-grid { grid-template-columns: 1fr; }
  .hero-fotos { aspect-ratio: 16 / 10; }
  .hero-fotos.vacio { display: none; }
  .nav-brand-text, .nav-link { display: none; }
}
@media (max-width: 640px) {
  .nav .contenedor { min-height: 60px; }
  .nav-brand img { height: 26px; }
  .search-card { padding: 16px; }
  .search-row { flex-direction: column; }
  .btn-buscar { width: 100%; }
  .dash-header { grid-template-columns: 1fr; gap: 18px; }
  .dash-header__anillo { width: 120px; order: -1; }
  .stat-item { padding: 14px; gap: 10px; }
  .stat-ico { width: 36px; height: 36px; font-size: 14px; }
  .cuota { grid-template-columns: 36px minmax(0, 1fr) auto; row-gap: 8px; }
  .cuota-num { width: 36px; height: 36px; }
  .cuota-estado { grid-column: 2; grid-row: 2; }
  .cuota-accion { grid-column: 3; grid-row: 1 / span 2; min-width: 0; }
  .proxima .btn-yape { width: 100%; }
  .visor { padding: 64px 12px; }
  .visor__ant, .visor__sig { top: auto; bottom: 12px; margin-top: 0; }
  .album { columns: 2 140px; column-gap: 8px; }
  .polaroid { margin-bottom: 8px; }
  .modal-acciones { grid-template-columns: 1fr; }
  .modal-acciones .btn-cancelar { order: 2; }
}
@media (max-width: 380px) {
  .dash-stats { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .revela, .polaroid { opacity: 1; transform: none; }
  .hero-fotos .hero-foto { opacity: 1; transform: none; }
}
