/* ════════════════════════════════════════════════════════════════
   cuenta.css — Hub de Motivo ID (post-login)

   SPLIT de verdad, como el login de motivo-id:
     · IZQUIERDA: panel NAVY con degradado, a TODA ALTURA (arriba a abajo).
       "Empezar con un producto" — cards que se reparten el alto, estilo login.
     · DERECHA: fondo CLARO grisáceo (--paper-warm, el de detrás de la card de
       login), con su propia NAVBAR y la marca en claro. Dentro, "Tus negocios"
       en una card blanca (estilo card de login).
   Sin pestañas. La cuenta vive en el menú del usuario (navbar derecha).

   Marca base: conmotivo.css. Tipografía Manrope.
   ════════════════════════════════════════════════════════════════ */

.hub-page { min-height: 100vh; background: var(--paper-warm); color: var(--ink); }

.hub-shell {
  display: grid;
  /* Ancho PROPORCIONAL acotado (30%, entre 340 y 460px): la proporción se
     mantiene al hacer zoom, no se descoloca como con un ancho fijo en px. */
  grid-template-columns: clamp(340px, 30%, 460px) 1fr;
  min-height: 100vh;
}

/* ════════ IZQUIERDA: panel navy que CABE de una vista ════════ */
/* Alto exacto de pantalla y las cards se reparten ese hueco (flex): las 4
   entran sin scroll. Sticky para que no se estire con el alto de la derecha. */
