/* Paredes Bienes Raíces — sistema visual: azul corporativo, blanco y grises */

:root {
  --pbr-white: #ffffff;
  /* Fondos */
  --pbr-bg: #e8edf5;
  --pbr-bg-muted: #f4f7fb;
  --pbr-surface: #ffffff;
  --pbr-surface-muted: #f0f4f9;
  /* Texto */
  --pbr-text: #152433;
  --pbr-muted: #5c6b7a;
  --pbr-muted-light: #8a95a3;
  /* Bordes y líneas */
  --pbr-border: #c8d4e3;
  --pbr-border-light: #e2e8f0;
  /* Azul marca */
  --pbr-accent: #003366;
  --pbr-accent-hover: #00264d;
  --pbr-accent-soft: #d6e2f0;
  --pbr-accent-ghost: rgba(0, 51, 102, 0.1);
  --pbr-blue-mid: #3d6ea3;
  --pbr-radius: 10px;
  --pbr-radius-lg: 14px;
  --pbr-layout-max: min(1320px, 96%);
  --pbr-shadow-sm: 0 1px 2px rgba(13, 27, 42, 0.06);
  --pbr-shadow: 0 14px 40px rgba(13, 27, 42, 0.09);
  --pbr-shadow-btn: 0 6px 16px rgba(0, 51, 102, 0.22);
  --pbr-focus-ring: 0 0 0 3px rgba(0, 51, 102, 0.22);
  --pbr-font: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pbr-grid-kpi-cols: repeat(auto-fill, minmax(10.5rem, 1fr));
  --pbr-grid-modulo-cols: repeat(3, minmax(0, 1fr));
  --pbr-sidebar-cols: minmax(220px, 248px) 1fr;
  --pbr-touch-min: 40px;
}

/* ——— Django Admin (/interno/) ——— */
body {
  background: var(--pbr-bg);
  font-family: var(--pbr-font);
  color: var(--pbr-text);
}

#header {
  background: var(--pbr-surface);
  color: var(--pbr-text);
  border-bottom: 1px solid var(--pbr-border);
  box-shadow: none;
}

#header a:link,
#header a:visited {
  color: var(--pbr-accent);
}

#header a:hover {
  color: var(--pbr-accent-hover);
}

#branding h1,
#site-name a {
  color: var(--pbr-text) !important;
  font-weight: 600;
}

div.breadcrumbs {
  background: var(--pbr-bg-muted);
  color: var(--pbr-muted);
  border-bottom: 1px solid var(--pbr-border-light);
}

.module h2,
.module caption,
.inline-group h2 {
  background: var(--pbr-bg-muted);
  color: var(--pbr-text);
  border-bottom: 1px solid var(--pbr-border-light);
  font-weight: 600;
}

/* Enlaces en consola admin (no global: evita texto azul sobre botón azul en la app) */
#container a:link,
#container a:visited {
  color: var(--pbr-accent);
}

.button,
input[type="submit"],
input[type="button"],
.submit-row input,
a.button {
  background: var(--pbr-accent);
  border-color: var(--pbr-accent);
  color: var(--pbr-white);
  border-radius: var(--pbr-radius);
}

.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.submit-row input:hover,
a.button:hover {
  background: var(--pbr-accent-hover);
  border-color: var(--pbr-accent-hover);
}

.object-tools a:link,
.object-tools a:visited {
  background: var(--pbr-muted);
  border-radius: var(--pbr-radius);
}

.object-tools a:hover {
  background: var(--pbr-text);
}

/* ——— App web ——— */
.app-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--pbr-font);
  font-size: 15px;
  line-height: 1.5;
  background: radial-gradient(1200px 600px at 12% -10%, #dce6f2 0%, transparent 55%),
    radial-gradient(900px 480px at 88% 0%, #d8e4f0 0%, transparent 50%),
    var(--pbr-bg);
  color: var(--pbr-text);
  -webkit-font-smoothing: antialiased;
}

.app-wrap {
  width: var(--pbr-layout-max);
  margin: 0 auto;
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
}

/* Cabecera */
.app-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
  border-bottom: 1px solid var(--pbr-border);
  padding: 0;
  box-shadow: var(--pbr-shadow-sm);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, background 0.25s ease, backdrop-filter 0.25s ease;
}

.app-header--scrolled {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}

.app-header--scrolled .brand__img {
  max-height: 68px;
}

.app-header--scrolled .app-wrap.app-header__inner {
  min-height: 72px;
}

.app-header--hide {
  transform: translateY(calc(-100% - 2px));
}

html[data-pbr-reduced-motion="1"] .app-header {
  transition: box-shadow 0.25s ease, background 0.25s ease;
}

html[data-pbr-reduced-motion="1"] .app-header--hide {
  transform: none;
}

.app-header .app-wrap.app-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}

.app-header__right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.15rem;
  margin-left: auto;
}

.app-header__logout {
  margin: 0;
}

.app-header__logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid rgba(0, 51, 102, 0.14);
  border-radius: 999px;
  background: #fff;
  color: var(--pbr-accent);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--pbr-shadow-sm);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.app-header__logout-btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.app-header__logout-btn:hover {
  background: var(--pbr-accent-soft);
  border-color: rgba(0, 51, 102, 0.28);
}

.app-header__logout-btn:active {
  transform: scale(0.98);
}

.app-user-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.85rem 0.4rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--pbr-border-light);
  box-shadow: var(--pbr-shadow-sm);
  max-width: min(320px, 48vw);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.app-user-chip:hover {
  border-color: rgba(0, 51, 102, 0.22);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
}

.app-user-chip__avatar {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, var(--pbr-accent), var(--pbr-blue-mid, #1e4976));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 6px rgba(0, 51, 102, 0.25);
}

.app-user-chip__body {
  min-width: 0;
  line-height: 1.25;
}

.app-user-chip__name {
  display: block;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--pbr-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-user-chip__login {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--pbr-muted);
}

.app-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.2rem;
  padding: 0.12rem 0.45rem 0.12rem 0.2rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pbr-accent);
  background: var(--pbr-accent-soft, rgba(0, 51, 102, 0.08));
}

.app-role-badge--admin {
  color: #7c3aed;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(99, 102, 241, 0.08));
}

.app-role-badge .status-badge {
  width: 14px;
  height: 14px;
}

.app-role-badge .status-badge::before {
  inset: 1px;
}

.app-role-badge .status-badge::after {
  width: 6px;
  height: 6px;
  border-width: 1px;
}

/* Indicador “en línea” — aro suave + núcleo con brillo (cabecera y sidebar) */
.status-badge {
  position: relative;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.status-badge::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(160deg, rgba(134, 239, 172, 0.35), rgba(22, 163, 74, 0.06));
  border: 1px solid rgba(22, 163, 74, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 1px 4px rgba(15, 23, 42, 0.06);
}

.status-badge::after {
  content: "";
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #bbf7d0, #22c55e 45%, #15803d 88%, #14532d);
  border: 2px solid #fff;
  box-shadow:
    0 0 0 1px rgba(22, 163, 74, 0.35),
    0 2px 8px rgba(22, 163, 74, 0.45),
    inset 0 -1px 2px rgba(20, 83, 45, 0.35);
}

.status-badge--compact {
  width: 22px;
  height: 22px;
}

.status-badge--compact::after {
  width: 9px;
  height: 9px;
  border-width: 1.5px;
}

.status-badge--online::after {
  animation: status-badge-pulse 2.5s ease-in-out infinite;
}

@keyframes status-badge-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(22, 163, 74, 0.35),
      0 2px 8px rgba(22, 163, 74, 0.45),
      0 0 0 0 rgba(34, 197, 94, 0.55),
      inset 0 -1px 2px rgba(20, 83, 45, 0.35);
  }

  55% {
    box-shadow:
      0 0 0 1px rgba(22, 163, 74, 0.45),
      0 3px 12px rgba(22, 163, 74, 0.55),
      0 0 0 7px rgba(34, 197, 94, 0),
      inset 0 -1px 2px rgba(20, 83, 45, 0.35);
  }
}

.app-session {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-align: right;
  line-height: 1.25;
  max-width: min(300px, 46vw);
}

.app-session__stack {
  min-width: 0;
  flex: 1;
}

.app-session__name {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--pbr-text);
}

.app-session__login {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--pbr-muted);
}

.app-session__rol {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pbr-accent);
}

@media (max-width: 640px) {
  .app-session {
    text-align: left;
    max-width: none;
  }
}

.brand {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--pbr-text);
  text-decoration: none;
}

.brand--logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  line-height: 0;
  flex-shrink: 0;
  min-width: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.brand__img {
  display: block;
  height: auto;
  width: auto;
  max-height: 84px;
  max-width: min(580px, 92vw);
  flex-shrink: 0;
  object-fit: contain;
  object-position: left center;
  transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.2s ease;
}

.brand__tagline {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  line-height: 1.1;
  max-width: 7.5rem;
  white-space: normal;
}

.brand__tagline-name {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pbr-accent);
}

.brand__tagline-lines {
  display: flex;
  flex-direction: column;
  gap: 0.02rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--pbr-blue-mid);
}

.brand__wordmark {
  display: none;
  flex-direction: column;
  gap: 0.1rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--pbr-accent);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand__wordmark-sub {
  font-weight: 600;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.72;
}

.brand:hover .brand__img {
  opacity: 0.94;
  transform: scale(1.01);
}

.brand:hover {
  color: var(--pbr-accent);
}

.brand:active .brand__img {
  transform: scale(0.99);
}

.login-card__brand {
  margin: 0 0 1rem;
  text-align: center;
}

.login-card__logo {
  display: inline-block;
  height: auto;
  max-height: 168px;
  width: auto;
  max-width: min(100%, 520px);
  object-fit: contain;
}

.app-header::after {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--pbr-accent), var(--pbr-blue-mid), rgba(0, 51, 102, 0));
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--pbr-border-light);
  box-shadow: var(--pbr-shadow-sm);
}

.app-nav__logout {
  margin: 0;
  display: contents;
}

.app-nav__link,
.app-nav a,
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--pbr-muted);
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.app-nav__icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 0.15s ease;
}

.app-nav__link:hover,
.app-nav a:hover,
.link-btn:hover {
  color: var(--pbr-accent);
  background: var(--pbr-accent-soft);
}

.app-nav__link:hover .app-nav__icon,
.app-nav a:hover .app-nav__icon,
.link-btn:hover .app-nav__icon {
  opacity: 1;
}

.app-nav__link.is-active,
.app-nav a.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--pbr-accent), var(--pbr-blue-mid, #1e4976));
  box-shadow: 0 2px 8px rgba(0, 51, 102, 0.28);
  font-weight: 600;
}

.app-nav__link.is-active .app-nav__icon,
.app-nav a.is-active .app-nav__icon {
  opacity: 1;
  stroke: #fff;
}

.app-nav__link--primary {
  color: var(--pbr-accent);
  font-weight: 600;
}

/* Botón destacado de ingreso (visitantes) */
.app-nav--guest {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.app-nav__cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.85rem 0.5rem 0.55rem;
  border-radius: 14px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, var(--pbr-accent) 0%, #1e4976 55%, #2d5a8a 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 4px 14px rgba(0, 51, 102, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.app-nav__cta-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.22) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 0.55s ease;
  pointer-events: none;
}

.app-nav__cta:hover .app-nav__cta-glow {
  transform: translateX(120%);
}

.app-nav__cta:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 22px rgba(0, 51, 102, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  filter: brightness(1.04);
}

.app-nav__cta:active {
  transform: translateY(0);
}

.app-nav__cta.is-active {
  box-shadow:
    0 0 0 3px rgba(0, 51, 102, 0.18),
    0 6px 18px rgba(0, 51, 102, 0.35);
}

.app-nav__cta-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

.app-nav__cta-icon svg {
  width: 1.15rem;
  height: 1.15rem;
  stroke: #fff;
}

.app-nav__cta-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  line-height: 1.15;
  min-width: 0;
}

.app-nav__cta-text strong {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.app-nav__cta-text small {
  font-size: 0.62rem;
  font-weight: 500;
  opacity: 0.88;
  letter-spacing: 0.02em;
}

.link-btn--logout:hover {
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.08);
}

.app-nav__link:active,
.app-nav a:active,
.link-btn:active {
  transform: translateY(0.5px);
}

.app-main {
  padding: 2rem 0 3rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
  color: var(--pbr-text);
}

.page-lead {
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  color: var(--pbr-muted);
}

.page-lead a {
  color: var(--pbr-accent);
  font-weight: 500;
}

.page-lead a:hover {
  color: var(--pbr-accent-hover);
}

/* Cabecera de pantalla (título + acciones alineados) */
.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.75rem;
  margin-bottom: 1.35rem;
}

.page-toolbar .page-title {
  margin: 0 0 0.35rem;
}

.page-toolbar__intro .page-title {
  margin-bottom: 0.35rem;
}

.page-toolbar__meta {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--pbr-muted);
  max-width: 40rem;
}

