/* ═════════════════════════════════════════════════════════════════════
   stancia · _shared.css
   Design system unificado para los 5 dashboards (hub, gallery, usage,
   admin, org). Dark cinematográfico tintado de cyan, editorial.
   ═════════════════════════════════════════════════════════════════════ */

@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Instrument+Serif:ital@0;1&display=swap");

/* ─────────── TOKENS ─────────── */
:root {
  --bg:            oklch(0.14 0.012 190);
  --bg-elevated:   oklch(0.18 0.014 192);
  --bg-input:      oklch(0.12 0.010 190);
  --bg-hover:      oklch(0.22 0.018 192);

  --fg:            oklch(0.96 0.006 190);
  --fg-subtle:     oklch(0.80 0.008 190);
  --muted:         oklch(0.58 0.015 192);
  --muted-soft:    oklch(0.40 0.012 192);

  --border:        oklch(0.26 0.012 190);
  --border-strong: oklch(0.34 0.015 190);

  --accent:        oklch(0.82 0.14 185);
  --accent-soft:   oklch(0.50 0.08 185);
  --accent-glow:   oklch(0.82 0.14 185 / 0.12);
  --accent-hover:  oklch(0.88 0.14 185);
  --accent-on:     oklch(0.16 0.02 190);

  --danger:        oklch(0.72 0.17 25);
  --warn:          oklch(0.82 0.14 80);

  --font-display:  "Space Grotesk", system-ui, sans-serif;
  --font-mono:     "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --font-serif:    "Instrument Serif", Georgia, serif;

  --radius:        14px;
  --radius-sm:     8px;

  --ease:          cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-quart:    cubic-bezier(0.25, 1, 0.5, 1);
}

/* ─────────── RESET ─────────── */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  /* Composite estático tipo card-preview (2 radial offsets + linear base)
     en el hue cyan del sistema. background-attachment: fixed para que no
     se desplace con el scroll. */
  background:
    radial-gradient(ellipse at 18% 12%,
      oklch(0.30 0.08 190 / 0.55) 0%,
      transparent 55%),
    radial-gradient(ellipse at 82% 88%,
      oklch(0.24 0.06 220 / 0.5) 0%,
      transparent 55%),
    linear-gradient(135deg,
      oklch(0.14 0.012 190) 0%,
      oklch(0.18 0.02 205) 100%);
  background-attachment: fixed;
  color: var(--fg);
  font-family: var(--font-display);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Capa adicional que sigue al mouse — radial cyan suave que añade
   "vida" al fondo cuando el usuario mueve el cursor. Vars --bg-mx/--bg-my
   las setea _shared.js desde un pointermove global a nivel document. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle 700px at var(--bg-mx, 50%) var(--bg-my, 50%),
    oklch(0.55 0.12 195 / 0.16) 0%,
    transparent 60%);
  pointer-events: none;
  z-index: 0;
  transition: background 120ms linear;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─────────── AMBIENT HALO ─────────── */
.ambient {
  position: fixed;
  top: -40vh;
  left: 50%;
  transform: translateX(-50%);
  width: 120vw;
  aspect-ratio: 1;
  background: radial-gradient(circle at 50% 50%, var(--accent-glow) 0%, transparent 45%);
  pointer-events: none;
  z-index: 0;
}

/* ─────────── NAV ─────────── */
nav.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: clamp(14px, 1.8vw, 22px) clamp(20px, 4vw, 48px);
  background: color-mix(in oklch, var(--bg) 62%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid color-mix(in oklch, var(--border) 45%, transparent);
}
/* Fallback para navegadores sin backdrop-filter — bg más opaco */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  nav.top { background: color-mix(in oklch, var(--bg) 92%, transparent); }
}
/* nav-links pegado al brand (izquierda); nav-right empujado al borde derecho */
nav.top .nav-right { margin-left: auto; }

nav.top a.brand,
nav.top .brand {
  color: var(--fg);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  transition: color 160ms var(--ease);
}
nav.top a.brand:hover,
nav.top .brand:hover { color: var(--accent); }

