/* ============================================
   HOME — Hero con imagen background full-bleed
   ============================================ */

/* Bloquea scroll en home en cualquier pantalla */
body.body--home,
html:has(body.body--home) {
  height: 100dvh;
  overflow: hidden;
}

.home {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* Capa de imagen: cubre toda la pantalla detrás del header + hero */
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url("/static/img/background.webp");
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
  z-index: 0;
}

/* Overlay degradado para legibilidad del texto a la izquierda */
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(15, 25, 18, 0.78) 0%, rgba(15, 25, 18, 0.55) 35%, rgba(15, 25, 18, 0.1) 60%, rgba(15, 25, 18, 0) 100%),
    linear-gradient(180deg, rgba(15, 25, 18, 0.4) 0%, rgba(15, 25, 18, 0) 30%, rgba(15, 25, 18, 0) 70%, rgba(15, 25, 18, 0.55) 100%);
}

@media (max-width: 760px) {
  .hero-bg {
    background-position: center;
  }
  .hero-bg::after {
    background:
      linear-gradient(180deg, rgba(15, 25, 18, 0.35) 0%, rgba(15, 25, 18, 0.15) 30%, rgba(15, 25, 18, 0.85) 80%, rgba(15, 25, 18, 0.95) 100%);
  }
}

/* Header y footer fuera del flujo para que el hero ocupe los 100dvh completos
   y su centro coincida exacto con el centro del viewport. */
.home > .app-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
}
.home > main { position: relative; z-index: 2; }

/* Hero layout */
.hero {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;       /* la única fila estira a toda la altura del hero */
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;            /* centra cada item dentro de la fila */
  padding: clamp(5rem, 12vh, 6.5rem) clamp(1.25rem, 3vw, 2.5rem);
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
}

@media (min-width: 980px) {
  .hero {
    grid-template-columns: 1.1fr 1fr;
    padding-top: clamp(3rem, 6vw, 5rem);
  }
}

.hero__text {
  max-width: 620px;
}
.hero__text .eyebrow { margin-bottom: var(--space-4); }
.hero__text h1 {
  color: var(--on-dark);
  text-shadow: 0 2px 24px rgba(15, 25, 18, 0.45);
}
.hero__text .hero__sub {
  color: var(--on-dark-2);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  margin-top: var(--space-5);
  max-width: 52ch;
  line-height: 1.55;
  text-shadow: 0 1px 12px rgba(15, 25, 18, 0.4);
}
.hero__ctas {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
  flex-wrap: wrap;
}

/* === Mini-cards flotantes sobre la imagen === */
.hero__visual {
  position: relative;
  width: 100%;
  min-height: 360px;
}

@media (min-width: 980px) {
  .hero__visual { min-height: 540px; }
}

.hero__cards {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero__cards .float-card {
  position: absolute;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.hero__cards .float-card.is-show { opacity: 1; }

.hero__cards .float-card:nth-child(1) {
  top: 9%; right: 3%;
  transform: translateY(20px) rotate(-1.5deg);
  transition-delay: 0.1s;
}
.hero__cards .float-card:nth-child(1).is-show {
  transform: translateY(0) rotate(-1.5deg);
}
.hero__cards .float-card:nth-child(2) {
  top: 50%; right: -2%;
  transform: translateY(20px) rotate(1.5deg);
  transition-delay: 0.28s;
}
.hero__cards .float-card:nth-child(2).is-show {
  transform: translateY(0) rotate(1.5deg);
}
.hero__cards .float-card:nth-child(3) {
  bottom: 2%; right: 7%;
  transform: translateY(20px) rotate(-1deg);
  transition-delay: 0.46s;
}
.hero__cards .float-card:nth-child(3).is-show {
  transform: translateY(0) rotate(-1deg);
}

/* Caso de UNA sola tarjeta (experimento): centrada vertical, recta y con la foto
   más grande/visible. :only-child solo aplica cuando hay exactamente una, así que
   el layout de 2/3 tarjetas (nth-child) queda intacto si se vuelve a COUNT≥2. */
.hero__cards .float-card:only-child {
  top: 50%;
  right: 4%;
  transform: translateY(calc(-50% + 20px)) rotate(0deg);
  transition-delay: 0.1s;
}
.hero__cards .float-card:only-child.is-show {
  transform: translateY(-50%) rotate(0deg);
}
.hero__cards .float-card:only-child .float-card__avatar {
  width: 200px;
  height: 180px;
}

/* === Escalado tipográfico vertical para que SIEMPRE quepa === */
.hero__text h1 {
  font-size: clamp(1.85rem, min(6.2vw, 9.5vh), 4.8rem);
}
.hero__text .hero__sub {
  font-size: clamp(0.9rem, min(1.3vw, 2.1vh), 1.15rem);
  margin-top: clamp(0.75rem, 2.5vh, 1.5rem);
}
.hero__text .eyebrow {
  font-size: clamp(0.62rem, min(0.78vw, 1.4vh), 0.78rem);
  margin-bottom: clamp(0.5rem, 1.5vh, 1rem);
}
.hero__ctas {
  margin-top: clamp(1rem, 3vh, 2rem);
}

/* Firma editorial (acerca de) */
.hero__signature {
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
  padding-top: clamp(0.75rem, 2vh, 1.25rem);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  color: var(--gold-soft);
  letter-spacing: 0.005em;
  position: relative;
  max-width: max-content;
}
.hero__signature::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 1px;
  background: var(--gold-soft);
  opacity: 0.55;
}

@media (max-height: 620px) {
  .hero__signature { display: none; }
}

/* Mobile (<980px): la imagen sigue como bg, ocultamos el bloque visual
   para que el hero quepa sin scroll. Las mini-cards no se muestran en mobile. */
@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    align-items: center;
    justify-items: start;
  }
  .hero__visual {
    display: none;
  }
}