.page-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* Tablas dentro de panel elevado */
.data-panel {
  background: var(--pbr-surface);
  border: 1px solid var(--pbr-border-light);
  border-radius: var(--pbr-radius-lg);
  box-shadow: var(--pbr-shadow-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-panel .table {
  min-width: 640px;
}

.data-panel .table th:first-child,
.data-panel .table td:first-child {
  padding-left: 1.25rem;
}

.data-panel .table th:last-child,
.data-panel .table td:last-child {
  padding-right: 1.25rem;
}

.data-panel .table thead th {
  border-bottom: 1px solid var(--pbr-border);
  background: linear-gradient(180deg, var(--pbr-bg-muted) 0%, #eef2f7 100%);
  font-size: 0.6875rem;
  letter-spacing: 0.07em;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.data-panel .table tbody tr:last-child td {
  border-bottom: 0;
}

/* Estados y etiquetas */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 999px;
  white-space: nowrap;
}

.badge--disponible {
  background: #dcfce7;
  color: #166534;
}

.badge--reservado {
  background: #fef3c7;
  color: #92400e;
}

.badge--vendido {
  background: #e0e7ff;
  color: #3730a3;
}

.badge--bloqueado {
  background: #f3f4f6;
  color: #4b5563;
}

.badge--borrador {
  background: #f3f4f6;
  color: #4b5563;
}

.badge--activo {
  background: #dcfce7;
  color: #166534;
}

.badge--liquidado {
  background: #dbeafe;
  color: #1e40af;
}

.badge--cancelado {
  background: #fee2e2;
  color: #991b1b;
}

.badge--interesado {
  background: #e0f2fe;
  color: #0369a1;
}

.badge--cita_programada {
  background: #fef3c7;
  color: #92400e;
}

/* Acciones en filas de tabla */
.action-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.formato-list-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

/* Subir promesa / compraventa PDF desde el listado (mismo aspecto que Editar/PDF) */
.formato-list-promesa-form {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
}
/* No usar display:none: .click() desde el botón debe funcionar en todos los navegadores */
.formato-list-promesa-file {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
button.link-action.formato-list-promesa-trigger {
  cursor: pointer;
  font: inherit;
}

.link-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pbr-accent);
  background: var(--pbr-accent-ghost);
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

.link-action:hover {
  background: var(--pbr-accent-soft);
  color: var(--pbr-accent-hover);
}

.card {
  background: var(--pbr-surface);
  border: 1px solid var(--pbr-border-light);
  border-radius: var(--pbr-radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: var(--pbr-shadow-sm);
}

.card h1,
.card h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.card h2 {
  font-size: 1rem;
  color: var(--pbr-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cliente-inmuebles-panel {
  margin: 0 0 1.25rem;
}

.cliente-inmuebles-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.cliente-inmuebles-panel__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: var(--pbr-text);
  text-transform: none;
  letter-spacing: normal;
}

.cliente-inmuebles-panel__lead {
  margin: 0;
  font-size: 0.875rem;
  max-width: 42rem;
}

.cliente-inmuebles-panel__section {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pbr-muted);
  margin: 1rem 0 0.5rem;
}

.cliente-inmuebles-panel__section:first-of-type {
  margin-top: 0;
}

.cliente-inmuebles-panel__list {
  margin: 0;
  padding-left: 1.15rem;
}

.cliente-inmuebles-panel__list li + li {
  margin-top: 0.35rem;
}

.cliente-inmuebles-panel__empty {
  margin: 1rem 0 0;
}

.cliente-inmuebles-panel__routes {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .cliente-inmuebles-panel__routes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cliente-inmuebles-panel__route {
  border: 1px solid var(--pbr-border-light);
  border-radius: var(--pbr-radius);
  padding: 1rem;
  background: var(--pbr-surface-alt, #fafafa);
}

.cliente-inmuebles-panel__route--gestion {
  border-color: color-mix(in srgb, var(--pbr-gestion, #8b6914) 25%, var(--pbr-border-light));
}

.cliente-inmuebles-panel__route-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pbr-muted);
  margin: 0 0 0.5rem;
}

.cliente-inmuebles-panel__route-desc {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  line-height: 1.45;
}

.cliente-inmuebles-panel__route .cliente-inmuebles-panel__list {
  margin-top: 0.75rem;
}

.grid-kpis {
  display: grid;
  grid-template-columns: var(--pbr-grid-kpi-cols);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.grid-modulos {
  display: grid;
  grid-template-columns: var(--pbr-grid-modulo-cols);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.kpi {
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--pbr-accent);
  background: linear-gradient(135deg, var(--pbr-white) 0%, var(--pbr-bg-muted) 100%);
}

.kpi h3 {
  margin: 0;
  color: var(--pbr-muted);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kpi p {
  margin: 0.35rem 0 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--pbr-accent);
}

.modulo {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  border: 1px solid var(--pbr-border-light);
}

.modulo:hover {
  border-color: var(--pbr-accent);
  background: var(--pbr-surface);
  box-shadow: var(--pbr-shadow-sm);
}

.modulo h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--pbr-accent);
}

.modulo p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--pbr-muted);
  line-height: 1.45;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td {
  border-bottom: 1px solid var(--pbr-border-light);
  text-align: left;
  padding: 0.65rem 0.5rem;
}

.table thead th {
  color: var(--pbr-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--pbr-surface-muted);
  border-bottom: 1px solid var(--pbr-border);
}

.right {
  text-align: right;
}

.table tbody tr:hover {
  background: var(--pbr-accent-ghost);
}

.table tbody a {
  color: var(--pbr-accent);
  font-weight: 500;
}

.table tbody a:hover {
  color: var(--pbr-accent-hover);
}

.login-card {
  width: min(400px, 100%);
  margin: 2.5rem auto;
}

.login-card .page-title {
  margin-bottom: 0.25rem;
}

.login-card .page-lead {
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  gap: 0.5rem;
}

.form-grid label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--pbr-muted);
}

.form-grid input {
  border: 1px solid var(--pbr-border);
  border-radius: var(--pbr-radius);
  padding: 0.6rem 0.75rem;
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--pbr-white);
  color: var(--pbr-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-grid input:focus {
  outline: none;
  border-color: var(--pbr-accent);
  box-shadow: var(--pbr-focus-ring);
}

/* ——— Pantalla de ingreso (/login/) ——— */
.app-body--login {
  --login-font: "Outfit", var(--pbr-font);
  --login-display: "Fraunces", Georgia, "Times New Roman", serif;
  font-family: var(--login-font);
  background:
    radial-gradient(ellipse 70% 50% at 8% -8%, rgba(0, 51, 102, 0.16), transparent 58%),
    radial-gradient(ellipse 55% 45% at 96% 0%, rgba(184, 148, 74, 0.14), transparent 55%),
    linear-gradient(165deg, #d5e0ef 0%, #e8edf5 42%, #eef3f9 100%);
}

.app-body--login .brand {
  display: none;
}

.app-body--login .app-header {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-body--login .app-header::after {
  height: 3px;
  opacity: 0.95;
  background: linear-gradient(90deg, var(--pbr-accent) 0%, var(--pbr-blue-mid) 45%, #8b5a2b 100%);
}

.app-body--login .app-header .app-wrap.app-header__inner {
  min-height: 56px;
  justify-content: flex-end;
}

.app-body--login .app-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 1.25rem 1rem 2rem;
  box-sizing: border-box;
}

@media (max-width: 520px) {
  .app-nav__cta-text small {
    display: none;
  }

  .app-nav__cta {
    padding: 0.45rem 0.75rem 0.45rem 0.45rem;
  }
}

.login-stage {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  margin-inline: auto;
}

.login-stage__atmosphere {
  pointer-events: none;
  position: absolute;
  inset: -2rem -1rem auto;
  height: min(70vh, 560px);
  z-index: 0;
  overflow: hidden;
}

.login-stage__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(4px);
  opacity: 0.55;
  animation: loginOrbDrift 16s ease-in-out infinite alternate;
}

.login-stage__orb--blue {
  width: min(40vw, 280px);
  height: min(40vw, 280px);
  left: -2%;
  top: 8%;
  background: radial-gradient(circle, rgba(61, 110, 163, 0.4), transparent 68%);
}

.login-stage__orb--gold {
  width: min(44vw, 300px);
  height: min(44vw, 300px);
  right: -4%;
  top: 0;
  background: radial-gradient(circle, rgba(184, 148, 74, 0.32), transparent 68%);
  animation-delay: -5s;
}

.login-stage__mesh {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(0, 51, 102, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 51, 102, 0.055) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 20%, #000 15%, transparent 75%);
}

@keyframes loginOrbDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(18px, 24px, 0) scale(1.08); }
}

.login-stage__layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(400px, 480px);
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: center;
}

.login-brands {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 38rem;
  padding: 0.15rem 0;
  animation: loginBrandsIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-brands__kicker {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pbr-blue-mid);
}

.login-brands__title {
  margin: 0 0 0.7rem;
  font-family: var(--login-display);
  font-size: clamp(1.75rem, 3.2vw, 2.45rem);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.02em;
  color: var(--pbr-accent);
}

.login-brands__title span {
  background: linear-gradient(105deg, #003366 8%, #3d6ea3 48%, #8a6b2c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-brands__lead {
  margin: 0 0 1.15rem;
  max-width: 32rem;
  color: var(--pbr-muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.login-visual {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 0.75rem;
  margin: 0 0 1.15rem;
  min-height: 14.5rem;
}

.login-visual__stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0.65rem;
  min-height: 14.5rem;
}

.login-visual__main,
.login-visual__side {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(200, 212, 227, 0.75);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 14px 32px rgba(13, 27, 42, 0.12);
  background: #1a2d42;
  isolation: isolate;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.login-visual__main {
  grid-row: 1 / -1;
  min-height: 14.5rem;
  animation: loginVisualIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 0.12s;
}

.login-visual__side {
  min-height: 0;
  animation: loginVisualIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-visual__side--lotes {
  animation-delay: 0.18s;
}

.login-visual__side--venta {
  animation-delay: 0.24s;
}

.login-visual__side--interior {
  grid-column: 1 / -1;
  animation-delay: 0.3s;
}

.login-visual__img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 5.5rem;
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-visual__main .login-visual__img {
  min-height: 14.5rem;
}

.login-visual__side--interior .login-visual__img {
  min-height: 5.75rem;
}

.login-visual__fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 35%, rgba(10, 24, 40, 0.72) 100%),
    linear-gradient(90deg, rgba(0, 51, 102, 0.12), transparent 45%);
  z-index: 1;
}

.login-visual__tag {
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: 0.55rem;
  z-index: 2;
  margin: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.login-visual__main:hover,
.login-visual__side:hover {
  transform: translateY(-4px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 22px 40px rgba(13, 27, 42, 0.18);
}

.login-visual__main:hover .login-visual__img,
.login-visual__side:hover .login-visual__img {
  transform: scale(1.08);
}

@keyframes loginVisualIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-brands__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
}

.login-brand-tile {
  --login-mx: 50%;
  --login-my: 40%;
  --login-soft: rgba(0, 51, 102, 0.1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 9.25rem;
  padding: 1.1rem 0.95rem 0.95rem;
  border-radius: 18px;
  border: 1px solid rgba(200, 212, 227, 0.95);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.92));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 10px 24px rgba(13, 27, 42, 0.06);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.login-brand-tile--br {
  --login-soft: rgba(0, 51, 102, 0.12);
}

.login-brand-tile--dev {
  --login-soft: rgba(184, 148, 74, 0.16);
}

.login-brand-tile__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    320px circle at var(--login-mx) var(--login-my),
    var(--login-soft),
    transparent 58%
  );
  transition: opacity 0.25s ease;
}

.login-brand-tile:hover {
  transform: translateY(-4px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 16px 32px rgba(13, 27, 42, 0.1);
}

.login-brand-tile:hover .login-brand-tile__glow {
  opacity: 1;
}

.login-brand-tile__logo {
  position: relative;
  z-index: 1;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 88px;
  object-fit: contain;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-brand-tile:hover .login-brand-tile__logo {
  transform: scale(1.04);
}

.login-brand-tile__caption {
  position: relative;
  z-index: 1;
  font-size: 0.84rem;
  line-height: 1.35;
  text-align: center;
  color: var(--pbr-muted);
}

@keyframes loginBrandsIn {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.login-shell {
  width: 100%;
  max-width: 440px;
}

.login-shell__inner {
  width: 100%;
}

.login-panel {
  --login-mx: 50%;
  --login-my: 30%;
  position: relative;
  width: 100%;
  background: var(--pbr-surface);
  border-radius: 24px;
  border: 1px solid rgba(0, 51, 102, 0.08);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 4px 6px -1px rgba(15, 23, 42, 0.05),
    0 32px 64px -16px rgba(0, 51, 102, 0.22);
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.login-panel:hover,
.login-panel:focus-within {
  transform: translateY(-4px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 8px 12px -2px rgba(15, 23, 42, 0.06),
    0 36px 70px -14px rgba(0, 51, 102, 0.26);
}

.login-panel__shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    420px circle at var(--login-mx) var(--login-my),
    rgba(0, 51, 102, 0.07),
    transparent 55%
  );
  transition: opacity 0.25s ease;
  z-index: 0;
}

.login-panel:hover .login-panel__shine,
.login-panel:focus-within .login-panel__shine {
  opacity: 1;
}

.login-panel--enter {
  animation: loginPanelEnter 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 0.08s;
}

@keyframes loginPanelEnter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

html[data-pbr-reduced-motion="1"] .login-panel--enter,
html[data-pbr-reduced-motion="1"] .login-brands,
html[data-pbr-reduced-motion="1"] .login-stage__orb {
  animation: none;
}

.login-panel__accent {
  position: relative;
  z-index: 1;
  height: 5px;
  background: linear-gradient(90deg, var(--pbr-accent), var(--pbr-blue-mid), #8a6b2c);
}

.login-panel__body {
  position: relative;
  z-index: 1;
  padding: 1.85rem 1.9rem 1.55rem;
}

@media (max-width: 480px) {
  .login-panel__body {
    padding: 1.4rem 1.2rem 1.2rem;
  }
}

.login-panel__eyebrow {
  margin: 0 0 0.45rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pbr-blue-mid);
}

.login-panel__title {
  margin: 0 0 0.45rem;
  font-family: var(--login-display);
  font-size: clamp(1.7rem, 2.6vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--pbr-accent);
  text-align: center;
}

.login-panel__lead {
  margin: 0 0 1.45rem;
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--pbr-muted);
  text-align: center;
}

@media (max-width: 960px) {
  .login-stage__layout {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-inline: auto;
    gap: 1.5rem;
  }

  .login-brands {
    text-align: center;
    max-width: none;
    padding: 0;
  }

  .login-brands__lead {
    margin-inline: auto;
  }

  .login-brands__title br {
    display: none;
  }

  .login-visual {
    min-height: 12rem;
  }

  .login-visual__stack {
    min-height: 12rem;
  }

  .login-visual__main,
  .login-visual__main .login-visual__img {
    min-height: 12rem;
  }
}

@media (max-width: 520px) {
  .login-brands__grid {
    grid-template-columns: 1fr;
  }

  .login-brand-tile {
    min-height: 0;
  }

  .login-visual {
    grid-template-columns: 1fr;
  }

  .login-visual__main {
    grid-row: auto;
  }

  .login-visual__stack {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    min-height: 0;
  }

  .login-visual__side--interior {
    grid-column: 1 / -1;
  }

  .login-visual__main,
  .login-visual__main .login-visual__img {
    min-height: 9rem;
  }

  .login-visual__side .login-visual__img {
    min-height: 6.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-brands,
  .login-panel--enter,
  .login-stage__orb,
  .login-visual__main,
  .login-visual__side {
    animation: none !important;
  }

  .login-brand-tile,
  .login-brand-tile__logo,
  .login-visual__main,
  .login-visual__side,
  .login-visual__img {
    transition: none !important;
  }

  .login-brand-tile:hover,
  .login-visual__main:hover,
  .login-visual__side:hover {
    transform: none;
  }
}

/* Marca de proyecto A & Z (discreta): A naranja, & negro, Z lila */
.pbr-project-mark {
  margin: 0 0 0.65rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  line-height: 1.3;
  user-select: none;
}

.pbr-project-mark__a {
  color: #c45c1a;
  letter-spacing: inherit;
}

.pbr-project-mark__amp {
  color: #0f172a;
  font-weight: 500;
  letter-spacing: 0.14em;
  margin: 0 0.04em;
}

.pbr-project-mark__z {
  color: #7a63c9;
  letter-spacing: inherit;
}

/* Formulario vendedor: rejilla de dos columnas (sin tarjeta blanca; fondo del área de gestión) */
.pbr-vendedor-form {
  max-width: 52rem;
}

.form-stack--vendedor .pbr-form-grid--vendedor {
  margin: 0;
}

.pbr-form-grid--vendedor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 1.35rem;
  align-items: start;
}

.pbr-form-grid--vendedor > .field {
  padding: 0.35rem 0 0.65rem;
  border-bottom: none;
}

.pbr-form-grid__full {
  grid-column: 1 / -1;
}

.pbr-form-grid--vendedor .field__control input,
.pbr-form-grid--vendedor .field__control select,
.pbr-form-grid--vendedor .field__control textarea {
  max-width: 100%;
}

.form-stack--vendedor textarea {
  min-height: 5.5rem;
  max-width: 100%;
}

.pbr-form-grid__checkbox {
  padding-top: 0.15rem;
  padding-bottom: 0.35rem;
}

.field__control--checkbox-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
}

.field__control--checkbox-inline input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--pbr-accent);
}

.field__label--checkbox {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pbr-text);
  cursor: pointer;
}