nav.top .brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

nav.top .brand-dot {
  display: inline-block;
  width: 0.35em;
  height: 0.3em;
  background: var(--accent);
  border-radius: 50%;
  vertical-align: baseline;
  transform: translateY(-0.2em) rotate(100deg);
}

nav.top .brand-descriptor {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

nav.top .nav-links {
  display: inline-flex;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

nav.top .nav-pill {
  color: var(--fg-subtle);
  text-decoration: none;
  padding: 6px 11px;
  border-radius: 5px;
  border: 1px solid transparent;
  transition: all 160ms var(--ease);
}
nav.top .nav-pill:hover {
  color: var(--fg);
  background: color-mix(in oklch, var(--fg) 6%, transparent);
}
nav.top .nav-pill.active {
  color: var(--accent);
  border-color: color-mix(in oklch, var(--accent) 32%, transparent);
  background: color-mix(in oklch, var(--accent) 8%, transparent);
}
nav.top .nav-pill.admin-only,
nav.top .nav-pill.tenant-only { display: none; }
nav.top .nav-pill.admin-only.show,
nav.top .nav-pill.tenant-only.show { display: inline-block; }

/* Grupo admin (Admin/Org) — vive en nav-right (derecha), antes del balance.
   Separado del balance por divider sutil. Si no hay links visibles, queda
   invisible y sin divider huérfano (gracias a :has(.show)). */
nav.top .nav-group-admin {
  display: inline-flex;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}
nav.top .nav-group-admin:has(.show) {
  padding-right: 14px;
  border-right: 1px solid color-mix(in oklch, var(--border) 80%, transparent);
}

/* ─────────── DROPDOWN (Motores) ─────────── */
nav.top .nav-dropdown {
  position: relative;
  display: inline-block;
}
nav.top .nav-dropdown-trigger {
  background: transparent;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
nav.top .nav-dropdown-trigger .dropdown-arrow {
  font-size: 9px;
  transition: transform 200ms var(--ease);
  opacity: 0.65;
  margin-top: 1px;
}
nav.top .nav-dropdown.open .nav-dropdown-trigger .dropdown-arrow {
  transform: rotate(180deg);
  opacity: 1;
}
nav.top .nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 232px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 1px;
  box-shadow: 0 12px 36px oklch(0 0 0 / 0.5),
              0 0 0 1px color-mix(in oklch, var(--accent) 6%, transparent);
  z-index: 100;
}
nav.top .nav-dropdown.open .nav-dropdown-menu {
  display: flex;
  animation: motores-dropdown-in 180ms var(--ease-quart);
}
@keyframes motores-dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
nav.top .nav-dropdown-menu .dropdown-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--fg-subtle);
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
nav.top .nav-dropdown-menu .dropdown-item:hover {
  background: color-mix(in oklch, var(--accent) 10%, transparent);
  color: var(--fg);
}
nav.top .nav-dropdown-menu .dropdown-item.active {
  background: color-mix(in oklch, var(--accent) 14%, transparent);
  color: var(--accent);
}
nav.top .nav-dropdown-menu .dropdown-item.is-soon {
  cursor: default;
  opacity: 0.55;
}
nav.top .nav-dropdown-menu .dropdown-item.is-soon:hover {
  background: transparent;
  color: var(--fg-subtle);
}
nav.top .nav-dropdown-menu .motor-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
nav.top .nav-dropdown-menu .motor-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
nav.top .nav-dropdown-menu .motor-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
nav.top .nav-dropdown-menu .dropdown-item.active .motor-hint {
  color: color-mix(in oklch, var(--accent) 70%, var(--muted));
}
nav.top .nav-dropdown-menu .motor-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 100px;
  border: 1px solid currentColor;
  line-height: 1;
}
nav.top .nav-dropdown-menu .motor-badge-beta {
  color: oklch(0.82 0.14 80);
  background: color-mix(in oklch, oklch(0.82 0.14 80) 10%, transparent);
}
nav.top .nav-dropdown-menu .motor-badge-soon {
  color: var(--muted);
  background: color-mix(in oklch, var(--muted) 12%, transparent);
}