/* Pantallas muy bajas: comprimimos paddings simétricamente */
@media (max-height: 620px) {
  .hero { padding-top: 4rem; padding-bottom: 4rem; }
  .hero__text .hero__sub { display: none; }
  .home-footer { padding: var(--space-2); font-size: 0.7rem; }
}

/* Pantallas extremadamente bajas: también ocultamos eyebrow */
@media (max-height: 480px) {
  .hero__text .eyebrow { display: none; }
}

/* Footer simple — usado en páginas no-scroll (home, precios, acerca) */
.home-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: var(--space-5) clamp(1rem, 3vw, 2.5rem);
  text-align: center;
  color: var(--on-dark-2);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
/* Línea dorada sutil que se desvanece, separa el footer del contenido. */
.home-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(55%, 440px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 161, 88, 0.45), transparent);
}

/* ============================================
   FOOTER ELEGANTE — usado en /buscar
   ============================================ */
.footer {
  position: relative;
  z-index: 10;
  background: rgba(10, 20, 14, 0.78);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-top: 1px solid rgba(245, 235, 205, 0.10);
  color: var(--on-dark);
  padding: clamp(1.25rem, 2.5vw, 1.75rem) clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 2vw, 1.25rem);
}

.footer__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
}

.footer__wordmark {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--on-dark);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.005em;
  transition: color 0.18s;
}
.footer__wordmark:hover { color: var(--gold-soft); }

.footer__nav {
  display: flex;
  gap: clamp(0.75rem, 1.6vw, 1.5rem);
  flex-wrap: wrap;
  justify-content: center;
}
.footer__nav a {
  color: var(--on-dark-2);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: color 0.18s;
}
.footer__nav a:hover { color: var(--on-dark); }

.footer__end {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.footer__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(245, 235, 205, 0.08);
  border: 1px solid rgba(245, 235, 205, 0.16);
  color: var(--gold-soft);
  transition: background 0.2s var(--ease-out), color 0.2s, border-color 0.2s;
}
.footer__social:hover {
  background: rgba(245, 235, 205, 0.18);
  color: var(--paper);
  border-color: var(--gold-soft);
}
.footer__social svg { width: 18px; height: 18px; }

.footer__legal {
  max-width: var(--page-max);
  margin: clamp(0.85rem, 1.5vw, 1.25rem) auto 0;
  padding-top: clamp(0.6rem, 1.2vw, 0.85rem);
  border-top: 1px solid rgba(245, 235, 205, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: rgba(245, 235, 205, 0.55);
  letter-spacing: 0.04em;
}

.footer__tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--gold-soft);
  font-weight: 500;
  letter-spacing: 0.005em;
}

/* Corazón inline en taglines y firmas editoriales */
.tagline-heart {
  display: inline-block;
  vertical-align: -2px;
  width: 0.95em;
  height: 0.95em;
  color: #c45a5a;
  margin: 0 1px;
}