.pbr-vendedor-form-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pbr-border-light);
}

@media (max-width: 640px) {
  .pbr-form-grid--vendedor {
    grid-template-columns: 1fr;
  }
}

.login-panel__alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0 0 1.1rem;
  padding: 0.75rem 0.85rem;
  font-size: 0.875rem;
  border-radius: var(--pbr-radius);
  border: 1px solid transparent;
}

.login-panel__alert p {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  font-weight: 500;
}

.login-panel__alert-icon {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
}

.login-panel__alert--error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.login-panel__alert--error .login-panel__alert-icon {
  background: #fee2e2;
  color: #b91c1c;
}

.login-panel__alert--warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.login-panel__alert--warn .login-panel__alert-icon {
  background: #fef3c7;
  color: #b45309;
}

.login-panel__foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
  padding: 1rem 1.6rem 1.15rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--pbr-muted-light);
  background: linear-gradient(180deg, rgba(240, 244, 249, 0.65) 0%, rgba(248, 250, 252, 0.95) 100%);
  border-top: 1px solid var(--pbr-border-light);
}

/* Proyecto A & Z en el pie del login (encima del aviso legal) */
.pbr-project-mark--login-footer {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  opacity: 0.95;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.25rem 0.4em;
  text-transform: uppercase;
}

.pbr-project-mark__intro {
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.1em;
}

.pbr-project-mark--login-footer .pbr-project-mark__brand {
  display: inline-flex;
  align-items: baseline;
  font-weight: 700;
  gap: 0.32em;
  letter-spacing: 0;
}

.pbr-project-mark--login-footer .pbr-project-mark__amp {
  font-weight: 700;
  margin: 0 0.02em;
}

.login-panel__foot-legal {
  display: block;
  max-width: 22rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--pbr-muted-light);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.login-field__label {
  display: block;
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--pbr-text);
}

.login-field__row {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--pbr-border);
  border-radius: 14px;
  background: #fafbfc;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.login-field__row:hover {
  border-color: #b8c8db;
  background: var(--pbr-white);
  transform: translateY(-1px);
}

.login-field__row:focus-within {
  border-color: var(--pbr-accent);
  box-shadow: var(--pbr-focus-ring), 0 8px 20px rgba(0, 51, 102, 0.08);
  background: var(--pbr-white);
  transform: translateY(-1px);
}

.login-field--invalid .login-field__row {
  border-color: #f87171;
  background: #fffbfb;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

.login-field__toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  border: none;
  border-left: 1px solid var(--pbr-border-light);
  background: rgba(0, 51, 102, 0.04);
  color: var(--pbr-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.login-field__toggle:hover {
  color: var(--pbr-accent);
  background: var(--pbr-accent-soft);
}

.login-field__toggle-icon {
  width: 1.2rem;
  height: 1.2rem;
}

.login-field__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  flex-shrink: 0;
  background: rgba(0, 51, 102, 0.05);
  color: var(--pbr-accent);
  border-right: 1px solid var(--pbr-border-light);
}

.login-field__icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.login-input {
  flex: 1;
  min-width: 0;
  min-height: 56px;
  margin: 0;
  border: none !important;
  border-radius: 0 !important;
  padding: 0.8rem 1.1rem !important;
  font-size: 1.05rem !important;
  font-family: inherit !important;
  background: transparent !important;
  color: var(--pbr-text) !important;
  box-shadow: none !important;
}

.login-input:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Evita el fondo amarillo del autocompletado del navegador */
.login-panel .login-input:-webkit-autofill,
.login-panel .login-input:-webkit-autofill:hover,
.login-panel .login-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #f8fafc inset !important;
  box-shadow: 0 0 0 1000px #f8fafc inset !important;
  -webkit-text-fill-color: var(--pbr-text) !important;
  caret-color: var(--pbr-text);
  transition: background-color 99999s ease-out;
}

.login-field__error {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #b91c1c;
}

.login-form__submit {
  width: 100%;
  margin-top: 0.45rem;
  min-height: 58px;
  border-radius: 999px !important;
  font-size: 1.05rem !important;
  letter-spacing: 0.02em;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 12px 26px rgba(0, 51, 102, 0.24);
  transition: transform 0.22s ease, box-shadow 0.22s ease, gap 0.22s ease;
}

.login-form__submit-arrow {
  width: 1.05rem;
  height: 1.05rem;
  transition: transform 0.22s ease;
}

.login-form__submit.is-loading {
  pointer-events: none;
  opacity: 0.88;
}

.login-form__submit.is-loading .login-form__submit-arrow {
  display: none;
}

.login-form__submit-spinner {
  display: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: loginSpin 0.7s linear infinite;
}

.login-form__submit.is-loading .login-form__submit-spinner {
  display: block;
}

@keyframes loginSpin {
  to { transform: rotate(360deg); }
}

html[data-pbr-reduced-motion="1"] .login-form__submit-spinner {
  animation: none;
}

.login-form__submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 51, 102, 0.28);
  gap: 0.75rem;
}

.login-form__submit:hover .login-form__submit-arrow {
  transform: translateX(3px);
}

.login-form__submit:active {
  transform: translateY(0);
}

/* Botones */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 36px;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn-primary {
  border: 1px solid var(--pbr-accent);
  background: var(--pbr-accent);
  color: #ffffff;
  cursor: pointer;
  box-shadow: var(--pbr-shadow-btn);
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
  -webkit-appearance: none;
  appearance: none;
}

/* Enlaces con clase de botón: mayor especificidad que a:link */
a.btn-primary,
a.btn-primary:link,
a.btn-primary:visited {
  color: #ffffff;
}

.btn-primary:hover,
a.btn-primary:hover {
  background: var(--pbr-accent-hover);
  border-color: var(--pbr-accent-hover);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 51, 102, 0.28);
}

.btn-primary:active,
a.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 4px 12px rgba(0, 51, 102, 0.2);
  color: #ffffff;
}

.btn-block {
  display: block;
  text-align: center;
  text-decoration: none;
}

.btn-sm {
  min-height: 32px;
  padding: 0.45rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-secondary {
  border: 1px solid var(--pbr-border);
  background: #ffffff;
  color: #1a2d42;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease, color 0.12s ease;
  -webkit-appearance: none;
  appearance: none;
}

a.btn-secondary,
a.btn-secondary:link,
a.btn-secondary:visited {
  color: #1a2d42;
}

.btn-secondary:hover,
a.btn-secondary:hover {
  border-color: var(--pbr-accent);
  background: var(--pbr-accent-soft);
  color: #00264d;
}

.btn-secondary:active,
a.btn-secondary:active {
  transform: translateY(1px);
  color: #00264d;
}

.muted {
  color: var(--pbr-muted);
  font-size: 0.875rem;
}

.code-hint {
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.6;
}

.code-hint code {
  font-size: 0.75rem;
  background: var(--pbr-surface-muted);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--pbr-border-light);
  color: var(--pbr-text);
}

.alert {
  margin: 0.5rem 0 1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #fecaca;
  border-radius: var(--pbr-radius);
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.875rem;
}

.alert--success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.alert--success a {
  color: var(--pbr-accent);
  font-weight: 600;
}

/* Mensaje tras emitir recibo: título + acciones + notas breves */
.alert-recibo {
  margin: 0;
  text-align: left;
}

.alert-recibo__title {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: inherit;
}

.alert-recibo__actions {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.alert-recibo__sep {
  margin: 0 0.15rem;
  opacity: 0.55;
  font-weight: 400;
}

.alert-recibo__wa {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  color: #0b6b3a !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.alert-recibo__pdf {
  font-weight: 500;
}

.alert-recibo__meta {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--pbr-muted);
  font-weight: 400;
}

.alert--success .alert-recibo__meta {
  color: #3d6b4a;
}

.alert-recibo__meta--warn {
  color: #92400e !important;
  padding-top: 0.15rem;
}

.alert-recibo__meta code {
  font-size: 0.78em;
  background: rgba(255, 255, 255, 0.65);
  padding: 0.08rem 0.28rem;
  border-radius: 3px;
  border: 1px solid rgba(22, 101, 52, 0.2);
}

@media (max-width: 920px) {
  .grid-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-modulos {
    grid-template-columns: 1fr;
  }
}

/* ——— /app/ gestión ——— */
.app-layout {
  display: grid;
  grid-template-columns: var(--pbr-sidebar-cols);
  gap: 1.75rem;
  width: var(--pbr-layout-max);
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
  box-sizing: border-box;
}

.app-sidebar {
  position: sticky;
  top: 1rem;
  border: 1px solid var(--pbr-border-light);
  border-radius: var(--pbr-radius-lg);
  background: var(--pbr-surface);
  padding: 1.1rem 0.85rem;
  align-self: start;
  box-shadow: var(--pbr-shadow-sm);
  border-left: 3px solid var(--pbr-accent);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.app-sidebar__brand-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  margin: 0 0 0.25rem;
  border-radius: var(--pbr-radius);
  background: linear-gradient(135deg, rgba(0, 51, 102, 0.06), rgba(61, 110, 163, 0.08));
  border: 1px solid rgba(0, 51, 102, 0.1);
}

.app-sidebar__brand-chip-logo {
  width: auto;
  max-width: 3.25rem;
  max-height: 2.35rem;
  object-fit: contain;
  flex-shrink: 0;
}

.app-sidebar__brand-chip-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.app-sidebar__brand-chip-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pbr-blue-mid);
}

.app-sidebar__brand-chip-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--pbr-accent);
  line-height: 1.2;
}

.app-sidebar__hub + .app-sidebar__hub {
  margin-top: 0.15rem;
}

.app-sidebar__title {
  display: block;
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--pbr-accent);
  text-decoration: none;
  margin-bottom: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--pbr-border-light);
}

.app-sidebar__title:hover {
  color: var(--pbr-accent-hover);
}

.app-sidebar__title.is-active {
  color: var(--pbr-text);
}

.app-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.app-sidebar__nav a {
  color: var(--pbr-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
  border: 1px solid transparent;
}

.app-sidebar__nav a:hover {
  color: var(--pbr-accent);
  background: var(--pbr-accent-soft);
}

.app-sidebar__nav a.is-active {
  color: var(--pbr-accent);
  background: linear-gradient(90deg, var(--pbr-accent-soft) 0%, rgba(214, 226, 240, 0.35) 100%);
  border-color: rgba(0, 51, 102, 0.12);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--pbr-accent);
}

.app-sidebar__nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.15rem;
}

.app-sidebar__nav-group--top {
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--pbr-border-light);
}

.app-sidebar__nav-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pbr-muted);
  padding: 0.35rem 0.65rem 0;
}

.app-sidebar__nav-group--current .app-sidebar__nav-group-label {
  color: var(--pbr-accent);
}