nav.top .nav-right {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

nav.top .credit-pill,
.credit-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 100px;
  background: color-mix(in oklch, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in oklch, var(--accent) 30%, transparent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.credit-pill #creditBal { font-weight: 600; }

nav.top .user-chip,
.user-chip {
  display: inline-block;
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Blindaje: si la página define un selector general `button {...}` que
   pone width:100%, no debe afectar al nav. Forzamos width auto con un
   selector más específico que el global. */
nav.top button,
nav.top .nav-btn {
  width: auto;
  flex: 0 0 auto;
}

nav.top .role-chip,
.role-chip {
  padding: 3px 10px;
  border-radius: 100px;
  background: color-mix(in oklch, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in oklch, var(--accent) 25%, transparent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.role-chip.viewer {
  background: color-mix(in oklch, var(--muted) 12%, transparent);
  border-color: color-mix(in oklch, var(--muted) 25%, transparent);
  color: var(--muted);
}

nav.top .nav-btn,
.nav-btn {
  background: transparent;
  color: var(--fg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 160ms var(--ease);
}
.nav-btn:hover {
  color: var(--fg);
  border-color: var(--border-strong);
}
.nav-btn.primary {
  background: var(--accent);
  color: var(--accent-on);
  border-color: var(--accent);
  font-weight: 600;
}
.nav-btn.primary:hover { background: var(--accent-hover); }
.nav-btn.danger {
  color: var(--danger);
  border-color: color-mix(in oklch, var(--danger) 35%, var(--border));
}
.nav-btn.danger:hover {
  background: color-mix(in oklch, var(--danger) 12%, transparent);
  border-color: var(--danger);
}

/* ─────────── MAIN (default container) ─────────── */
main {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(24px, 4vh, 40px) clamp(20px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ─────────── PAGE HEAD ─────────── */
header.page-head {
  position: relative;
  z-index: 2;
  padding: clamp(28px, 4vh, 48px) clamp(20px, 4vw, 48px) clamp(20px, 3vh, 32px);
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.kicker::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--muted);
}

h1.title {
  margin: 12px 0 8px;
  font-weight: 600;
  font-size: clamp(36px, 5vw, 60px);
  letter-spacing: -0.04em;
  line-height: 0.95;
}
h1.title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--fg-subtle);
}

.subtitle {
  color: var(--fg-subtle);
  font-size: 15px;
  line-height: 1.45;
  max-width: 60ch;
  margin: 0;
}

/* ─────────── MODAL (base) ─────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal.open { display: flex; animation: fade 200ms var(--ease) both; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: oklch(0 0 0 / 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade 200ms var(--ease) both;
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: 460px;
  max-width: 94vw;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  box-shadow: 0 20px 60px oklch(0 0 0 / 0.5);
  animation: rise 250ms var(--ease-quart) both;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.modal-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.modal-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.modal-close:hover { color: var(--fg); background: var(--bg-hover); }

/* ─────────── FOOTER (minimal) ─────────── */
footer {
  margin-top: auto;
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border);
  padding: 18px clamp(20px, 4vw, 48px);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-soft);
  letter-spacing: 0.06em;
  text-align: center;
}

/* ─────────── KEYFRAMES ─────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─────────── FOOTER (top + bottom) ─────────── */
footer.site-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
}

/* TOP: bigword "cuartos" desvanecido + columnas de links */
footer.site-footer .footer-top {
  position: relative;
  z-index: 2;
  padding: clamp(40px, 6vh, 80px) clamp(20px, 4vw, 48px) clamp(28px, 4vh, 48px);
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(28px, 4vw, 64px);
  align-items: end;
  border-top: 1px solid color-mix(in oklch, var(--border) 60%, transparent);
}
footer.site-footer .footer-bigword {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(56px, 9vw, 130px);
  letter-spacing: -0.04em;
  line-height: 0.85;
  color: var(--fg);
  opacity: 0.05;
  margin: 0;
  user-select: none;
  align-self: end;
}
footer.site-footer .footer-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, auto));
  gap: clamp(28px, 3vw, 48px);
  align-items: start;
}
footer.site-footer .footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}
footer.site-footer .footer-col-head {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
footer.site-footer .footer-col a {
  color: var(--fg-subtle);
  text-decoration: none;
  transition: color 160ms var(--ease);
}
footer.site-footer .footer-col a:hover { color: var(--accent); }

/* BOTTOM: línea minimalista (colofón) */
footer.site-footer .footer-bottom {
  padding: 18px clamp(20px, 4vw, 48px);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-top: 1px solid color-mix(in oklch, var(--border) 40%, transparent);
}
footer.site-footer .footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  cursor: pointer;
  transition: color 160ms var(--ease);
}
footer.site-footer .footer-brand:hover { color: var(--accent); }
footer.site-footer .footer-dot {
  display: inline-block;
  width: 0.35em;
  height: 0.3em;
  background: var(--accent);
  border-radius: 50%;
  vertical-align: baseline;
  transform: translateY(-0.2em) rotate(100deg);
}
footer.site-footer .footer-sep { opacity: 0.4; }
footer.site-footer .footer-tagline { color: var(--fg-subtle); text-transform: none; letter-spacing: 0.02em; }
footer.site-footer .footer-year { margin-left: auto; }