@media (max-width: 760px) {
  .footer__inner {
    justify-content: center;
    text-align: center;
  }
  .footer__legal {
    justify-content: center;
    text-align: center;
  }
}


/* ============================================
   PAGE BG — fondo fijo reutilizable con overlay
   ============================================ */
.page-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* Alto estable (viewport grande). Con `inset: 0` el elemento seguía el
     viewport dinámico y "saltaba" en móvil al colapsar la barra de URL durante
     el scroll. Fijándolo a 100lvh (con fallback vh) ya no se redimensiona. */
  height: 100vh;
  height: 100lvh;
  z-index: -1;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
}

.page-bg--library {
  background-image: url("/static/img/library.webp");
}
.page-bg--library::after {
  background:
    linear-gradient(180deg,
      rgba(15, 25, 18, 0.62) 0%,
      rgba(15, 25, 18, 0.42) 28%,
      rgba(15, 25, 18, 0.55) 62%,
      rgba(15, 25, 18, 0.92) 100%);
}

body.body--library {
  background: var(--emerald-2);
  color: var(--on-dark);
}

/* ============================================
   BUSCAR
   ============================================ */
.search-page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
}
.search-header {
  padding: clamp(1.5rem, 4vh, 3rem) clamp(1.25rem, 3vw, 2.5rem) clamp(0.75rem, 2vh, 1.25rem);
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
}
.search-header .eyebrow {
  margin-bottom: var(--space-3);
}
.search-header h1 {
  color: var(--on-dark);
  font-size: clamp(1.85rem, 4.5vw, 2.85rem);
  text-shadow: 0 2px 24px rgba(15, 25, 18, 0.55);
}
.search-header p {
  color: var(--on-dark-2);
  font-size: clamp(0.92rem, 1.1vw, 1.02rem);
  margin-top: var(--space-3);
  max-width: 58ch;
  text-shadow: 0 1px 10px rgba(15, 25, 18, 0.4);
}

/* ============================================
   DIRECTORIO /abogados — índice SSR de perfiles
   ============================================ */
.search-page > main { flex: 1; }
.dir-breadcrumb {
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  padding: clamp(1rem, 2.5vh, 1.5rem) clamp(1.25rem, 3vw, 2.5rem) 0;
  font-size: 0.84rem;
  color: var(--on-dark-2);
}
.dir-breadcrumb a { color: var(--on-dark-2); text-decoration: none; }
.dir-breadcrumb a:hover { color: var(--on-dark); text-decoration: underline; }
.dir-intro p a,
.search-header p a { color: var(--on-dark); text-decoration: underline; }
.dir-section {
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 3vw, 2.5rem) clamp(2rem, 5vh, 3.5rem);
}
/* Mosaico de regiones (departamentos / ciudades) */
.dir-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 0.75rem;
}
.dir-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1.15rem;
  border: 1px solid rgba(201, 161, 88, 0.32);
  border-radius: var(--radius-md, 14px);
  background: rgba(11, 20, 14, 0.62);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  color: var(--on-dark);
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.dir-tile:hover {
  border-color: var(--gold, #c9a158);
  background: rgba(11, 20, 14, 0.80);
  transform: translateY(-2px);
}
.dir-tile__name { font-weight: 600; }
.dir-tile__count {
  flex: none;
  min-width: 1.75rem;
  text-align: center;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill);
  background: rgba(201, 161, 88, 0.30);
  color: var(--on-dark);
  font-size: 0.8rem;
  font-weight: 700;
}
/* Lista de abogados de una ciudad */
.dir-people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 0.6rem;
}
.dir-person {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid rgba(201, 161, 88, 0.32);
  border-radius: var(--radius-md, 14px);
  background: rgba(11, 20, 14, 0.62);
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.dir-person:hover {
  border-color: var(--gold, #c9a158);
  background: rgba(11, 20, 14, 0.80);
  transform: translateY(-2px);
}
.dir-person__name { font-weight: 600; color: var(--on-dark); }
.dir-person__spec { font-size: 0.82rem; color: var(--on-dark-2); }
.dir-back { margin-top: var(--space-5); }
.dir-back a { color: var(--on-dark-2); text-decoration: none; }
.dir-back a:hover { color: var(--on-dark); text-decoration: underline; }

/* ============================================
   ADMIN
   ============================================ */
/* ============================================================
   PANEL ADMIN · gestión de tarjetas (estética de marca)
   Fondo esmeralda profundo + tarjeta blanca de datos + acentos dorados.
   ============================================================ */
.admin-body {
  background:
    radial-gradient(1100px 560px at 82% -12%, rgba(201, 161, 88, 0.10), transparent 60%),
    linear-gradient(168deg, #12281b 0%, #0d1d13 55%, #14110c 100%);
  background-attachment: fixed;
  min-height: 100dvh;
  font-family: var(--font-sans);
  color: var(--ink);
  margin: 0;
}
.admin-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-8);
}

/* ---- Header ---- */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.admin-brand { display: flex; align-items: center; gap: var(--space-3); }
.admin-brand__mark {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: var(--radius-sm);
  background: linear-gradient(150deg, rgba(201, 161, 88, 0.22), rgba(201, 161, 88, 0.05));
  border: 1px solid rgba(201, 161, 88, 0.35);
  color: var(--gold-soft);
}
.admin-header h1 {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--on-dark);
  letter-spacing: 0.01em;
  line-height: 1.1;
  margin: 0;
}
.admin-subtitle {
  margin: 3px 0 0;
  font-size: 0.8rem;
  color: rgba(245, 235, 205, 0.6);
  letter-spacing: 0.02em;
}
.admin-actions { display: flex; gap: var(--space-2); }