/* —— Bloque único interactivo: Inmuebles —— */
.app-sidebar__hub {
  margin-bottom: 0.85rem;
  border-radius: var(--pbr-radius-lg);
  border: 1px solid rgba(0, 51, 102, 0.14);
  background: linear-gradient(165deg, #ffffff 0%, #f4f8fc 48%, #eef3f9 100%);
  box-shadow: 0 4px 18px rgba(0, 51, 102, 0.07);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.app-sidebar__hub--active {
  border-color: rgba(0, 51, 102, 0.28);
  box-shadow: 0 6px 22px rgba(0, 51, 102, 0.11);
}

.app-sidebar__hub--gestion {
  border-color: rgba(90, 62, 43, 0.16);
  background: linear-gradient(165deg, #ffffff 0%, #faf7f4 48%, #f3ece6 100%);
}

.app-sidebar__hub--clientes {
  border-color: rgba(15, 118, 110, 0.18);
  background: linear-gradient(165deg, #ffffff 0%, #f4fbfb 48%, #ecf8f6 100%);
}

.app-sidebar__hub--clientes.app-sidebar__hub--active {
  border-color: rgba(15, 118, 110, 0.32);
  box-shadow: 0 6px 22px rgba(15, 118, 110, 0.1);
}

.app-sidebar__hub--clientes .app-sidebar__hub-head {
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.08) 0%, transparent 100%);
}

.app-sidebar__hub--clientes .app-sidebar__hub-title {
  color: #0f766e;
}

.app-sidebar__hub-badge--clientes {
  background: rgba(15, 118, 110, 0.12);
}

.app-sidebar__hub--clientes .app-sidebar__quick.is-active {
  border-color: rgba(15, 118, 110, 0.28);
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.1) 0%, #fff 100%);
  box-shadow: inset 3px 0 0 #0f766e;
}

.app-sidebar__hub--clientes .app-sidebar__quick-text strong {
  color: #0f766e;
}

.app-sidebar__hub--vendedores {
  border-color: rgba(146, 98, 57, 0.2);
  background: linear-gradient(165deg, #ffffff 0%, #fdf9f4 48%, #f8f1e8 100%);
}

.app-sidebar__hub--vendedores.app-sidebar__hub--active {
  border-color: rgba(146, 98, 57, 0.34);
  box-shadow: 0 6px 22px rgba(146, 98, 57, 0.1);
}

.app-sidebar__hub--vendedores .app-sidebar__hub-head {
  background: linear-gradient(90deg, rgba(146, 98, 57, 0.08) 0%, transparent 100%);
}

.app-sidebar__hub--vendedores .app-sidebar__hub-title {
  color: #926239;
}

.app-sidebar__hub-badge--vendedores {
  background: rgba(146, 98, 57, 0.12);
}

.app-sidebar__hub--vendedores .app-sidebar__quick.is-active {
  border-color: rgba(146, 98, 57, 0.28);
  background: linear-gradient(90deg, rgba(146, 98, 57, 0.1) 0%, #fff 100%);
  box-shadow: inset 3px 0 0 #926239;
}

.app-sidebar__hub--vendedores .app-sidebar__quick-text strong {
  color: #926239;
}

.app-sidebar__hub--asesores-alquiler {
  border-color: rgba(37, 99, 168, 0.2);
  background: linear-gradient(165deg, #ffffff 0%, #f4f9ff 48%, #eaf3fc 100%);
}

.app-sidebar__hub--asesores-alquiler.app-sidebar__hub--active {
  border-color: rgba(37, 99, 168, 0.34);
  box-shadow: 0 6px 22px rgba(37, 99, 168, 0.1);
}

.app-sidebar__hub--asesores-alquiler .app-sidebar__hub-head {
  background: linear-gradient(90deg, rgba(37, 99, 168, 0.08) 0%, transparent 100%);
}

.app-sidebar__hub--asesores-alquiler .app-sidebar__hub-title {
  color: #2563a8;
}

.app-sidebar__hub-badge--asesores-alquiler {
  background: rgba(37, 99, 168, 0.12);
}

.app-sidebar__hub--asesores-alquiler .app-sidebar__quick.is-active {
  border-color: rgba(37, 99, 168, 0.28);
  background: linear-gradient(90deg, rgba(37, 99, 168, 0.1) 0%, #fff 100%);
  box-shadow: inset 3px 0 0 #2563a8;
}

.app-sidebar__hub--asesores-alquiler .app-sidebar__quick-text strong {
  color: #2563a8;
}

.app-sidebar__hub--gestion.app-sidebar__hub--active {
  border-color: rgba(90, 62, 43, 0.32);
  box-shadow: 0 6px 22px rgba(90, 62, 43, 0.1);
}

.app-sidebar__hub--gestion .app-sidebar__hub-head {
  background: linear-gradient(90deg, rgba(90, 62, 43, 0.07) 0%, transparent 100%);
}

.app-sidebar__hub--gestion .app-sidebar__hub-title {
  color: #5a3e2b;
}

.app-sidebar__hub-badge--gestion {
  background: rgba(90, 62, 43, 0.1);
}

.app-sidebar__hub-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid rgba(0, 51, 102, 0.08);
  background: linear-gradient(90deg, rgba(0, 51, 102, 0.06) 0%, transparent 100%);
}

.app-sidebar__hub-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  background: var(--pbr-accent-soft);
  font-size: 1.05rem;
  flex-shrink: 0;
}

.app-sidebar__hub-titles {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.app-sidebar__hub-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pbr-accent);
}

.app-sidebar__hub-sub {
  font-size: 0.68rem;
  color: var(--pbr-muted);
  line-height: 1.3;
}

.app-sidebar__hub-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.55rem 0.55rem 0.65rem;
}

.app-sidebar__quick {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--pbr-text);
  border: 1px solid rgba(0, 51, 102, 0.1);
  background: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.app-sidebar__quick:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 51, 102, 0.22);
  box-shadow: 0 4px 12px rgba(0, 51, 102, 0.08);
  background: #fff;
}

.app-sidebar__quick.is-active {
  border-color: rgba(0, 51, 102, 0.28);
  background: linear-gradient(90deg, var(--pbr-accent-soft) 0%, #fff 100%);
  box-shadow: inset 3px 0 0 var(--pbr-accent);
}

.app-sidebar__quick-icon {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.app-sidebar__quick-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.app-sidebar__quick-text strong {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--pbr-accent);
}

.app-sidebar__quick-text small {
  font-size: 0.68rem;
  color: var(--pbr-muted);
  line-height: 1.25;
}

.app-sidebar__accord {
  border-radius: 10px;
  border: 1px solid rgba(0, 51, 102, 0.08);
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.app-sidebar__accord[open] {
  border-color: rgba(0, 51, 102, 0.2);
  background: #fff;
}

.app-sidebar__accord--comision[open] {
  border-color: rgba(139, 90, 43, 0.28);
  background: linear-gradient(180deg, #fff 0%, #faf6f1 100%);
}

.app-sidebar__accord-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.55rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.12s ease;
}

.app-sidebar__accord-summary::-webkit-details-marker {
  display: none;
}

.app-sidebar__accord-summary:hover {
  background: var(--pbr-accent-soft);
}

.app-sidebar__accord-icon {
  font-size: 0.95rem;
  line-height: 1;
  flex-shrink: 0;
}

.app-sidebar__accord-label {
  flex: 1;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--pbr-text);
  letter-spacing: 0.02em;
}

.app-sidebar__accord-chevron {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--pbr-muted);
  border-bottom: 2px solid var(--pbr-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease, border-color 0.2s ease;
  margin-right: 0.15rem;
  flex-shrink: 0;
}

.app-sidebar__accord[open] .app-sidebar__accord-chevron {
  transform: rotate(-135deg);
  border-color: var(--pbr-accent);
  margin-top: 0.2rem;
}

.app-sidebar__accord-panel {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0 0.45rem 0.5rem 0.55rem;
  margin-left: 1.55rem;
  border-left: 2px solid rgba(0, 51, 102, 0.12);
  animation: pbrAccordIn 0.22s ease;
}

@keyframes pbrAccordIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-sidebar__accord-hint {
  margin: 0 0 0.25rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.66rem;
  line-height: 1.35;
  color: var(--pbr-muted);
  background: rgba(139, 90, 43, 0.06);
  border-radius: 6px;
}

.app-sidebar__accord-panel a {
  color: var(--pbr-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.38rem 0.5rem;
  border-radius: 7px;
  transition: background 0.12s ease, color 0.12s ease, padding-left 0.12s ease;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.app-sidebar__stat {
  flex-shrink: 0;
  min-width: 1.35rem;
  padding: 0.1rem 0.38rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  color: var(--pbr-accent);
  background: rgba(0, 51, 102, 0.08);
  border: 1px solid rgba(0, 51, 102, 0.12);
}

.app-sidebar__hub--gestion .app-sidebar__stat {
  color: #5a3e2b;
  background: rgba(90, 62, 43, 0.08);
  border-color: rgba(90, 62, 43, 0.14);
}

.app-sidebar__accord-panel a.is-active .app-sidebar__stat {
  background: rgba(255, 255, 255, 0.65);
}

.app-sidebar__accord-panel a:hover {
  color: var(--pbr-accent);
  background: var(--pbr-accent-soft);
  padding-left: 0.65rem;
}

.app-sidebar__accord-panel a.is-active {
  color: var(--pbr-accent);
  background: var(--pbr-accent-soft);
  border-color: rgba(0, 51, 102, 0.12);
  font-weight: 600;
  padding-left: 0.65rem;
  box-shadow: inset 2px 0 0 var(--pbr-accent);
}

.app-sidebar__nav-sub {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  padding-left: 0.45rem;
  margin-left: 0.35rem;
  border-left: 2px solid var(--pbr-border);
}

.app-sidebar__nav-sub-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pbr-muted);
  padding: 0.5rem 0.55rem 0.15rem;
  margin-top: 0.15rem;
}

.app-sidebar__nav-sub-label:first-child {
  margin-top: 0;
  padding-top: 0.15rem;
}

.app-sidebar__nav-sub a {
  color: var(--pbr-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  transition: background 0.12s ease, color 0.12s ease;
  border: 1px solid transparent;
}

.app-sidebar__nav-sub a:hover {
  color: var(--pbr-accent);
  background: var(--pbr-accent-soft);
}

.app-sidebar__nav-sub a.is-active {
  color: var(--pbr-accent);
  background: var(--pbr-accent-soft);
  border-color: rgba(0, 51, 102, 0.1);
  font-weight: 600;
}

.app-sidebar__foot {
  margin: 0.35rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--pbr-border-light);
  font-size: 0.8125rem;
}

/* —— Tarjeta de sesión (pie del sidebar) —— */
.app-sidebar__session {
  margin-top: 0.25rem;
}

.app-sidebar__session-card {
  border-radius: var(--pbr-radius-lg);
  border: 1px solid rgba(0, 51, 102, 0.12);
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 55%, #eef3f9 100%);
  box-shadow: 0 4px 16px rgba(0, 51, 102, 0.06);
  padding: 0.75rem 0.7rem 0.7rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.app-sidebar__session-card:hover {
  border-color: rgba(0, 51, 102, 0.22);
  box-shadow: 0 6px 20px rgba(0, 51, 102, 0.1);
}

.app-sidebar__session-top {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.app-sidebar__session-avatar {
  position: relative;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, var(--pbr-accent), #1e4976);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 3px 10px rgba(0, 51, 102, 0.28);
}

.app-sidebar__session-avatar--admin {
  background: linear-gradient(145deg, #7c3aed, #4f46e5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 3px 10px rgba(124, 58, 237, 0.35);
}

.app-sidebar__session-avatar-dot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35);
  animation: pbrSessionPulse 2.4s ease-in-out infinite;
}

@keyframes pbrSessionPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.88; }
}

html[data-pbr-reduced-motion="1"] .app-sidebar__session-avatar-dot {
  animation: none;
}

.app-sidebar__session-body {
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}

.app-sidebar__session-name {
  display: block;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--pbr-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar__session-login {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--pbr-muted);
  margin-top: 0.05rem;
}

.app-sidebar__session-role {
  margin-top: 0.35rem;
}

.app-sidebar__session-meta {
  margin: 0.55rem 0 0;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--pbr-muted);
  background: rgba(0, 51, 102, 0.05);
  border: 1px dashed rgba(0, 51, 102, 0.12);
}

.app-sidebar__session-meta-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.12rem;
}

.app-sidebar__session-meta strong {
  color: var(--pbr-accent);
  font-weight: 600;
}

.app-sidebar__session-empresa {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
  background: rgba(0, 51, 102, 0.06);
  border: 1px solid rgba(0, 51, 102, 0.12);
}

.app-sidebar__session-empresa-logo {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 6px;
  background: #fff;
  padding: 0.15rem;
}

.app-sidebar__session-empresa-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.app-sidebar__session-empresa-text strong {
  font-size: 0.78rem;
  line-height: 1.25;
  color: var(--pbr-accent, #003366);
}

.app-sidebar__session-empresa-note {
  font-size: 0.65rem;
  color: var(--pbr-muted, #64748b);
  line-height: 1.3;
}

.app-sidebar__session-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.app-sidebar__session-logout {
  grid-column: 1 / -1;
  margin: 0;
}

.app-sidebar__session-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.42rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 51, 102, 0.14);
  background: #fff;
  color: var(--pbr-accent);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.app-sidebar__session-btn svg {
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
}

.app-sidebar__session-btn:hover {
  background: var(--pbr-accent-soft);
  border-color: rgba(0, 51, 102, 0.24);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 51, 102, 0.08);
}

.app-sidebar__session-btn--ghost {
  color: var(--pbr-muted);
}

.app-sidebar__session-btn--ghost:hover {
  color: var(--pbr-accent);
}

.app-sidebar__session-btn--logout {
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.2);
  background: linear-gradient(180deg, #fff 0%, #fffaf5 100%);
}

.app-sidebar__session-btn--logout:hover {
  color: #92400e;
  background: #fff7ed;
  border-color: rgba(180, 83, 9, 0.35);
}

.app-sidebar__session-line {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.app-sidebar__user {
  display: inline-block;
  font-weight: 600;
  color: var(--pbr-text);
  font-size: 0.875rem;
}

.app-sidebar__login {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--pbr-muted);
  margin-left: 0.2rem;
}

.app-sidebar__rol {
  display: inline-block;
  font-weight: 600;
  color: var(--pbr-accent);
  font-size: 0.78rem;
}

.app-sidebar__foot a {
  color: var(--pbr-muted);
}

.app-sidebar__foot a:hover {
  color: var(--pbr-accent);
}

.app-content {
  min-width: 0;
}

.form-stack p {
  margin: 0 0 1rem;
}

.field {
  padding: 0.25rem 0 0.75rem;
  border-bottom: 1px dashed var(--pbr-border-light);
}

.field:last-of-type {
  border-bottom: 0;
}

.contrato-filtros-inmueble__row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.contrato-filtros-inmueble__row > .field {
  flex: 1 1 220px;
  max-width: 420px;
}

.field__label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--pbr-muted);
  margin-bottom: 0.35rem;
}

.field__control input,
.field__control select,
.field__control textarea {
  width: 100%;
  max-width: min(100%, 560px);
  box-sizing: border-box;
  border: 1px solid var(--pbr-border);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.9375rem;
  background: var(--pbr-white);
  color: var(--pbr-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__control input:focus,
.field__control select:focus,
.field__control textarea:focus {
  outline: none;
  border-color: var(--pbr-accent);
  box-shadow: var(--pbr-focus-ring);
}

/* Quitar el fondo amarillo del autofill (Chrome/Safari) en formularios /app/ */
.field__control input:-webkit-autofill,
.field__control input:-webkit-autofill:hover,
.field__control input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--pbr-white) inset !important;
  box-shadow: 0 0 0 1000px var(--pbr-white) inset !important;
  -webkit-text-fill-color: var(--pbr-text) !important;
  caret-color: var(--pbr-text);
  transition: background-color 99999s ease-out;
}