@media (max-width: 720px) {
  footer.site-footer .footer-top { grid-template-columns: 1fr; gap: 32px; }
  footer.site-footer .footer-bigword { font-size: clamp(48px, 14vw, 80px); }
}

/* ─────────── CREDITS MODAL (402 handler) ─────────── */
.credits-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.credits-modal.open { display: flex; }
.credits-backdrop {
  position: absolute;
  inset: 0;
  background: oklch(0.10 0.02 220 / 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.credits-dialog {
  position: relative;
  width: min(440px, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px 28px;
  box-shadow: 0 30px 80px oklch(0 0 0 / 0.6),
              0 0 0 1px oklch(from var(--accent) l c h / 0.15);
  animation: credits-pop 220ms cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes credits-pop {
  from { transform: scale(0.94) translateY(8px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.credits-close {
  position: absolute;
  top: 12px; right: 14px;
  width: 32px; height: 32px;
  border: 0;
  background: transparent;
  color: var(--fg-subtle);
  font-size: 22px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 140ms, color 140ms;
}
.credits-close:hover { background: var(--bg-hover); color: var(--fg); }
.credits-icon {
  font-size: 38px;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 14px;
  font-weight: 200;
}
.credits-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 3.4vw, 24px);
  font-weight: 600;
  margin: 0 0 14px;
  letter-spacing: -0.015em;
}
.credits-msg {
  margin: 0 0 8px;
  color: var(--fg);
  font-size: 15px;
  line-height: 1.5;
}
.credits-msg strong {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.credits-sub {
  margin: 0 0 22px;
  color: var(--fg-subtle);
  font-size: 13px;
  line-height: 1.5;
}
.credits-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.credits-cta {
  flex: 1;
  text-align: center;
  background: var(--accent);
  color: oklch(0.18 0.02 220);
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: filter 140ms;
}
.credits-cta:hover { filter: brightness(1.1); }
.credits-secondary {
  background: transparent;
  color: var(--fg-subtle);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: color 140ms, border-color 140ms;
}
.credits-secondary:hover { color: var(--fg); border-color: var(--fg-subtle); }

/* ─────────── PRICING SECTION (home #precios) ─────────── */
.pricing-section {
  padding: 80px 24px 120px;
  max-width: 1200px;
  margin: 0 auto;
  scroll-margin-top: 80px;
}
.pricing-head {
  text-align: center;
  margin-bottom: 56px;
}
.pricing-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 14px;
}
.pricing-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.5vw, 40px);
  font-weight: 500;
  margin: 0 0 14px;
  letter-spacing: -0.022em;
  line-height: 1.05;
  color: var(--fg);
}
.pricing-sub {
  color: var(--muted);
  font-size: 15px;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.55;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  align-items: stretch;
}
@media (max-width: 1080px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}
.pricing-card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 220ms,
              box-shadow 220ms;
}
.pricing-card:hover {
  transform: translateY(-3px);
  border-color: oklch(from var(--accent) l c h / 0.45);
  box-shadow: 0 20px 50px oklch(0 0 0 / 0.4);
}
.pricing-card.featured {
  border-color: oklch(from var(--accent) l c h / 0.55);
  background: linear-gradient(
    180deg,
    oklch(from var(--accent) l c h / 0.07) 0%,
    var(--bg-elevated) 60%
  );
}
.pricing-card.featured::before {
  content: 'popular';
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: oklch(0.18 0.02 220);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
}
.pricing-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  margin: 0 0 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
}
.pricing-price-amount {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.pricing-price-currency {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.pricing-credits {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}
.pricing-list {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.pricing-list li {
  font-size: 13px;
  color: var(--fg-subtle);
  line-height: 1.45;
  padding-left: 14px;
  position: relative;
}
.pricing-list li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-weight: 700;
}
.pricing-cta {
  display: block;
  text-align: center;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--fg-subtle);
  padding: 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 140ms, color 140ms, border-color 140ms;
  width: 100%;
}
.pricing-cta:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.pricing-card.featured .pricing-cta {
  background: var(--accent);
  color: oklch(0.18 0.02 220);
  border-color: var(--accent);
}
.pricing-card.featured .pricing-cta:hover { filter: brightness(1.1); }
.pricing-foot {
  text-align: center;
  margin-top: 36px;
  font-size: 13px;
  color: var(--fg-subtle);
}
.pricing-foot a { color: var(--accent); text-decoration: none; }
.pricing-foot a:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .pricing-section { padding: 56px 18px 80px; }
  .pricing-grid { grid-template-columns: 1fr; gap: 14px; }
}

/* ─────────── A11Y ─────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ═════════════════════════════════════════════════════════════════════
   SHELL v2 — Apple sidebar + topbar (emitido por renderNav en _shared.js).
   Reemplaza al `nav.top` antiguo. Convive con los tokens cyan: las páginas
   interiores conservan su fondo y cards; sólo el shell adopta paleta Apple.
   ═════════════════════════════════════════════════════════════════════ */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

:root {
  --sb-w:               76px;
  --sb-w-expanded:      240px;
  --tb-h:               64px;
  --apple-bg:           #000000;
  --apple-card:         #1d1d1f;
  --apple-card-hi:      #232325;
  --apple-sidebar:      #0a0a0a;
  --apple-fg:           #f5f5f7;
  --apple-fg-display:   #ffffff;
  --apple-fg-subtle:    #c7c7cc;
  --apple-muted:        #86868b;
  --apple-muted-deep:   #6e6e73;
  --apple-hairline:     rgba(255,255,255,0.08);
  --apple-hairline-2:   rgba(255,255,255,0.14);
  --apple-blue:         #0a84ff;
  --apple-purple:       #bf5af2;
  --apple-pink:         #ff375f;
  --apple-green:        #30d158;
  --apple-orange:       #ff9f0a;
  --aurora-1:           #5e5ce6;
  --aurora-2:           #bf5af2;
  --aurora-3:           #ff375f;
  --ease-luxe:          cubic-bezier(0.16, 1, 0.3, 1);
  --font-shell:         "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
}

/* Body offset por sidebar fijo */
body { padding-left: var(--sb-w); }

/* ─────────── SIDEBAR ─────────── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sb-w);
  background: var(--apple-sidebar);
  border-right: 1px solid var(--apple-hairline);
  display: flex; flex-direction: column;
  padding: 20px 14px;
  z-index: 100;
  overflow: hidden;
  transition: width 420ms var(--ease-luxe);
  font-family: var(--font-shell);
}
.sidebar:hover { width: var(--sb-w-expanded); }
/* Cuando un dropdown del sidebar está abierto, expandir el sidebar y permitir
   overflow para que el menú flotante NO quede clipeado dentro del rail. */
.sidebar:has(.sb-dropdown.open) {
  width: var(--sb-w-expanded);
  overflow: visible;
}
/* Forzar visible las labels cuando el dropdown está abierto (sin necesidad
   de :hover) — coherente con el sidebar expandido. */
.sidebar:has(.sb-dropdown.open) .sb-logo .sb-word,
.sidebar:has(.sb-dropdown.open) .sb-section-label,
.sidebar:has(.sb-dropdown.open) .sb-item .label-text,
.sidebar:has(.sb-dropdown.open) .sb-cta .label-text,
.sidebar:has(.sb-dropdown.open) .sb-user .info,
.sidebar:has(.sb-dropdown.open) .sb-dropdown-arrow {
  opacity: 1;
  transform: translateX(0);
}

.sidebar a { text-decoration: none; color: inherit; }

.sb-logo {
  height: 44px; min-width: 44px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer;
  margin-bottom: 16px;
  padding-left: 6px;
}
.sb-logo .sb-mark {
  width: 40px; height: 40px; min-width: 40px;
  display: flex; align-items: center; justify-content: center;
  color: var(--apple-fg-display);
  font-weight: 600; font-size: 28px;
  letter-spacing: -0.05em; line-height: 1;
}
.sb-logo .sb-mark-dot {
  color: transparent;
  background: linear-gradient(135deg, var(--aurora-1), var(--aurora-2));
  -webkit-background-clip: text; background-clip: text;
  margin-left: -1px;
}
.sb-logo .sb-word {
  font-size: 21px; font-weight: 500; letter-spacing: -0.025em;
  color: var(--apple-fg-display);
  opacity: 0; transform: translateX(-10px);
  transition: opacity 320ms 120ms var(--ease-luxe), transform 420ms 120ms var(--ease-luxe);
  white-space: nowrap;
}
.sidebar:hover .sb-logo .sb-word { opacity: 1; transform: translateX(0); }

.sb-divider { height: 1px; background: var(--apple-hairline); margin: 12px 4px; }

.sb-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sb-section-label {
  font-family: var(--font-shell);
  font-size: 11px; letter-spacing: -0.005em;
  color: var(--apple-muted-deep);
  padding: 16px 14px 8px;
  opacity: 0; transform: translateX(-6px);
  transition: opacity 280ms 100ms var(--ease-luxe), transform 360ms 100ms var(--ease-luxe);
  white-space: nowrap; font-weight: 500;
}
.sidebar:hover .sb-section-label { opacity: 1; transform: translateX(0); }

.sb-item {
  height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; gap: 14px;
  padding-left: 11px;
  color: var(--apple-fg-subtle);
  cursor: pointer;
  transition: background 220ms var(--ease-luxe), color 220ms var(--ease-luxe);
  background: transparent;
  border: 0;
  width: 100%;
  font-family: var(--font-shell);
  text-align: left;
}
.sb-item svg {
  width: 22px; height: 22px; min-width: 22px;
  stroke: currentColor; fill: none; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.sb-item .label-text {
  font-size: 14px; font-weight: 400; letter-spacing: -0.01em;
  white-space: nowrap;
  opacity: 0; transform: translateX(-8px);
  transition: opacity 280ms 100ms var(--ease-luxe), transform 360ms 100ms var(--ease-luxe);
}
.sidebar:hover .sb-item .label-text { opacity: 1; transform: translateX(0); }
.sb-item:hover { background: rgba(255,255,255,0.06); color: var(--apple-fg-display); }
.sb-item.active { background: rgba(255,255,255,0.08); color: var(--apple-fg-display); }
.sb-item[aria-disabled="true"] { opacity: 0.45; cursor: default; }
.sb-item[aria-disabled="true"]:hover { background: transparent; color: var(--apple-fg-subtle); }

/* Visibilidad por rol (mismas reglas que el sistema viejo) */
.sb-item.admin-only,
.sb-item.tenant-only { display: none; }
.sb-item.admin-only.show,
.sb-item.tenant-only.show { display: flex; }

/* Dropdown (Servicios → motores) — anclado dentro de la sidebar */
.sb-dropdown { position: relative; }
.sb-dropdown-arrow {
  margin-left: auto; margin-right: 8px;
  font-size: 10px; opacity: 0.55;
  transition: transform 200ms var(--ease-luxe);
  opacity: 0;
  transition: opacity 280ms 100ms var(--ease-luxe), transform 200ms var(--ease-luxe);
}
.sidebar:hover .sb-dropdown-arrow { opacity: 0.55; }
.sb-dropdown.open .sb-dropdown-arrow { transform: rotate(180deg); opacity: 1; }

.sb-dropdown-menu {
  position: absolute;
  left: calc(100% + 8px);
  top: 0;
  min-width: 252px;
  background: var(--apple-card);
  border: 1px solid var(--apple-hairline-2);
  border-radius: 12px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 1px;
  box-shadow: 0 14px 48px rgba(0,0,0,0.55);
  z-index: 250;
}
.sb-dropdown.open .sb-dropdown-menu { display: flex; }
.sb-dropdown-menu .dropdown-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--apple-fg-subtle);
  font-family: var(--font-shell);
  transition: background 160ms var(--ease-luxe);
}
.sb-dropdown-menu .dropdown-item:hover { background: rgba(255,255,255,0.06); color: var(--apple-fg-display); }
.sb-dropdown-menu .dropdown-item.active { background: rgba(255,255,255,0.10); color: var(--apple-fg-display); }
.sb-dropdown-menu .dropdown-item.is-soon { opacity: 0.5; cursor: default; }
.sb-dropdown-menu .dropdown-item.is-soon:hover { background: transparent; color: var(--apple-fg-subtle); }
.sb-dropdown-menu .motor-row { display: inline-flex; align-items: center; gap: 8px; }
.sb-dropdown-menu .motor-name { font-size: 13px; font-weight: 500; letter-spacing: -0.01em; }
.sb-dropdown-menu .motor-hint { font-size: 11px; color: var(--apple-muted); letter-spacing: -0.005em; }
.sb-dropdown-menu .motor-badge {
  font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 100px; line-height: 1;
  font-weight: 600;
}
.sb-dropdown-menu .motor-badge-beta { color: var(--apple-orange); background: rgba(255,159,10,0.16); }
.sb-dropdown-menu .motor-badge-soon { color: var(--apple-muted); background: rgba(255,255,255,0.06); }