.hub-left {
  position: sticky; top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  padding: 30px 30px;
  color: #fff;
  background:
    radial-gradient(700px 460px at 20% 96%, rgba(0, 97, 255, 0.28), transparent 60%),
    radial-gradient(560px 360px at 92% 4%, rgba(45, 124, 255, 0.18), transparent 60%),
    linear-gradient(160deg, #0b1020 0%, #0a1a3d 55%, #061230 100%);
}
.hub-left-head { flex-shrink: 0; }
.empezar-title { font-family: var(--f-sans); font-size: 21px; font-weight: 800; letter-spacing: -0.01em; color: #fff; }
.empezar-title em { font-style: italic; color: var(--signal-mid); }
.empezar-sub { font-size: 14px; color: rgba(255, 255, 255, 0.66); line-height: 1.5; margin: 8px 0 0; }
.empezar-sub strong { color: #fff; font-weight: 700; }

.empezar-list { flex: 1; display: flex; flex-direction: column; gap: 12px; margin-top: 18px; min-height: 0; }
/* Card premium: degradado navy→negro + filo dorado. Se reparte el alto con sus
   hermanas (flex) y centra su contenido, así ni se sale (scroll) ni queda seca.
   min-height:0 = puede encoger para caber en pantallas bajas. */
.empezar-item {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(240, 180, 41, 0.30);
  background:
    linear-gradient(158deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 46%, rgba(0, 0, 0, 0.22) 100%);
  box-shadow: 0 10px 30px -22px rgba(0, 0, 0, 0.7);
  transition: border-color .15s var(--ease-out), transform .15s, box-shadow .15s;
}
.empezar-item:not(.empezar-item--soon):hover {
  border-color: rgba(240, 180, 41, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.75), 0 0 26px -8px rgba(240, 180, 41, 0.28);
}
.empezar-top { display: flex; align-items: center; gap: 12px; }
.empezar-icon {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  display: inline-flex; align-items: center; justify-content: center;
}
.empezar-icon svg { width: 22px; height: 22px; }
.empezar-name { font-family: var(--f-sans); font-size: 16px; font-weight: 700; color: #fff; }
.empezar-desc {
  font-size: 13px; color: rgba(255, 255, 255, 0.64); line-height: 1.5;
  margin-top: 8px;
}
/* Ventajas (máx. 3). `min-height:0` + `overflow:hidden` en pantallas bajas: antes
   que desbordar la columna, la lista se recorta — el precio y el CTA no se
   pierden nunca. */
.empezar-feats {
  list-style: none; margin: 12px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 0; overflow: hidden;
}
.empezar-feats li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12.5px; line-height: 1.45; color: rgba(255, 255, 255, 0.78);
}
.empezar-check {
  flex: none; margin-top: 2px;
  width: 14px; height: 14px;
  color: var(--gold-light, #f0b429);
}
.empezar-check svg { width: 14px; height: 14px; display: block; }
/* La promesa de la prueba, en blanco pleno: es lo último que se lee antes del
   botón, así que va a peso completo y no compite con las ventajas de arriba. */
.empezar-price { margin: 12px 0 0; font-size: 12.5px; line-height: 1.4; }
.empezar-price strong { color: #fff; font-weight: 700; }
.empezar-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
/* Solo se ve si el catálogo no trae ningún producto disponible (configuración
   rota): sin esto el panel quedaría en blanco y mudo. */
.empezar-vacio { font-size: 13px; color: rgba(255, 255, 255, 0.64); line-height: 1.5; }
/* "Empezar" dorado con GLOW. */
.empezar-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  border-radius: var(--r-ui);
  font-family: var(--f-sans);
  font-size: 13px; font-weight: 700;
  background: var(--gold-light); color: var(--ink);
  box-shadow: 0 0 0 1px rgba(240, 180, 41, 0.25), 0 4px 22px rgba(240, 180, 41, 0.5);
  transition: background .16s var(--ease-out), box-shadow .16s, transform .12s, color .16s;
}
.empezar-cta:hover { background: var(--gold); color: #fff; box-shadow: 0 0 0 1px rgba(240, 180, 41, 0.4), 0 6px 28px rgba(240, 180, 41, 0.65); }
.empezar-cta:active { transform: translateY(1px); }
.empezar-cta svg { width: 14px; height: 14px; }
/* "Más info" en GRIS (botón sutil sobre el card oscuro), con glow suave. */
.empezar-info {
  display: inline-flex; align-items: center;
  padding: 9px 16px;
  border-radius: var(--r-ui);
  font-family: var(--f-sans);
  font-size: 13px; font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: background .16s var(--ease-out), box-shadow .16s, border-color .16s;
}
.empezar-info:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.3); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); text-decoration: none; }
.empezar-item--soon { opacity: 0.72; }
/* Ahora vive DENTRO de .empezar-foot (con "Más info" al lado), así que ya no se
   posiciona solo: solo es la pastilla. */
.empezar-soon-badge {
  display: inline-flex; align-items: center;
  font-family: var(--f-sans);
  font-size: 12px; font-weight: 700;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--r-ui);
  padding: 8px 14px;
}

/* ════════ DERECHA: fondo claro + navbar + negocios ════════ */
.hub-right { display: flex; flex-direction: column; min-width: 0; }

.hub-nav-wrap {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: color-mix(in srgb, var(--paper-warm) 85%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.hub-nav {
  height: 68px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
}
.hub-nav-logo { font-size: 19px; flex-shrink: 0; transition: opacity .18s var(--ease-out); }
.hub-nav-logo:hover { opacity: 0.75; }

/* ── Menú de usuario (sobre fondo claro) ── */
.hub-account { position: relative; flex-shrink: 0; }
/* Sin borde ni caja: solo el círculo con la inicial + el nombre + la flecha.
   Un fondo sutil solo al pasar/abrir. */
.hub-user-chip {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 5px 10px 5px 5px;
  border-radius: 100px;
  border: none;
  background: transparent;
  transition: background .15s;
  max-width: 220px;
}
.hub-user-chip:hover,
.hub-user-chip[aria-expanded="true"] { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.hub-user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--signal); color: #fff;
  font-family: var(--f-sans); font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; text-transform: uppercase;
}
.hub-user-name { font-size: 13.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-user-caret { width: 15px; height: 15px; color: var(--steel); flex-shrink: 0; transition: transform .2s var(--ease-out); }
.hub-user-chip[aria-expanded="true"] .hub-user-caret { transform: rotate(180deg); }

.hub-account-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 288px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 30px 70px -28px rgba(11, 16, 32, 0.35), 0 8px 20px -12px rgba(11, 16, 32, 0.18);
  z-index: 30;
  animation: hub-fade .18s var(--ease-out) both;
}
.hub-account-id { display: flex; align-items: center; gap: 12px; padding: 10px 11px 12px; }
.hub-account-avatar {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--signal); color: #fff;
  font-family: var(--f-sans); font-weight: 800; font-size: 17px;
  display: inline-flex; align-items: center; justify-content: center;
  text-transform: uppercase;
}
.hub-account-id-text { min-width: 0; }
.hub-account-name { font-family: var(--f-sans); font-size: 14.5px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-account-email { font-size: 12.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-account-provider {
  display: flex; align-items: center; gap: 8px;
  margin: 0 3px 4px; padding: 8px 11px;
  border-radius: 10px; background: var(--paper-cool);
  font-size: 12.5px; color: var(--ink-soft);
}
.hub-account-provider strong { color: var(--ink); font-weight: 700; }
.hub-account-sep { height: 1px; background: var(--line); margin: 6px 3px; }
.hub-account-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 10px 11px;
  border-radius: 10px;
  font-family: var(--f-sans); font-size: 14px; font-weight: 600;
  color: var(--ink); text-align: left;
  transition: background .14s var(--ease-out);
}
.hub-account-item svg { width: 17px; height: 17px; color: var(--steel); flex-shrink: 0; }
.hub-account-item:hover { background: var(--paper-cool); }
.hub-account-item.is-danger { color: var(--danger); }
.hub-account-item.is-danger svg { color: var(--danger); }
.hub-account-item.is-danger:hover { background: var(--danger-soft); }

/* ── Contenido derecho ── */
.hub-main { padding: 22px 32px 30px; max-width: 1040px; }
.negocios-head { margin-bottom: 12px; }
.hub-h1 {
  font-family: var(--f-sans);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.1;
  color: var(--ink);
}
.hub-h1 em { font-style: italic; color: var(--signal); }
.negocios-sub { font-size: 15px; color: var(--ink-soft); line-height: 1.5; margin-top: 8px; }

/* Panel blanco con la tabla. Bordes más contenidos y sombra sobria (no
   "flotante de juguete"): una tabla de dato, profesional. */
.biz-panel {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(20, 40, 90, 0.06), 0 12px 30px -22px rgba(20, 40, 90, 0.28);
  overflow: hidden;
}
.biz-panel-head {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.biz-search { position: relative; flex: 1; display: flex; align-items: center; max-width: 320px; }
.biz-search-icon { position: absolute; left: 12px; color: var(--slate); display: inline-flex; pointer-events: none; }
.biz-search-icon svg { width: 16px; height: 16px; }
.biz-search-input {
  width: 100%;
  font-family: var(--f-sans); font-size: 13.5px; color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--fog);
  border-radius: 9px;
  padding: 9px 13px 9px 35px;
  transition: border-color .15s, box-shadow .15s;
}
.biz-search-input::placeholder { color: var(--slate); }
.biz-search-input:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px rgba(0, 97, 255, 0.10); }
.biz-count { font-family: var(--f-sans); font-size: 13px; font-weight: 600; color: var(--steel); flex-shrink: 0; }

/* Tabla: Producto | Negocio | Tu rol | Acceso. thead y filas comparten el MISMO
   grid → cabeceras alineadas con su columna. (Fuera "Estado": más sencillo; el
   estado va como pill pequeño junto al nombre del negocio.) */
.biz-table { display: block; }
.biz-thead, .biz-row {
  display: grid;
  grid-template-columns: 1fr 1.7fr 0.9fr 132px;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
}
.biz-thead { height: 42px; background: var(--paper-cool); border-bottom: 1px solid var(--line); }
.biz-th { font-family: var(--f-sans); font-size: 12px; font-weight: 700; color: var(--steel); }
.biz-th--action { text-align: right; }
.biz-row { min-height: 56px; border-bottom: 1px solid var(--line-soft); transition: background .12s var(--ease-out); }
#biz-rows .biz-row:last-child { border-bottom: none; }
.biz-row:hover { background: var(--paper-cool); }

.biz-cell-product { display: flex; align-items: center; gap: 11px; min-width: 0; }
.biz-row-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 9px;
  background: color-mix(in srgb, var(--prod, var(--signal)) 12%, transparent);
  color: var(--prod, var(--signal));
  display: inline-flex; align-items: center; justify-content: center;
}
.biz-row-icon svg { width: 18px; height: 18px; }
.biz-row-product { font-family: var(--f-sans); font-size: 14px; font-weight: 600; color: var(--ink); }
.biz-cell-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.biz-row-name { font-family: var(--f-sans); font-size: 14.5px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz-row-slug { font-family: var(--f-sans); font-size: 12px; color: var(--steel); }
.biz-cell-role { font-size: 13.5px; color: var(--ink-soft); }
.biz-cell-action { display: flex; justify-content: flex-end; }

.biz-row-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px;
  border-radius: var(--r-ui);
  font-family: var(--f-sans); font-size: 13px; font-weight: 700;
  color: #fff; background: var(--ink); white-space: nowrap;
  transition: background .18s var(--ease-out), box-shadow .18s, transform .18s;
}
.biz-row-action:hover { background: var(--signal); box-shadow: 0 4px 16px rgba(0, 97, 255, 0.32); }
.biz-row-action:active { transform: translateY(1px); }
.biz-row-action svg { width: 14px; height: 14px; }
.biz-row-action.is-pending { background: var(--gold-light); color: var(--ink); }
.biz-row-action.is-pending:hover { background: var(--gold); color: #fff; box-shadow: 0 4px 16px rgba(240, 180, 41, 0.36); }
.biz-row-action--disabled { background: var(--paper-cool); color: var(--slate); cursor: not-allowed; }
.biz-row-action--disabled:hover { background: var(--paper-cool); box-shadow: none; }

/* Paginador (8 por página): solo aparece si hay más de una página. */
.biz-pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.biz-page-info { font-family: var(--f-sans); font-size: 12.5px; color: var(--steel); }
.biz-page-btns { display: flex; align-items: center; gap: 6px; }
.biz-page-num { font-family: var(--f-sans); font-size: 12.5px; font-weight: 600; color: var(--ink-soft); padding: 0 4px; }
.biz-page-btn {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--canvas);
  color: var(--ink-soft);
  transition: border-color .14s, color .14s, background .14s;
}
.biz-page-btn svg { width: 15px; height: 15px; }
.biz-page-btn:not(:disabled):hover { border-color: var(--signal); color: var(--signal); background: var(--signal-bg); }
.biz-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.biz-empty { padding: 40px 28px; text-align: center; }
.biz-empty p { font-size: 15px; color: var(--ink-soft); line-height: 1.6; }
.biz-empty strong { display: block; color: var(--ink); font-size: 16.5px; font-weight: 700; margin-bottom: 5px; }
.hub-load-error { color: var(--danger); }