/* Firefox (cuando aplica) */
.field__control input:-moz-autofill,
.field__control input:-moz-autofill:hover,
.field__control input:-moz-autofill:focus {
  box-shadow: 0 0 0 1000px var(--pbr-white) inset;
  filter: none;
}

/* Campos calculados (solo lectura) en formulario de contrato */
.field__control input.input-calculado {
  background: var(--pbr-surface-muted);
  color: var(--pbr-text);
  cursor: default;
}

.field__control input.input-calculado:focus {
  box-shadow: none;
  border-color: var(--pbr-border);
}

.field__control input[type="file"] {
  padding: 0.4rem 0;
  font-size: 0.8125rem;
  border: 0;
  max-width: min(100%, 480px);
}

.field__help {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
}

.field__error {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: #b91c1c;
}

.form-stack textarea {
  min-height: 6rem;
  max-width: min(100%, 640px);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

/* Tarjeta informativa (no parece mensaje de error) */
.pbr-card--info {
  border-left: 3px solid #3b82f6;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.55) 0%, var(--pbr-surface) 100%);
}

.pbr-tech-details {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--pbr-border-light);
}

.pbr-tech-details summary {
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pbr-blue-mid);
  list-style-position: outside;
}

.pbr-tech-details summary:hover {
  color: var(--pbr-accent);
}

.pbr-tech-details__body {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--pbr-border-light);
  border-radius: 10px;
}

.pbr-code-sample {
  margin: 0;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.8125rem;
  overflow-x: auto;
  line-height: 1.45;
  color: #334155;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.875rem;
}

.pagination a {
  color: var(--pbr-accent);
  text-decoration: none;
  font-weight: 500;
}

.pagination a:hover {
  color: var(--pbr-accent-hover);
}

.pagination__meta {
  font-size: 0.8125rem;
  color: var(--pbr-muted);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.btn-row .btn-secondary {
  margin-top: 0;
}

.app-nav .nav-muted {
  color: var(--pbr-muted);
  font-size: 0.8125rem;
}

@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
  }
}

/* Plano de polígono (imagen / PDF subido) */
.poligono-plano-frame {
  display: block;
  max-width: 100%;
}

.poligono-plano-frame--clip {
  background: var(--pbr-surface-muted);
  border-radius: var(--pbr-radius);
  border: 1px solid var(--pbr-border-light);
  overflow: hidden;
}

.poligono-plano-preview {
  display: block;
  max-width: 100%;
  max-height: 360px;
  width: auto;
  height: auto;
  border: 1px solid var(--pbr-border-light);
  border-radius: var(--pbr-radius);
  object-fit: contain;
  background: var(--pbr-surface-muted);
}

.poligono-plano-preview--clipped {
  max-height: none;
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
}

.poligono-plano-thumb-wrap {
  display: inline-block;
  line-height: 0;
}

.poligono-plano-thumb {
  width: 56px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--pbr-border-light);
  vertical-align: middle;
}

/* Selector visual de recorte (polígono) */
.plano-crop-app {
  margin-top: 0.25rem;
}

.plano-crop-shell {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
  cursor: crosshair;
  user-select: none;
  touch-action: none;
  border: 1px solid var(--pbr-border-light);
  border-radius: var(--pbr-radius);
  background: var(--pbr-surface-muted);
  overflow: hidden;
}

.plano-crop-img {
  display: block;
  max-width: 100%;
  max-height: min(70vh, 520px);
  width: auto;
  height: auto;
}

.plano-crop-marquee {
  position: absolute;
  box-sizing: border-box;
  pointer-events: none;
  border: 2px dashed var(--pbr-accent);
  border-radius: 4px;
  background: rgba(0, 51, 102, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.plano-crop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Mapa interactivo de lotes */
.mapa-toolbar {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  align-items: end;
}

.mapa-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mapa-catastral-buscar {
  margin-top: 1rem;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--pbr-border-light);
}

.mapa-catastral-buscar__title {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--pbr-text, inherit);
}

.mapa-catastral-buscar__row {
  display: grid;
  gap: 0.65rem 0.75rem;
  grid-template-columns: repeat(2, minmax(120px, 1fr)) minmax(160px, 1.4fr) auto;
  align-items: end;
}

.mapa-catastral-buscar__field .field__label {
  font-size: 0.8rem;
}

.mapa-catastral-buscar__field--wide {
  grid-column: span 1;
}

.mapa-catastral-buscar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
  padding-bottom: 0.15rem;
}

.mapa-catastral-buscar__help {
  margin-top: 0.45rem;
  margin-bottom: 0;
  font-size: 0.8rem;
}

@media (max-width: 900px) {
  .mapa-catastral-buscar__row {
    grid-template-columns: 1fr 1fr;
  }

  .mapa-catastral-buscar__field--wide {
    grid-column: span 2;
  }

  .mapa-catastral-buscar__actions {
    grid-column: span 2;
  }
}

@media (max-width: 639px) {
  .mapa-catastral-buscar__row {
    grid-template-columns: 1fr;
  }

  .mapa-catastral-buscar__field--wide,
  .mapa-catastral-buscar__actions {
    grid-column: span 1;
  }
}

.mapa-lotes-canvas {
  margin-top: 0.75rem;
  width: 100%;
  min-height: 520px;
  border: 1px solid var(--pbr-border-light);
  border-radius: var(--pbr-radius);
  background: var(--pbr-surface-muted);
}

.mapa-catastral-canvas {
  margin-top: 0.75rem;
  width: 100%;
  min-height: 520px;
  border: 1px solid var(--pbr-border-light);
  border-radius: var(--pbr-radius);
  background: var(--pbr-surface-muted);
  z-index: 0;
}

.mapa-catastral-leyenda {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--pbr-text-muted);
}

.mapa-catastral-leyenda__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.mapa-catastral-leyenda .swatch {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.25);
}

.mapa-catastral-leyenda .swatch--contado {
  background: #1565c0;
  border-color: #0d47a1;
}

.mapa-catastral-leyenda .swatch--reservado {
  background: #ff9800;
  border-color: #e65100;
}

.mapa-catastral-leyenda .swatch--disponible {
  background: #ffffff;
  border-color: #424242;
}

.mapa-catastral-leyenda .swatch--bloqueado {
  background: #9e9e9e;
  border-color: #424242;
}

.mapa-catastral-popup {
  font-size: 0.9rem;
  line-height: 1.45;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding-right: 2px;
}

.leaflet-popup.mapa-catastral-popup-wrap .leaflet-popup-content {
  margin: 12px 14px;
  min-width: min(100%, 300px);
}

.mapa-catastral-popup__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
  color: var(--pbr-text, inherit);
}

.mapa-catastral-popup__meta {
  margin: 0;
  font-size: 0.85rem;
}

.mapa-catastral-popup__head {
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--pbr-border-light);
}

.mapa-catastral-popup__estado {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
}

.mapa-catastral-popup__section {
  margin-top: 0.65rem;
}

.mapa-catastral-popup__h4 {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pbr-text-muted);
}

.mapa-catastral-popup__dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 42%) 1fr;
  column-gap: 0.65rem;
  row-gap: 0.35rem;
  font-size: 0.85rem;
  align-items: start;
}

.mapa-catastral-popup__dl dt {
  margin: 0;
  color: var(--pbr-text-muted);
  font-weight: 500;
}

.mapa-catastral-popup__dl dd {
  margin: 0;
  word-break: break-word;
}

.mapa-catastral-popup__actions {
  margin: 0.65rem 0 0;
  padding-top: 0.45rem;
  border-top: 1px solid var(--pbr-border-light);
  font-size: 0.88rem;
}

/* ========== Vista adaptable: teléfono / tablet / laptop / escritorio / TV ==========
   Atributos en <html> (pbr-viewport.js):
   data-pbr-view: phone | tablet | laptop | desktop | large | tv
   data-pbr-class: mobile | computer | tv   ← agrupación simple
   data-pbr-device: phone | tablet | laptop | desktop | tv
   data-pbr-touch: yes | no  data-pbr-orientation: portrait | landscape */

html[data-pbr-reduced-motion="1"] .status-badge--online::after {
  animation: none;
}

/* —— Teléfono móvil —— */
html[data-pbr-view="phone"] {
  --pbr-layout-max: 100%;
  --pbr-grid-kpi-cols: 1fr;
  --pbr-grid-modulo-cols: 1fr;
  --pbr-sidebar-cols: 1fr;
}

html[data-pbr-view="phone"] .app-body {
  font-size: 16px;
}

html[data-pbr-view="phone"] .app-main {
  padding: 1rem 0 2.25rem;
}

html[data-pbr-view="phone"] .app-wrap {
  padding-left: max(0.65rem, env(safe-area-inset-left));
  padding-right: max(0.65rem, env(safe-area-inset-right));
}