/* CTAs auth (guest) */
.sb-cta {
  height: 40px;
  background: var(--apple-blue);
  color: white;
  border: 0;
  border-radius: 10px;
  display: flex; align-items: center; gap: 12px;
  padding-left: 13px;
  cursor: pointer;
  margin: 6px 0;
  transition: background 220ms var(--ease-luxe);
  overflow: hidden;
  font-family: var(--font-shell);
  font-weight: 500;
  width: 100%;
  text-align: left;
}
.sb-cta:hover { background: #0973e0; }
.sb-cta svg { width: 20px; height: 20px; min-width: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
.sb-cta .label-text {
  font-size: 14px; font-weight: 500; letter-spacing: -0.01em;
  white-space: nowrap;
  opacity: 0; transform: translateX(-8px);
  transition: opacity 280ms 100ms var(--ease-luxe), transform 360ms 100ms var(--ease-luxe);
}
.sidebar:hover .sb-cta .label-text { opacity: 1; transform: translateX(0); }
.sb-cta.secondary {
  background: rgba(255,255,255,0.08);
  color: var(--apple-fg-display);
}
.sb-cta.secondary:hover { background: rgba(255,255,255,0.14); }

/* User pill (authed) */
.sb-user {
  height: 56px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 6px;
  cursor: pointer;
  border-radius: 12px;
  transition: background 220ms var(--ease-luxe);
}
.sb-user:hover { background: rgba(255,255,255,0.06); }
.sb-avatar {
  width: 38px; height: 38px; min-width: 38px;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--aurora-1), var(--aurora-2));
  color: white;
  font-weight: 500; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -0.02em;
  font-family: var(--font-shell);
}
.sb-user .info {
  display: flex; flex-direction: column;
  opacity: 0; transform: translateX(-8px);
  transition: opacity 320ms 140ms var(--ease-luxe), transform 400ms 140ms var(--ease-luxe);
  font-family: var(--font-shell);
  overflow: hidden;
}
.sb-user .info .name {
  font-size: 14px; font-weight: 500; color: var(--apple-fg-display);
  white-space: nowrap; letter-spacing: -0.015em;
  overflow: hidden; text-overflow: ellipsis;
  max-width: 160px;
}
.sb-user .info .meta {
  font-size: 12px; color: var(--apple-muted);
  letter-spacing: -0.005em;
}
.sidebar:hover .sb-user .info { opacity: 1; transform: translateX(0); }