/* ---- Botones ---- */
.admin-btn {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(26, 20, 16, 0.16);
  background: #fff;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 0.86rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .18s, border-color .18s, color .18s, transform .05s;
}
.admin-btn:hover { background: #faf6ec; border-color: rgba(26, 20, 16, 0.28); }
.admin-btn:active { transform: translateY(1px); }
.admin-btn--sm { padding: 6px 11px; font-size: 0.8rem; border-radius: var(--radius-xs); }

.admin-btn--primary { background: var(--emerald); color: var(--on-dark); border-color: var(--emerald-2); }
.admin-btn--primary:hover { background: var(--emerald-3); border-color: var(--emerald-3); }

.admin-btn--ghost {
  background: rgba(245, 235, 205, 0.06);
  color: var(--on-dark);
  border-color: rgba(245, 235, 205, 0.28);
}
.admin-btn--ghost:hover { background: rgba(245, 235, 205, 0.14); border-color: rgba(245, 235, 205, 0.45); }

.admin-btn--gold {
  background: rgba(201, 161, 88, 0.16);
  color: #7a5a1e;
  border-color: rgba(201, 161, 88, 0.55);
}
.admin-btn--gold:hover { background: var(--gold); color: #2a1e08; border-color: var(--gold-2); }

.admin-btn--danger { background: #fff; color: #b03a3a; border-color: rgba(176, 58, 58, 0.35); }
.admin-btn--danger:hover { background: #b03838; color: #fff; border-color: #8a2424; }

/* ---- Contadores ---- */
.admin-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.admin-stat {
  font-size: 0.8rem;
  color: rgba(245, 235, 205, 0.72);
  background: rgba(245, 235, 205, 0.05);
  border: 1px solid rgba(245, 235, 205, 0.12);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}
.admin-stat b { color: var(--on-dark); font-weight: 700; }
.admin-stat--activa    b { color: #7fd6a3; }
.admin-stat--porvencer b { color: var(--gold-soft); }
.admin-stat--vencida   b { color: #f0a3a3; }

/* ---- Toolbar (buscador + chips) ---- */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.admin-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 235, 205, 0.07);
  border: 1px solid rgba(245, 235, 205, 0.18);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  color: rgba(245, 235, 205, 0.6);
  flex: 1 1 250px;
  max-width: 360px;
}
.admin-search:focus-within { border-color: rgba(201, 161, 88, 0.6); background: rgba(245, 235, 205, 0.1); }
.admin-search input {
  border: none; background: transparent; outline: none;
  color: var(--on-dark); font-family: inherit; font-size: 0.9rem; width: 100%;
}
.admin-search input::placeholder { color: rgba(245, 235, 205, 0.45); }
.admin-search input::-webkit-search-cancel-button { filter: invert(0.8); }

.admin-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-chip {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(245, 235, 205, 0.2);
  background: transparent;
  color: rgba(245, 235, 205, 0.7);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.admin-chip:hover { border-color: rgba(201, 161, 88, 0.55); color: var(--on-dark); }
.admin-chip.is-active { background: var(--gold); border-color: var(--gold); color: #221805; }

/* ---- Tabla ---- */
.admin-table-wrap {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px rgba(8, 16, 11, 0.4);
  border: 1px solid rgba(245, 235, 205, 0.1);
  overflow: hidden;
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}
.admin-table th, .admin-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid #f0ece2;
  font-size: 0.88rem;
  vertical-align: middle;
}
.admin-table th {
  background: var(--emerald);
  color: var(--on-dark);
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.admin-table tbody tr:hover { background: #faf7ef; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table__empty { text-align: center; padding: 36px 16px; color: var(--ink-mute); }
.admin-muted { color: var(--ink-mute); }

.thumb {
  width: 46px; height: 46px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(26, 20, 16, 0.1);
  display: inline-block;
}
.thumb--empty {
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--paper-3), var(--paper));
  color: var(--emerald);
  font-weight: 700;
  font-size: 1.1rem;
  font-family: var(--font-serif);
}

/* Estado público (visible/oculto) */
.admin-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 0.72rem; font-weight: 600;
}
.admin-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.admin-status--on  { background: rgba(43, 182, 115, 0.14); color: #1e7c4f; }
.admin-status--off { background: rgba(26, 20, 16, 0.08); color: var(--ink-3); }

/* Suscripción */
.admin-sub-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.sub-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 0.72rem; font-weight: 700;
}
.sub-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sub-badge--activa    { background: rgba(43, 182, 115, 0.14); color: #1e7c4f; }
.sub-badge--porvencer { background: rgba(201, 161, 88, 0.18); color: #8a6a2a; }
.sub-badge--vencida   { background: rgba(176, 58, 58, 0.13); color: #b03a3a; }
.sub-badge--sin       { background: rgba(26, 20, 16, 0.07); color: var(--ink-mute); }
.sub-detail { color: var(--ink-3); font-size: 0.72rem; }
.admin-sub-cell .admin-btn { margin-top: 2px; }
.admin-sub-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.admin-acciones { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 16, 11, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--space-4);
}
.modal-backdrop.is-open { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  border-top: 3px solid var(--gold);
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow-y: auto;
  padding: var(--space-6);
  box-shadow: 0 32px 90px rgba(8, 16, 11, 0.5);
}
.modal h2 {
  font-family: var(--font-serif);
  color: var(--emerald);
  margin-bottom: var(--space-5);
  font-size: 1.6rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.form-grid .full { grid-column: 1 / -1; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.form-field input, .form-field select {
  padding: 10px 13px;
  border: 1px solid #d8d0c0;
  border-radius: var(--radius-sm);
  background: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.form-field input:focus, .form-field select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 161, 88, 0.22);
}
.form-field small { color: var(--ink-mute); font-size: 0.75rem; }
.form-field small code {
  background: #f3efe4;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.8em;
  color: var(--emerald);
}
.form-field--check { flex-direction: row; align-items: center; gap: var(--space-2); }
.form-field--check label { margin: 0; cursor: pointer; text-transform: none; }
.form-field--check input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--emerald);
  cursor: pointer;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-5);
  grid-column: 1 / -1;
  border-top: 1px solid rgba(26, 20, 16, 0.08);
  padding-top: var(--space-4);
}
.foto-preview {
  width: 104px; height: 104px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-top: var(--space-2);
  border: 1px solid rgba(26, 20, 16, 0.12);
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 22px; left: 50%;
  transform: translateX(-50%) translateY(40px);
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  background: var(--emerald);
  color: var(--on-dark);
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 200;
  box-shadow: 0 14px 36px rgba(8, 16, 11, 0.45);
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast--error { background: #8a2424; }

@media (max-width: 720px) {
  .admin-shell { padding: var(--space-5) var(--space-4) var(--space-7); }
  .admin-header h1 { font-size: 1.55rem; }
  .form-grid { grid-template-columns: 1fr; }
}

.login-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background: var(--emerald-2);
}
.login-box {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 16px;
  padding: var(--space-6);
  box-shadow: 0 24px 60px rgba(10, 37, 64, 0.3);
}
.login-box h1 {
  font-size: 1.3rem;
  color: var(--navy);
  margin-bottom: var(--space-5);
  text-align: center;
  font-weight: 600;
}
.login-box input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd6e4;
  border-radius: 8px;
  font-size: 0.95rem;
  margin-bottom: var(--space-3);
}
.login-box .error {
  background: #fde2e2;
  color: #8a2424;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: var(--space-3);
  text-align: center;
}