html[data-pbr-view="phone"] .app-header .app-wrap.app-header__inner {
  min-height: auto;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

html[data-pbr-view="phone"] .app-header__right {
  width: 100%;
  margin-left: 0;
  flex-direction: column;
  align-items: stretch;
}

html[data-pbr-view="phone"] .app-user-chip {
  max-width: none;
}

html[data-pbr-view="phone"] .app-header__logout-btn {
  width: 100%;
  justify-content: center;
  min-height: var(--pbr-touch-min);
}

html[data-pbr-view="phone"] .app-nav {
  width: 100%;
}

html[data-pbr-view="phone"] .app-nav__link,
html[data-pbr-view="phone"] .app-nav a,
html[data-pbr-view="phone"] .app-nav .link-btn {
  flex: 1;
  justify-content: center;
  min-height: var(--pbr-touch-min);
}

html[data-pbr-view="phone"] .app-layout {
  gap: 1rem;
  padding: 1rem 0 2rem;
}

html[data-pbr-view="phone"] .app-sidebar {
  position: static;
}

html[data-pbr-view="phone"] .brand__img {
  max-height: 68px;
}

html[data-pbr-view="phone"] .page-title {
  font-size: 1.35rem;
}

html[data-pbr-view="phone"] .dash-grid-2 {
  grid-template-columns: 1fr;
}

html[data-pbr-view="phone"] .mapa-lotes-canvas,
html[data-pbr-view="phone"] .mapa-catastral-canvas {
  min-height: min(420px, 55vh);
}

/* —— Tablet —— */
html[data-pbr-view="tablet"] {
  --pbr-layout-max: min(1100px, 96vw);
  --pbr-grid-kpi-cols: repeat(2, minmax(0, 1fr));
  --pbr-grid-modulo-cols: repeat(2, minmax(0, 1fr));
  --pbr-sidebar-cols: 1fr;
}

html[data-pbr-view="tablet"] .app-layout {
  gap: 1.25rem;
}

html[data-pbr-view="tablet"] .app-sidebar {
  position: static;
}

html[data-pbr-view="tablet"] .mapa-toolbar {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* —— Laptop —— */
html[data-pbr-view="laptop"] {
  --pbr-layout-max: min(1280px, 94vw);
  --pbr-grid-kpi-cols: repeat(auto-fill, minmax(9.5rem, 1fr));
  --pbr-grid-modulo-cols: repeat(3, minmax(0, 1fr));
  --pbr-sidebar-cols: minmax(200px, 228px) 1fr;
}

html[data-pbr-view="laptop"] .app-layout {
  gap: 1.35rem;
  padding: 1.35rem 0 2.75rem;
}

html[data-pbr-view="laptop"] .app-header .app-wrap.app-header__inner {
  min-height: 76px;
}

/* —— Escritorio (monitor estándar) —— */
html[data-pbr-view="desktop"] {
  --pbr-layout-max: min(1440px, 92vw);
  --pbr-grid-kpi-cols: repeat(auto-fill, minmax(10.5rem, 1fr));
  --pbr-grid-modulo-cols: repeat(3, minmax(0, 1fr));
  --pbr-sidebar-cols: minmax(220px, 248px) 1fr;
}

/* —— Escritorio grande (Full HD+) —— */
html[data-pbr-view="large"] {
  --pbr-layout-max: min(1580px, 92vw);
  --pbr-grid-kpi-cols: repeat(auto-fill, minmax(11rem, 1fr));
  --pbr-grid-modulo-cols: repeat(4, minmax(0, 1fr));
  --pbr-sidebar-cols: minmax(236px, 272px) 1fr;
}

html[data-pbr-view="large"] .app-body {
  font-size: 16px;
}

html[data-pbr-view="large"] .page-title {
  font-size: 1.65rem;
}

html[data-pbr-view="large"] .app-layout {
  gap: 2rem;
  padding: 1.75rem 0 3.5rem;
}

html[data-pbr-view="large"] .kpi p {
  font-size: 1.65rem;
}

/* —— TV / pantalla muy grande —— */
html[data-pbr-view="tv"] {
  --pbr-layout-max: min(2200px, 88vw);
  --pbr-grid-kpi-cols: repeat(auto-fill, minmax(13rem, 1fr));
  --pbr-grid-modulo-cols: repeat(4, minmax(0, 1fr));
  --pbr-sidebar-cols: minmax(280px, 320px) 1fr;
  --pbr-touch-min: 48px;
}

html[data-pbr-view="tv"] .app-body {
  font-size: 18px;
}

html[data-pbr-view="tv"] .page-title {
  font-size: 1.85rem;
}

html[data-pbr-view="tv"] .page-lead,
html[data-pbr-view="tv"] .page-toolbar__meta {
  font-size: 1.05rem;
}

html[data-pbr-view="tv"] .brand__img {
  max-height: 96px;
  max-width: min(640px, 45vw);
}

html[data-pbr-view="tv"] .app-user-chip__name {
  font-size: 1rem;
}

html[data-pbr-view="tv"] .app-nav__link,
html[data-pbr-view="tv"] .app-nav a,
html[data-pbr-view="tv"] .app-nav .link-btn {
  font-size: 0.9375rem;
  padding: 10px 18px;
  min-height: var(--pbr-touch-min);
}

html[data-pbr-view="tv"] .app-layout {
  gap: 2.25rem;
  padding: 2rem 0 4rem;
}

html[data-pbr-view="tv"] .app-sidebar__nav a {
  font-size: 1rem;
  padding: 0.65rem 0.85rem;
  min-height: var(--pbr-touch-min);
}

html[data-pbr-view="tv"] .kpi p {
  font-size: 1.85rem;
}

html[data-pbr-view="tv"] .table {
  font-size: 0.95rem;
}

html[data-pbr-view="tv"] .btn-primary,
html[data-pbr-view="tv"] .btn-secondary {
  min-height: 46px;
  font-size: 1rem;
}

html[data-pbr-view="tv"] .mapa-lotes-canvas,
html[data-pbr-view="tv"] .mapa-catastral-canvas {
  min-height: min(720px, 62vh);
}

/* Pantalla táctil: áreas de toque ampliadas (móvil/tablet) */
html[data-pbr-touch="yes"] .app-nav__link,
html[data-pbr-touch="yes"] .app-nav a,
html[data-pbr-touch="yes"] .app-nav .link-btn,
html[data-pbr-touch="yes"] .app-nav__cta {
  min-height: var(--pbr-touch-min);
}

html[data-pbr-touch="yes"] .app-sidebar__nav a,
html[data-pbr-touch="yes"] .app-sidebar__nav-sub a,
html[data-pbr-touch="yes"] .app-sidebar__accord-panel a,
html[data-pbr-touch="yes"] .app-sidebar__quick,
html[data-pbr-touch="yes"] .app-sidebar__accord-summary {
  min-height: var(--pbr-touch-min);
  display: flex;
  align-items: center;
}

html[data-pbr-touch="yes"] .app-sidebar__session-btn {
  min-height: var(--pbr-touch-min);
}

html[data-pbr-touch="yes"] .btn-primary,
html[data-pbr-touch="yes"] .btn-secondary {
  min-height: var(--pbr-touch-min);
}

/* Teléfono en horizontal: sidebar sigue apilado */
html[data-pbr-view="phone"][data-pbr-orientation="landscape"] .app-nav__link,
html[data-pbr-view="phone"][data-pbr-orientation="landscape"] .app-nav a,
html[data-pbr-view="phone"][data-pbr-orientation="landscape"] .app-nav .link-btn {
  font-size: 0.72rem;
  padding: 6px 8px;
}

/* ========== Clases simples: mobile | computer | tv ==========
   data-pbr-class / .pbr-class-* (todo el sistema) */

html[data-pbr-class="mobile"] {
  --pbr-touch-min: 44px;
}

html[data-pbr-class="mobile"] .app-layout {
  grid-template-columns: 1fr;
}

html[data-pbr-class="mobile"] .app-sidebar {
  position: static;
  max-height: none;
}

html[data-pbr-class="mobile"] .table-wrap,
html[data-pbr-class="mobile"] .table-scroll,
html[data-pbr-class="mobile"] .data-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

html[data-pbr-class="mobile"] .form-stack,
html[data-pbr-class="mobile"] .form-grid {
  max-width: 100%;
}

html[data-pbr-class="mobile"] .pbr-form-grid--vendedor {
  grid-template-columns: 1fr;
}

html[data-pbr-class="mobile"] .dash-grid-2,
html[data-pbr-class="mobile"] .gestion-flujo {
  grid-template-columns: 1fr;
}

html[data-pbr-class="mobile"] .login-stage__layout,
html[data-pbr-class="mobile"] .portal-doors {
  grid-template-columns: 1fr;
}

html[data-pbr-class="mobile"] .login-stage {
  width: 100%;
}

html[data-pbr-class="mobile"] .login-panel:hover,
html[data-pbr-class="mobile"] .login-panel:focus-within {
  transform: none;
}

html[data-pbr-class="mobile"] .login-visual {
  min-height: 0;
}

html[data-pbr-class="mobile"] .portal-hero__hint {
  display: none;
}

html[data-pbr-class="mobile"] .portal-door {
  min-height: 0;
}

html[data-pbr-class="computer"] .app-layout {
  grid-template-columns: var(--pbr-sidebar-cols);
}

html[data-pbr-class="tv"] {
  --pbr-touch-min: 52px;
  --pbr-radius: 12px;
  --pbr-radius-lg: 16px;
}

html[data-pbr-class="tv"] .app-body {
  font-size: 18px;
  line-height: 1.5;
}

html[data-pbr-class="tv"] .app-layout {
  grid-template-columns: var(--pbr-sidebar-cols);
}

html[data-pbr-class="tv"] .login-stage__layout {
  grid-template-columns: minmax(0, 1.1fr) minmax(440px, 540px);
  gap: 2.5rem;
}

html[data-pbr-class="tv"] .login-panel__title {
  font-size: 2.2rem;
}

html[data-pbr-class="tv"] .login-input {
  min-height: 64px;
  font-size: 1.15rem !important;
}

html[data-pbr-class="tv"] .login-form__submit {
  min-height: 64px;
  font-size: 1.15rem !important;
}

html[data-pbr-class="tv"] .portal-hero__title {
  font-size: clamp(2rem, 3vw, 2.8rem);
}

html[data-pbr-class="tv"] .portal-door {
  min-height: 26rem;
  padding: 1.75rem 1.6rem;
}

html[data-pbr-class="tv"] .portal-door__cta {
  min-height: 3.25rem;
  font-size: 1.05rem;
}

html[data-pbr-class="tv"] .btn-primary,
html[data-pbr-class="tv"] .btn-secondary,
html[data-pbr-class="tv"] .field__control input,
html[data-pbr-class="tv"] .field__control select,
html[data-pbr-class="tv"] .field__control textarea {
  min-height: var(--pbr-touch-min);
  font-size: 1.05rem;
}

html[data-pbr-class="tv"] .table {
  font-size: 1.05rem;
}

html[data-pbr-class="tv"] .table th,
html[data-pbr-class="tv"] .table td {
  padding: 0.85rem 1rem;
}

/* Tablas: scroll horizontal en móvil */
html[data-pbr-class="mobile"] table.table {
  min-width: 640px;
}

html[data-pbr-view="phone"] .login-brands__title {
  font-size: 1.45rem;
}

html[data-pbr-view="phone"] .login-visual__stack {
  grid-template-columns: 1fr 1fr;
}

html[data-pbr-view="phone"] .page-toolbar {
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

html[data-pbr-view="phone"] .page-toolbar .btn-primary,
html[data-pbr-view="phone"] .page-toolbar .btn-secondary {
  width: 100%;
  justify-content: center;
}

/* Fallback @media si JS no cargó (mismos breakpoints) */
@media (max-width: 639px) {
  :root {
    --pbr-layout-max: min(100%, 100%);
  }

  .app-body {
    font-size: 16px;
  }

  .app-main {
    padding: 1rem 0 2.25rem;
  }

  .app-wrap {
    padding-left: max(0.65rem, env(safe-area-inset-left));
    padding-right: max(0.65rem, env(safe-area-inset-right));
  }

  .app-header .app-wrap.app-header__inner {
    min-height: auto;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
  }

  .app-header__right {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
    gap: 0.65rem;
  }

  .app-user-chip {
    flex: 1;
    min-width: 0;
    max-width: none;
  }

  .app-nav {
    width: 100%;
    justify-content: stretch;
  }

  .app-nav__link,
  .app-nav a,
  .app-nav .link-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.75rem;
  }

  .app-nav__icon {
    width: 0.9rem;
    height: 0.9rem;
  }

  .brand__img {
    max-height: 72px;
    max-width: min(520px, 94vw);
  }

  .app-body--login .brand__img {
    max-height: 80px;
    max-width: min(540px, 94vw);
  }

  .page-title {
    font-size: 1.35rem;
  }

  .grid-kpis {
    grid-template-columns: 1fr;
  }

  .grid-modulos {
    grid-template-columns: 1fr;
  }

  .mapa-toolbar {
    grid-template-columns: 1fr;
  }

  .mapa-lotes-canvas,
  .mapa-catastral-canvas {
    min-height: min(420px, 55vh);
  }
}

/* —— Tablet —— */
@media (min-width: 640px) and (max-width: 1023px) {
  :root {
    --pbr-layout-max: min(1100px, 94vw);
  }

  .grid-modulos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mapa-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mapa-lotes-canvas,
  .mapa-catastral-canvas {
    min-height: 480px;
  }
}

/* —— Pantallas grandes (Full HD y similares): más aire y lectura —— */
@media (min-width: 1920px) and (max-width: 2559px) {
  :root {
    --pbr-layout-max: min(1580px, 92vw);
  }

  .app-body {
    font-size: 16px;
  }

  .page-title {
    font-size: 1.65rem;
  }

  .page-lead,
  .page-toolbar__meta {
    font-size: 1rem;
  }

  .app-layout {
    grid-template-columns: minmax(236px, 272px) 1fr;
    gap: 2rem;
    padding: 1.75rem 0 3.5rem;
  }

  .app-sidebar__nav a {
    font-size: 0.9rem;
    padding: 0.52rem 0.72rem;
  }

  .table {
    font-size: 0.9rem;
  }

  .kpi p {
    font-size: 1.65rem;
  }

  .mapa-lotes-canvas,
  .mapa-catastral-canvas {
    min-height: 580px;
  }
}

/* —— TV / 4K: texto y controles más visibles a distancia —— */
@media (min-width: 2560px) {
  :root {
    --pbr-layout-max: min(2100px, 88vw);
    --pbr-radius: 12px;
    --pbr-radius-lg: 16px;
  }

  .app-body {
    font-size: 17px;
  }

  .page-title {
    font-size: 1.85rem;
  }

  .page-lead,
  .page-toolbar__meta {
    font-size: 1.05rem;
  }

  .app-layout {
    grid-template-columns: minmax(260px, 300px) 1fr;
    gap: 2.25rem;
    padding: 2rem 0 4rem;
  }

  .app-sidebar {
    padding: 1.25rem 1rem;
  }

  .app-sidebar__nav a {
    font-size: 1rem;
    padding: 0.6rem 0.8rem;
  }

  .btn-primary,
  .btn-secondary {
    min-height: 42px;
    padding: 0.6rem 1.1rem;
    font-size: 0.9375rem;
  }

  .btn-sm {
    min-height: 38px;
    font-size: 0.875rem;
  }

  .table {
    font-size: 0.95rem;
  }

  .table th,
  .table td {
    padding: 0.75rem 0.6rem;
  }

  .kpi p {
    font-size: 1.85rem;
  }

  .mapa-lotes-canvas,
  .mapa-catastral-canvas {
    min-height: min(720px, 62vh);
  }
}

/* Pantallas táctiles: áreas de toque más amplias */
@media (hover: none) and (pointer: coarse) {
  .app-nav a,
  .app-nav .link-btn {
    min-height: 44px;
    padding: 0.45rem 0.85rem;
    display: inline-flex;
    align-items: center;
  }

  .app-sidebar__nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .btn-primary,
  .btn-secondary {
    min-height: 44px;
  }
}

/* Refuerzo nav (legacy + data-pbr-view) */
html[data-pbr-view="phone"] .app-nav,
html[data-pbr-view="tablet"] .app-nav {
  flex-wrap: wrap;
  justify-content: stretch;
}

/* Barra de estado sin conexión / sincronización */
.pbr-offline-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10050;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  line-height: 1.45;
  text-align: center;
  color: #fffbeb;
  background: #b45309;
  border-bottom: 1px solid #92400e;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.pbr-offline-bar strong {
  font-weight: 700;
}

.pbr-offline-bar__count {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  font-weight: 700;
  font-size: 0.78rem;
}

.pbr-offline-bar--offline {
  background: linear-gradient(90deg, #b45309, #c2410c);
  color: #fffbeb;
}

.pbr-offline-bar--syncing {
  background: linear-gradient(90deg, #1d4ed8, #1e40af);
  color: #eff6ff;
  border-bottom-color: #1e3a8a;
}

.pbr-offline-bar--ok {
  background: linear-gradient(90deg, #15803d, #166534);
  color: #f0fdf4;
  border-bottom-color: #14532d;
}

.pbr-offline-bar[hidden] {
  display: none !important;
}

body.pbr-network-offline,
body.pbr-network-syncing,
body.pbr-network-ok-flash {
  padding-top: 3rem;
}

.pbr-offline-toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10060;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.pbr-offline-toast {
  padding: 0.75rem 0.95rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #0f172a;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  animation: pbrToastIn 0.28s ease both;
}

.pbr-offline-toast--warn {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.pbr-offline-toast--ok {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.pbr-offline-toast--info {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e40af;
}

.pbr-offline-toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

@keyframes pbrToastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .pbr-offline-toast-host {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    max-width: none;
  }
}

/* ——— Barra de progreso del sistema (carga) ——— */
body.pbr-loader-active {
  overflow: hidden;
}

.pbr-system-loader {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.pbr-system-loader--done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pbr-system-loader__backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #eef3fa 0%, #f8f6f3 45%, #e8edf5 100%);
}

.pbr-system-loader__card {
  position: relative;
  z-index: 1;
  width: min(420px, 92vw);
  padding: 1.75rem 1.5rem 1.35rem;
  border-radius: var(--pbr-radius-lg);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--pbr-border-light);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  text-align: center;
}

.pbr-system-loader__paredes {
  margin: 0 0 1.1rem;
  font-size: clamp(0.72rem, 2.8vw, 0.82rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.35;
  text-transform: uppercase;
}

.pbr-c-blue {
  color: #003366;
}

.pbr-c-cafe {
  color: #6b4423;
}

.pbr-c-orange {
  color: #e8620c;
}

.pbr-c-purple {
  color: #7b2d8e;
}

.pbr-c-amp {
  color: #334155;
  font-weight: 700;
  margin: 0 0.12em;
}

.pbr-system-loader__track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #e2e8f0, #f1f5f9);
  border: 1px solid var(--pbr-border-light);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.08);
}

.pbr-system-loader__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #003366 0%,
    #1a5276 28%,
    #6b4423 62%,
    #8b5a3c 100%
  );
  box-shadow: 0 0 12px rgba(0, 51, 102, 0.35);
  transition: width 0.14s linear;
}

.pbr-system-loader__proyecto {
  margin: 1.05rem 0 0;
  font-size: clamp(0.78rem, 3vw, 0.88rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.3em 0.45em;
  line-height: 1.4;
}

.pbr-system-loader__proyecto-intro {
  color: #475569;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.pbr-system-loader__proyecto-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28em;
  font-size: 1.15em;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.pbr-system-loader__proyecto-brand .pbr-c-orange {
  color: #e8620c;
}

.pbr-system-loader__proyecto-brand .pbr-c-purple {
  color: #7b2d8e;
}

.pbr-system-loader__proyecto-brand .pbr-c-amp {
  color: #334155;
  font-size: 0.95em;
}

.pbr-system-loader__pct {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

html[data-pbr-view="tv"] .pbr-system-loader__card {
  width: min(560px, 70vw);
  padding: 2.25rem 2rem 1.75rem;
}

html[data-pbr-view="tv"] .pbr-system-loader__paredes {
  font-size: 1rem;
}

html[data-pbr-view="tv"] .pbr-system-loader__track {
  height: 14px;
}

html[data-pbr-reduced-motion="1"] .pbr-system-loader__fill {
  transition: none;
}

/* ——— Dashboard ——— */
.dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
}

.dash-header__eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pbr-blue-mid);
}

.dash-header__title {
  margin-bottom: 0.25rem;
}

.dash-header__lead {
  margin: 0;
  max-width: 36rem;
}

.dash-meta {
  font-size: 0.8125rem;
  margin: 0.35rem 0 0;
  white-space: nowrap;
}

.dash-kpis {
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
}

.dash-kpi {
  position: relative;
  padding-top: 0.85rem;
}

.dash-kpi--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dash-kpi--link:hover {
  transform: translateY(-2px);
  box-shadow: var(--pbr-shadow-sm);
  border-color: var(--pbr-accent);
}

.dash-kpi__icon {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  font-size: 1.1rem;
  opacity: 0.55;
  line-height: 1;
}

.dash-kpi__hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--pbr-muted);
  font-weight: 400;
  line-height: 1.35;
}