/* ─────────── TOPBAR ─────────── */
.topbar {
  position: sticky; top: 0;
  height: var(--tb-h);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  background: rgba(0,0,0,0.65);
  border-bottom: 1px solid var(--apple-hairline);
  display: flex; align-items: center;
  padding: 0 40px;
  gap: 24px;
  z-index: 40;
  font-family: var(--font-shell);
}
.topbar .topbar-brand {
  font-size: 17px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--apple-fg-display);
  text-decoration: none;
  display: inline-flex; align-items: baseline;
}
.topbar .topbar-brand .brand-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--aurora-1), var(--aurora-2));
  margin-left: 2px;
  vertical-align: baseline;
}
.topbar .topbar-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 14px;
}
.topbar .credit-pill {
  display: inline-flex; align-items: baseline; gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 0;
  color: var(--apple-fg-subtle);
  font-family: var(--font-shell);
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 100px;
  letter-spacing: -0.005em;
}
.topbar .credit-pill b {
  color: var(--apple-fg-display);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.topbar .user-chip {
  background: rgba(255,255,255,0.10);
  color: var(--apple-fg-display);
  padding: 7px 16px;
  border-radius: 100px;
  font-size: 13px; font-weight: 500;
  letter-spacing: -0.005em;
  max-width: 200px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.topbar .tb-status {
  font-size: 12px; color: var(--apple-muted);
  letter-spacing: -0.005em;
}
.topbar .tb-btn {
  background: transparent;
  color: var(--apple-fg-subtle);
  border: 1px solid var(--apple-hairline-2);
  border-radius: 100px;
  padding: 7px 16px;
  font-size: 13px; font-weight: 500;
  font-family: var(--font-shell);
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background 200ms var(--ease-luxe), color 200ms var(--ease-luxe);
}
.topbar .tb-btn:hover { background: rgba(255,255,255,0.06); color: var(--apple-fg-display); }
.topbar .tb-btn.primary {
  background: white;
  color: black;
  border-color: white;
}
.topbar .tb-btn.primary:hover { background: rgba(255,255,255,0.92); }
.topbar .tb-btn.danger {
  border-color: rgba(255,55,95,0.35);
  color: var(--apple-pink);
}
.topbar .tb-btn.danger:hover { background: rgba(255,55,95,0.12); }

/* ─────────── RESPONSIVE shell ─────────── */
@media (max-width: 720px) {
  body { padding-left: 0; }
  .sidebar {
    width: 100%;
    height: auto;
    bottom: auto;
    flex-direction: row;
    padding: 10px 14px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--apple-hairline);
  }
  .sidebar:hover { width: 100%; }
  .sb-logo { margin-bottom: 0; }
  .sb-divider, .sb-section-label, .sb-user .info, .sb-cta .label-text { display: none; }
  .sb-nav { flex-direction: row; gap: 4px; flex: 1; }
  .sb-item { width: auto; padding: 0 12px; }
  .sb-item .label-text { display: none; }
  .sb-dropdown-menu { left: 0; top: calc(100% + 8px); }
  .topbar { padding: 0 16px; }
}