/* ════════ MODAL: cambiar contraseña ════════ */
.hub-modal {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: hub-fade .18s var(--ease-out) both;
}
.hub-modal-card {
  position: relative;
  width: 100%; max-width: 440px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 30px 28px;
  box-shadow: 0 44px 90px -36px rgba(11, 16, 32, 0.5);
}
.hub-modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 34px; height: 34px; border-radius: 9px; color: var(--steel);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .14s, color .14s;
}
.hub-modal-close:hover { background: var(--paper-cool); color: var(--ink); }
.hub-modal-close svg { width: 18px; height: 18px; }
.cuenta-pw-title { font-family: var(--f-sans); font-size: 20px; font-weight: 700; color: var(--ink); }
.cuenta-pw-sub { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; margin: 6px 0 20px; }
.cuenta-pw-google { font-size: 14px; color: var(--ink-soft); line-height: 1.6; margin-top: 4px; }
.cuenta-pw-google a { color: var(--signal); font-weight: 600; }
.cuenta-pw-google a:hover { text-decoration: underline; }

/* ════════ BACKDROP ════════ */
.hub-backdrop {
  position: fixed; inset: 0;
  background: rgba(6, 10, 22, 0.5);
  backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity .2s, visibility 0s linear .2s;
  z-index: calc(var(--z-modal) - 1);
}
.hub-backdrop.is-visible { opacity: 1; visibility: visible; transition: opacity .2s; }
@keyframes hub-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ════════ RESPONSIVE ════════ */
@media (max-width: 900px) {
  /* Apila: derecha (navbar + negocios) primero, izquierda (empezar) debajo. */
  .hub-shell { grid-template-columns: 1fr; }
  .hub-right { order: 1; }
  .hub-left { order: 2; position: static; height: auto; padding: 30px 20px 40px; }
  .empezar-list { margin-top: 20px; }
  .empezar-item { flex: initial; min-height: 0; }
  .hub-nav { padding: 0 20px; }
  .hub-main { padding: 28px 20px 60px; }
}

@media (max-width: 640px) {
  .biz-thead { display: none; }
  .biz-row { grid-template-columns: 1fr !important; gap: 8px; padding: 16px 18px; min-height: 0; }
  .biz-cell-role { display: flex; align-items: center; gap: 8px; }
  .biz-cell-role::before { content: attr(data-label); font-size: 12px; font-weight: 700; color: var(--steel); min-width: 64px; }
  .biz-cell-action { margin-top: 4px; }
  .biz-row-action { width: 100%; }
  .hub-user-name { display: none; }
  .hub-account-menu { width: 260px; }
}