.dash-kpi--ok {
  border-left-color: #15803d;
}

.dash-kpi--ok p {
  color: #15803d;
}

.dash-kpi--warn {
  border-left-color: #b45309;
}

.dash-kpi--warn p {
  color: #b45309;
}

.dash-kpi--sold {
  border-left-color: #1d4ed8;
}

.dash-kpi--sold p {
  color: #1d4ed8;
}

.dash-proyectos {
  margin-top: 0.25rem;
}

.dash-proy-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dash-proy {
  padding: 0.85rem 0 0;
  border-top: 1px solid color-mix(in srgb, var(--pbr-border, #d4d4d8) 80%, transparent);
}

.dash-proy:first-child {
  padding-top: 0;
  border-top: 0;
}

.dash-proy__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dash-proy__name {
  display: block;
  font-size: 1.05rem;
}

.dash-proy__loc {
  display: block;
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.dash-proy__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.dash-proy__stat {
  padding: 0.55rem 0.65rem;
  border-radius: 0.35rem;
  background: color-mix(in srgb, var(--pbr-surface, #f8fafc) 88%, #e2e8f0);
  border-left: 3px solid #94a3b8;
}

.dash-proy__stat--disp {
  border-left-color: #15803d;
}

.dash-proy__stat--res {
  border-left-color: #b45309;
}

.dash-proy__stat--pag {
  border-left-color: #1d4ed8;
}

.dash-proy__stat--tot {
  border-left-color: #475569;
}

.dash-proy__stat-n {
  display: block;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--pbr-text, #0f172a);
}

.dash-proy__stat--disp .dash-proy__stat-n {
  color: #15803d;
}

.dash-proy__stat--res .dash-proy__stat-n {
  color: #b45309;
}

.dash-proy__stat--pag .dash-proy__stat-n {
  color: #1d4ed8;
}

.dash-proy__stat-l {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
}

.dash-proy__stat-h {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.7rem;
  color: var(--pbr-muted, #64748b);
}

.dash-proy__bar {
  margin-top: 0.7rem;
  height: 0.45rem;
}

@media (max-width: 720px) {
  .dash-proy__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dash-modulos {
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
}

.dash-modulo {
  padding: 1rem 1.05rem;
}

.dash-modulo__icon {
  display: block;
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
  line-height: 1;
}

.dash-modulo:hover .dash-modulo__icon {
  transform: scale(1.05);
  transition: transform 0.15s ease;
}

.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.dash-panel__sub {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.8125rem;
}

.dash-bars {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-bars__row {
  display: grid;
  grid-template-columns: 7.5rem 1fr 4.5rem;
  gap: 0.5rem 0.75rem;
  align-items: center;
  margin-bottom: 0.55rem;
}

.dash-bars__track {
  height: 0.55rem;
  background: var(--pbr-surface-muted);
  border-radius: 999px;
  overflow: hidden;
}

.dash-bars__fill {
  height: 100%;
  border-radius: 999px;
  min-width: 2px;
  transition: width 0.6s ease;
}

.dash-bars__fill--disponible {
  background: linear-gradient(90deg, #22c55e, #15803d);
}

.dash-bars__fill--reservado {
  background: linear-gradient(90deg, #fbbf24, #b45309);
}

.dash-bars__fill--vendido {
  background: linear-gradient(90deg, #60a5fa, #1d4ed8);
}

.dash-bars__fill--bloqueado {
  background: linear-gradient(90deg, #94a3b8, #64748b);
}

.dash-bars__value {
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: right;
}

.dash-heat {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-heat__item {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--pbr-border-light);
}

.dash-heat__item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.dash-heat__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.45rem;
  font-size: 0.875rem;
}

.dash-heat__pct {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pbr-accent);
}

.dash-heat__stack {
  display: flex;
  height: 0.65rem;
  border-radius: 999px;
  overflow: hidden;
  background: var(--pbr-surface-muted);
}

.dash-heat__seg {
  display: block;
  height: 100%;
  min-width: 1px;
  transition: width 0.6s ease;
}

.dash-heat__seg--vendido {
  background: #1d4ed8;
}

.dash-heat__seg--reservado {
  background: #b45309;
}

.dash-heat__seg--disponible {
  background: #15803d;
}

.dash-heat__legend {
  margin-top: 0.35rem;
  font-size: 0.75rem;
}

.dash-heat__note {
  margin-top: 1rem;
  font-size: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}

.dash-heat__dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.25rem;
  vertical-align: middle;
}

.dash-heat__dot--vendido {
  background: #1d4ed8;
}

.dash-heat__dot--reservado {
  background: #b45309;
}

.dash-heat__dot--disponible {
  background: #15803d;
}

.dash-foot {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  line-height: 1.5;
}

.dash-table tbody tr:hover {
  background: var(--pbr-surface-muted);
}

@media (max-width: 900px) {
  .dash-grid-2 {
    grid-template-columns: 1fr;
  }

  .dash-bars__row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .dash-bars__value {
    text-align: left;
  }
}

/* ——— Gestión hub (/app/) ——— */
.gestion-header__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.gestion-kpis {
  margin-bottom: 1.25rem;
}

.gestion-section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pbr-muted);
  margin: 1.25rem 0 0.65rem;
}

.gestion-flujo {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  gap: 0.65rem;
}

.gestion-flujo__paso {
  margin: 0;
}

.gestion-flujo__card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-height: 5.5rem;
  padding: 0.85rem 0.9rem;
  text-decoration: none;
  color: inherit;
  background: var(--pbr-surface);
  border: 1px solid var(--pbr-border-light);
  border-radius: var(--pbr-radius-lg);
  box-shadow: var(--pbr-shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.gestion-flujo__card:hover {
  border-color: rgba(0, 51, 102, 0.28);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.gestion-flujo__num {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--pbr-accent), var(--pbr-blue-mid, #1e4976));
}

.gestion-flujo__body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.gestion-flujo__body strong {
  font-size: 0.9rem;
  color: var(--pbr-accent);
  line-height: 1.25;
}

.gestion-flujo__body small {
  font-size: 0.78rem;
  color: var(--pbr-muted);
  line-height: 1.35;
}

.gestion-flujo__hint {
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
}

/* —— Portal vendedor (solo flujo) —— */
.vend-home {
  max-width: 56rem;
  margin: 0 auto;
  padding-bottom: 2rem;
}

.vend-home__hero {
  margin-bottom: 1.35rem;
}

.vend-home__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pbr-muted, #64748b);
}

.vend-home__title {
  margin: 0 0 0.4rem;
}

.vend-home__empresa {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0 0.9rem;
  padding: 0.75rem 0.9rem;
  max-width: 28rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, #003366 18%, #e2e8f0);
  background: linear-gradient(135deg, #f8fbff 0%, #fff 70%);
}

.vend-home__empresa-logo {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #fff;
  padding: 0.2rem;
  border: 1px solid #e2e8f0;
}

.vend-home__empresa-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pbr-muted, #64748b);
}

.vend-home__empresa strong {
  display: block;
  font-size: 0.95rem;
  color: #003366;
  line-height: 1.25;
}

.vend-home__empresa-note {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--pbr-muted, #64748b);
}

.vend-home__lead {
  margin: 0;
  max-width: 38rem;
  line-height: 1.45;
}

.vend-home__start {
  margin-bottom: 1.25rem;
}

.vend-home__start-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.15rem;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(135deg, #f0f7ff 0%, #fff 55%);
  border: 1px solid color-mix(in srgb, #003366 22%, #e2e8f0);
  border-radius: var(--pbr-radius-lg, 10px);
  box-shadow: var(--pbr-shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.vend-home__start-card:hover {
  transform: translateY(-1px);
  border-color: #003366;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.vend-home__start-num {
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #003366;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
}

.vend-home__start-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.vend-home__start-body strong {
  font-size: 1.05rem;
}

.vend-home__start-body small {
  color: var(--pbr-muted, #64748b);
  font-size: 0.84rem;
  line-height: 1.4;
}

.vend-home__start-cta {
  flex: 0 0 auto;
  font-size: 0.85rem;
  font-weight: 700;
  color: #003366;
}

.vend-home__paths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 760px) {
  .vend-home__paths {
    grid-template-columns: 1fr;
  }

  .vend-home__start-cta {
    display: none;
  }
}

.vend-path {
  margin: 0;
  padding: 1rem 1.05rem 1.05rem;
  border-radius: var(--pbr-radius-lg, 10px);
  border: 1px solid var(--pbr-border-light, #e2e8f0);
  background: var(--pbr-surface, #fff);
}

.vend-path--contado {
  border-top: 3px solid #1d4ed8;
}

.vend-path--plazos {
  border-top: 3px solid #b45309;
}

.vend-path__head {
  margin-bottom: 0.75rem;
}

.vend-path__head h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.vend-path__head p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--pbr-muted, #64748b);
  line-height: 1.4;
}

.vend-path__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.vend-path__steps a {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.7rem;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--pbr-surface, #fff) 70%, #f1f5f9);
  transition: border-color 0.12s ease, background 0.12s ease;
}

.vend-path__steps a:hover {
  border-color: color-mix(in srgb, #003366 25%, #e2e8f0);
  background: #fff;
}

.vend-path__n {
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  background: #e2e8f0;
  color: #0f172a;
}

.vend-path--contado .vend-path__n {
  background: #dbeafe;
  color: #1e3a8a;
}

.vend-path--plazos .vend-path__n {
  background: #ffedd5;
  color: #9a3412;
}

.vend-path__steps strong {
  display: block;
  font-size: 0.9rem;
  line-height: 1.25;
}

.vend-path__steps small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--pbr-muted, #64748b);
  line-height: 1.35;
}

.vend-home__section-title {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pbr-muted, #64748b);
}

.vend-home__links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.55rem;
}

.vend-home__link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--pbr-border-light, #e2e8f0);
  border-radius: 8px;
  background: var(--pbr-surface, #fff);
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.vend-home__link:hover {
  border-color: color-mix(in srgb, #003366 28%, #e2e8f0);
  transform: translateY(-1px);
}

.vend-home__link strong {
  font-size: 0.88rem;
}

.vend-home__link small {
  font-size: 0.75rem;
  color: var(--pbr-muted, #64748b);
  line-height: 1.35;
}

.app-sidebar__hub--vendedor .vend-side__hint {
  margin: 0.85rem 0 0.35rem;
  padding: 0;
  background: transparent;
  border: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pbr-muted, #64748b);
}

.app-sidebar__hub--vendedor .vend-side__hint:first-of-type {
  margin-top: 0.45rem;
}

.gestion-section-note {
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.75rem;
}

.gestion-modulos {
  margin-bottom: 0.5rem;
}

.gestion-modulo {
  min-height: 7.5rem;
  display: flex;
  flex-direction: column;
}

.gestion-modulo__stat {
  display: inline-block;
  margin-top: auto;
  padding-top: 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--pbr-accent);
  letter-spacing: 0.02em;
}

.gestion-modulo--rent {
  border-left: 3px solid #0ea5e9;
  background: linear-gradient(135deg, var(--pbr-white) 0%, #f0f9ff 100%);
}

.gestion-modulo:hover .gestion-modulo__stat {
  text-decoration: underline;
}

.gestion-alertas {
  margin-bottom: 1rem;
}

.gestion-alerta {
  margin-bottom: 0.5rem;
}

.gestion-alerta--warn {
  border-left: 3px solid #b45309;
}

.gestion-mail {
  margin-top: 1.25rem;
}

@media (max-width: 900px) {
  .gestion-header__actions {
    align-items: flex-start;
  }
}

/* —— Catálogo público (solo lectura) —— */
.app-body--catalogo {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0, 51, 102, 0.08), transparent 55%),
    var(--pbr-bg);
}

.catalogo {
  padding-block: 1.5rem 3rem;
}

.catalogo-hero {
  margin-bottom: 2rem;
  max-width: 40rem;
}

.catalogo-hero__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pbr-blue-mid);
  font-weight: 600;
}

.catalogo-hero__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--pbr-accent);
  line-height: 1.2;
}

.catalogo-hero__lead {
  margin: 0;
  color: var(--pbr-muted);
  font-size: 1.05rem;
  line-height: 1.45;
}

.catalogo-hero__meta {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--pbr-muted-light);
}

.catalogo-proyecto {
  margin-bottom: 2.25rem;
}

.catalogo-proyecto__head {
  margin-bottom: 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--pbr-border-light);
}

.catalogo-proyecto__title {
  margin: 0;
  font-size: 1.25rem;
  color: var(--pbr-text);
}

.catalogo-proyecto__lugar {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: var(--pbr-muted);
}

.catalogo-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.catalogo-card {
  display: flex;
  flex-direction: column;
  background: var(--pbr-surface);
  border: 1px solid var(--pbr-border-light);
  border-radius: var(--pbr-radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--pbr-shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.catalogo-card:hover,
.catalogo-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--pbr-shadow);
  border-color: var(--pbr-border);
  outline: none;
}

.catalogo-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--pbr-surface-muted);
  overflow: hidden;
}

.catalogo-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.catalogo-card__empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--pbr-muted-light);
  font-size: 0.9rem;
}

.catalogo-card__badge {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  background: rgba(21, 36, 51, 0.78);
  color: #fff;
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
}

.catalogo-card__body {
  padding: 0.75rem 0.85rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.catalogo-card__tipo {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pbr-blue-mid);
  font-weight: 600;
}

.catalogo-card__codigo {
  font-size: 1.05rem;
  color: var(--pbr-text);
}

.catalogo-card__pol {
  font-size: 0.85rem;
  color: var(--pbr-muted);
}

.catalogo-foot {
  margin-top: 2rem;
  font-size: 0.9rem;
}

.catalogo-nav {
  margin-bottom: 1rem;
}

.catalogo-nav a {
  color: var(--pbr-accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.catalogo-nav a:hover {
  text-decoration: underline;
}

.catalogo-detalle-head {
  margin-bottom: 1.5rem;
}

.catalogo-detalle-head__proy {
  margin: 0 0 0.25rem;
  color: var(--pbr-blue-mid);
  font-weight: 600;
  font-size: 0.95rem;
}

.catalogo-detalle-head__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  color: var(--pbr-accent);
}

.catalogo-detalle-head__meta {
  margin: 0;
  color: var(--pbr-muted);
  font-size: 0.95rem;
}

.catalogo-galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}

.catalogo-galeria__item {
  margin: 0;
}

.catalogo-galeria__btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--pbr-border-light);
  border-radius: var(--pbr-radius);
  overflow: hidden;
  background: var(--pbr-surface-muted);
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
}

.catalogo-galeria__btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.catalogo-galeria__btn:hover img,
.catalogo-galeria__btn:focus-visible img {
  transform: scale(1.03);
}

.catalogo-galeria__cap {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--pbr-muted);
}

.catalogo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(10, 18, 28, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 3.5rem 4rem;
}

.catalogo-lightbox[hidden] {
  display: none;
}

.catalogo-lightbox__img {
  max-width: min(96vw, 1100px);
  max-height: min(82vh, 900px);
  object-fit: contain;
  border-radius: 4px;
}

.catalogo-lightbox__close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 2.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.catalogo-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  color: #fff;
  font-size: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
}

.catalogo-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.22);
}

.catalogo-lightbox__nav--prev {
  left: 0.75rem;
}

.catalogo-lightbox__nav--next {
  right: 0.75rem;
}

.catalogo-lightbox__cap {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  max-width: 90%;
  text-align: center;
}

.catalogo-empty {
  padding: 1.5rem;
}

.catalogo-share {
  margin: 0 0 1.75rem;
  padding: 1rem 1.1rem;
  background: var(--pbr-surface);
  border: 1px solid var(--pbr-border);
  border-radius: var(--pbr-radius-lg);
  box-shadow: var(--pbr-shadow-sm);
}

.catalogo-share__label {
  margin: 0 0 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--pbr-accent);
}

.catalogo-share__grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.25rem;
  align-items: start;
}

.catalogo-share__qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 10rem;
}

.catalogo-share__qr {
  width: 168px;
  height: 168px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--pbr-border);
  border-radius: 8px;
  padding: 0.35rem;
}

.catalogo-share--compact .catalogo-share__qr {
  width: 148px;
  height: 148px;
}

.catalogo-share__qr-cap {
  margin: 0;
  font-size: 0.8rem;
}

.catalogo-share__qr-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

.catalogo-share__qr-actions .catalogo-share__btn {
  width: 100%;
  justify-content: center;
  font-size: 0.82rem;
  padding: 0.4rem 0.55rem;
}

.catalogo-share__links {
  min-width: 0;
}

.catalogo-share__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}

.catalogo-share__url {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--pbr-border);
  border-radius: var(--pbr-radius);
  background: var(--pbr-bg-muted);
  color: var(--pbr-text);
  font-size: 0.9rem;
}

.catalogo-share__btn {
  flex: 0 0 auto;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  min-height: var(--pbr-touch-min);
}

.catalogo-share__hint {
  margin: 0.55rem 0 0;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .catalogo-lightbox {
    padding: 3.5rem 0.5rem 3rem;
  }

  .catalogo-lightbox__nav--prev {
    left: 0.25rem;
  }

  .catalogo-lightbox__nav--next {
    right: 0.25rem;
  }

  .catalogo-share__grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .catalogo-share__links {
    width: 100%;
  }

  .catalogo-share__btn {
    flex: 1 1 auto;
  }
}

/* —— Portal de marcas (elección de empresa) —— */
.app-body--portal {
  --portal-font: "Outfit", var(--pbr-font);
  --portal-display: "Fraunces", Georgia, "Times New Roman", serif;
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 65% 48% at 12% -4%, rgba(0, 51, 102, 0.16), transparent 58%),
    radial-gradient(ellipse 50% 42% at 92% 4%, rgba(184, 148, 74, 0.14), transparent 55%),
    linear-gradient(165deg, #d5e0ef 0%, #e8edf5 38%, #eef3f9 100%);
  font-family: var(--portal-font);
}

.app-body--portal .app-header {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  border-bottom-color: rgba(200, 212, 227, 0.55);
}

.portal-stage {
  position: relative;
  z-index: 1;
  padding: clamp(1.25rem, 3.5vw, 2.5rem) 1rem 3.5rem;
  overflow: clip;
}

.portal-stage__atmosphere {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
}

.portal-stage__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(4px);
  opacity: 0.7;
  animation: portal-orb-drift 16s ease-in-out infinite alternate;
}

.portal-stage__orb--blue {
  width: min(42vw, 320px);
  height: min(42vw, 320px);
  left: -4%;
  top: 4%;
  background: radial-gradient(circle, rgba(61, 110, 163, 0.38), transparent 68%);
}

.portal-stage__orb--gold {
  width: min(48vw, 360px);
  height: min(48vw, 360px);
  right: -6%;
  top: -2%;
  background: radial-gradient(circle, rgba(184, 148, 74, 0.3), transparent 68%);
  animation-delay: -5s;
}

.portal-stage__mesh {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(0, 51, 102, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 51, 102, 0.055) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 75% 55% at 50% 18%, #000 10%, transparent 72%);
}

@keyframes portal-orb-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(22px, 28px, 0) scale(1.1); }
}

.portal-stage__inner {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin-inline: auto;
}

.portal-hero {
  text-align: center;
  margin: 0 auto 2rem;
  max-width: 40rem;
  animation: portal-hero-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.portal-hero__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin: 0 0 1rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pbr-accent);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 51, 102, 0.1);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 8px 24px rgba(13, 27, 42, 0.06);
}

.portal-hero__pulse {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #2f9e6b;
  box-shadow: 0 0 0 0 rgba(47, 158, 107, 0.45);
  animation: portal-pulse 1.8s ease-out infinite;
}

.portal-hero__sep {
  opacity: 0.35;
}

.portal-hero__user {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--pbr-muted);
}

.portal-hero__kicker {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pbr-blue-mid);
}

.portal-hero__title {
  margin: 0 0 0.85rem;
  font-family: var(--portal-display);
  font-size: clamp(1.35rem, 3.4vw, 2.35rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--pbr-accent);
  white-space: nowrap;
}

.portal-hero__accent {
  background: linear-gradient(105deg, #003366 10%, #3d6ea3 45%, #8a6b2c 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (max-width: 640px) {
  .portal-hero__title {
    white-space: normal;
    font-size: clamp(1.25rem, 5.5vw, 1.6rem);
  }
}

.portal-hero__lead {
  margin: 0 auto 1.1rem;
  max-width: 32rem;
  color: var(--pbr-muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.portal-hero__hint {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--pbr-muted-light);
}

.portal-hero__hint kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 0.3rem;
  border-radius: 6px;
  border: 1px solid var(--pbr-border);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 0 rgba(13, 27, 42, 0.06);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--pbr-accent);
}

@keyframes portal-pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 158, 107, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(47, 158, 107, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 158, 107, 0); }
}

@keyframes portal-hero-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.portal-doors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem;
}

.portal-door {
  --portal-mx: 50%;
  --portal-my: 38%;
  --portal-line: #003366;
  --portal-soft: rgba(0, 51, 102, 0.1);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  min-height: 22rem;
  padding: 1.45rem 1.35rem 1.35rem;
  border-radius: 22px;
  border: 1px solid rgba(200, 212, 227, 0.95);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 251, 255, 0.92) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 16px 40px rgba(13, 27, 42, 0.08);
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease,
    filter 0.35s ease,
    opacity 0.35s ease;
  animation: portal-door-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--portal-delay, 0) * 110ms + 140ms);
}

.portal-door--bienes-raices {
  --portal-line: #003366;
  --portal-soft: rgba(0, 51, 102, 0.12);
}

.portal-door--desarrollos {
  --portal-line: #9a7a32;
  --portal-soft: rgba(184, 148, 74, 0.16);
}

.portal-door__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    480px circle at var(--portal-mx) var(--portal-my),
    var(--portal-soft),
    transparent 58%
  );
  transition: opacity 0.25s ease;
}

.portal-door__index {
  position: absolute;
  top: 1.1rem;
  right: 1.2rem;
  font-family: var(--portal-display);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: color-mix(in srgb, var(--portal-line) 22%, transparent);
  line-height: 1;
  transition: color 0.25s ease, transform 0.35s ease;
}

.portal-door__badge {
  align-self: flex-start;
  margin: 0 0 1.1rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--portal-line);
  background: color-mix(in srgb, var(--portal-soft) 80%, white);
  border: 1px solid color-mix(in srgb, var(--portal-line) 16%, transparent);
}

.portal-door__logo-frame {
  display: grid;
  place-items: center;
  min-height: 7rem;
  margin-bottom: 1.15rem;
  padding: 1rem 0.85rem;
  border-radius: 16px;
  background:
    linear-gradient(180deg, #f8fbff 0%, #eef3f9 100%);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.portal-door__logo {
  max-width: min(100%, 260px);
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.portal-door__copy {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  flex: 1;
}

.portal-door__name {
  font-family: var(--portal-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--pbr-text);
}

.portal-door__sub {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--pbr-muted);
}

.portal-door__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  align-self: stretch;
  min-height: 2.75rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  background: var(--pbr-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 10px 22px rgba(0, 51, 102, 0.24);
  transition: background 0.2s ease, gap 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.portal-door__cta svg {
  width: 1.05rem;
  height: 1.05rem;
  transition: transform 0.25s ease;
}

.portal-door--desarrollos .portal-door__cta {
  background: linear-gradient(120deg, #003366 0%, #1f446e 58%, #8a6b2c 145%);
}

.portal-door.is-hot,
.portal-door:hover,
.portal-door:focus-visible {
  transform: translateY(-10px) scale(1.015);
  border-color: color-mix(in srgb, var(--portal-line) 45%, var(--pbr-border));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 28px 56px rgba(13, 27, 42, 0.16);
  outline: none;
  z-index: 2;
}

.portal-door.is-hot .portal-door__glow,
.portal-door:hover .portal-door__glow,
.portal-door:focus-visible .portal-door__glow {
  opacity: 1;
}

.portal-door.is-hot .portal-door__index,
.portal-door:hover .portal-door__index,
.portal-door:focus-visible .portal-door__index {
  color: color-mix(in srgb, var(--portal-line) 48%, transparent);
  transform: translateY(-2px);
}

.portal-door.is-hot .portal-door__logo-frame,
.portal-door:hover .portal-door__logo-frame,
.portal-door:focus-visible .portal-door__logo-frame {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(13, 27, 42, 0.1);
}

.portal-door.is-hot .portal-door__logo,
.portal-door:hover .portal-door__logo,
.portal-door:focus-visible .portal-door__logo {
  transform: scale(1.05);
}

.portal-door.is-hot .portal-door__cta,
.portal-door:hover .portal-door__cta,
.portal-door:focus-visible .portal-door__cta {
  gap: 0.75rem;
  box-shadow: 0 14px 28px rgba(0, 51, 102, 0.3);
}

.portal-door.is-hot .portal-door__cta svg,
.portal-door:hover .portal-door__cta svg,
.portal-door:focus-visible .portal-door__cta svg {
  transform: translateX(4px);
}

.portal-stage.is-choosing .portal-door.is-dim {
  opacity: 0.55;
  filter: saturate(0.75);
  transform: scale(0.985);
}

.portal-door.is-pressing {
  transform: translateY(-3px) scale(0.995) !important;
  transition-duration: 0.1s;
}

@keyframes portal-door-in {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.portal-back {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.92rem;
}

.portal-back a {
  color: var(--pbr-accent);
  font-weight: 600;
  text-decoration: none;
}

.portal-back a:hover {
  text-decoration: underline;
}

@media (max-width: 760px) {
  .portal-doors {
    grid-template-columns: 1fr;
  }

  .portal-door {
    min-height: 0;
  }

  .portal-hero__hint {
    display: none;
  }

  .portal-stage__orb {
    opacity: 0.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-hero,
  .portal-door,
  .portal-stage__orb,
  .portal-hero__pulse {
    animation: none !important;
  }

  .portal-door,
  .portal-door__logo,
  .portal-door__logo-frame,
  .portal-door__cta,
  .portal-door__cta svg,
  .portal-door__index {
    transition: none !important;
  }

  .portal-door.is-hot,
  .portal-door:hover,
  .portal-door:focus-visible,
  .portal-stage.is-choosing .portal-door.is-dim {
    transform: none;
    filter: none;
    opacity: 1;
  }
}




