:root {
  color-scheme: dark;

  --portal-bg: #07080f;
  --portal-surface: rgba(255, 255, 255, 0.04);
  --portal-surface-hover: rgba(255, 255, 255, 0.07);
  --portal-border: rgba(255, 255, 255, 0.1);
  --portal-border-focus: rgba(77, 159, 255, 0.45);

  --portal-text: #ffffff;
  --portal-muted: rgba(255, 255, 255, 0.55);
  --portal-subtle: rgba(255, 255, 255, 0.35);

  --portal-blue: #4d9fff;
  --portal-blue-deep: #3b82f6;
  --portal-blue-dark: #2563eb;
  --portal-accent: #00d4aa;

  --portal-error: #f87171;
  --portal-error-bg: rgba(248, 113, 113, 0.1);
  --portal-success: #4ade80;

  --portal-radius: 16px;
  --portal-radius-sm: 10px;
  --portal-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  --portal-font: "Inter", system-ui, -apple-system, sans-serif;
  --portal-gutter: 1.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--portal-font);
  background: var(--portal-bg);
  color: var(--portal-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Fondo ── */
.portal-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--portal-bg);
}

.portal-bg__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
}

.portal-bg__glow--left {
  width: 500px;
  height: 500px;
  top: 10%;
  left: 5%;
  background: radial-gradient(circle, rgba(77, 159, 255, 0.2) 0%, transparent 70%);
}

.portal-bg__glow--right {
  width: 400px;
  height: 400px;
  bottom: 10%;
  right: 8%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
}

.portal-bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, black 10%, transparent 80%);
}

/* Legacy orbs — solo dashboard */
.portal-dashboard .portal-bg__orb {
  display: block;
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}

.portal-dashboard .portal-bg__orb--1 {
  width: 480px;
  height: 480px;
  top: -100px;
  left: -80px;
  background: radial-gradient(circle, rgba(77, 159, 255, 0.3) 0%, transparent 70%);
}

.portal-dashboard .portal-bg__orb--2 {
  width: 360px;
  height: 360px;
  bottom: -80px;
  right: -60px;
  background: radial-gradient(circle, rgba(0, 212, 170, 0.15) 0%, transparent 70%);
}

.portal-bg__orb,
.portal-bg__mesh,
.portal-bg__vignette {
  display: none;
}

/* ── Login: card dividida (estilo Sellora / Dotwork) ── */
.login-page {
  min-height: 100vh;
  background: #0c0e14;
}

.login-lang-bar {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 60;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1.25rem;
  gap: 1rem;
}

.auth-card {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 1140px;
  min-height: auto;
  border-radius: 24px;
  overflow: hidden;
  background: #111318;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 32px 80px rgba(0, 0, 0, 0.5);
}

@media (min-width: 768px) {
  .auth-card {
    grid-template-columns: 1fr 1fr;
    min-height: min(82vh, 760px);
    max-width: min(1140px, 94vw);
  }
}

@media (min-width: 1200px) {
  .auth-card {
    min-height: min(80vh, 800px);
  }
}

/* Lado formulario */
.auth-card__form {
  display: flex;
  flex-direction: column;
  padding: clamp(2rem, 4vw, 3.5rem) clamp(1.75rem, 4vw, 3.25rem) clamp(1.5rem, 3vw, 2rem);
  background: #111318;
}

@media (max-width: 767px) {
  .auth-card__form {
    padding: 2rem 1.5rem 1.5rem;
  }
}

.auth-form__head {
  margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
}

.auth-form__logo {
  width: clamp(220px, 28vw, 300px);
  height: auto;
  max-width: 100%;
}

.auth-form__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-form__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
}

.auth-form__subtitle {
  margin: 0 0 clamp(1.5rem, 3vw, 2.25rem);
  font-size: clamp(0.875rem, 1.2vw, 1rem);
  line-height: 1.55;
  color: var(--portal-muted);
  max-width: 400px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 1.35rem);
  max-width: 420px;
}

.auth-form__help {
  margin: 1.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--portal-subtle);
}

.auth-form__help a {
  color: var(--portal-blue);
  text-decoration: none;
  font-weight: 600;
}

.auth-form__help a:hover {
  text-decoration: underline;
}

.auth-form__foot {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.6875rem;
  color: var(--portal-subtle);
  text-align: center;
}

/* Lado hero (azul Automate) */
.auth-card__hero {
  position: relative;
  overflow: hidden;
  padding: 1.75rem 1.5rem;
  background: linear-gradient(145deg, #2563eb 0%, #3b82f6 40%, #4d9fff 100%);
  order: -1;
}

@media (min-width: 768px) {
  .auth-card__hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2rem, 4vw, 3.5rem);
    order: 0;
  }
}

.auth-hero__decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-hero__arcs {
  position: absolute;
  top: -20px;
  right: -40px;
  width: 100%;
  height: 100%;
  opacity: 0.9;
}

.auth-hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.auth-hero__label {
  margin: 0 0 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.auth-hero__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.375rem, 2.2vw, 1.875rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #fff;
}

.auth-hero__text {
  margin: 0;
  font-size: clamp(0.875rem, 1.1vw, 1rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  max-width: 340px;
}

@media (min-width: 768px) {
  .auth-hero__text {
    margin: 0 0 2rem;
  }
}

.auth-hero__preview {
  margin-top: auto;
  display: none;
}

@media (min-width: 768px) {
  .auth-hero__preview {
    display: block;
  }
}

.auth-preview {
  padding: clamp(1rem, 2vw, 1.35rem);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

.auth-preview__modules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.auth-preview__module {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-preview__module--vip {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
}

.auth-preview__module-icon {
  flex-shrink: 0;
  align-self: flex-start;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-top: 0.0625rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.auth-preview__module--vip .auth-preview__module-icon {
  background: rgba(255, 255, 255, 0.22);
  color: #fef08a;
}

.auth-preview__module-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.auth-preview__module-text strong {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.auth-preview__module-text span {
  font-size: 0.625rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.45;
}

/* Legacy preview stats (eliminado del HTML) */
.auth-preview__bar,
.auth-preview__stats,
.auth-preview__chart,
.auth-preview__rows {
  display: none;
}

.login-shell .login__demo {
  margin: 0;
}

/* Campos y botón login */
.login-alert {
  display: none;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  color: #fca5a5;
  background: var(--portal-error-bg);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.login-alert.is-visible {
  display: block;
}

.login-field label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.login-field__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.login-field__row label {
  margin-bottom: 0;
}

.login-field__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  padding: 0.15rem 0;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #60a5fa;
  cursor: pointer;
  transition: color 0.2s;
}

.login-field__toggle:hover {
  color: #93c5fd;
}

.login-field__toggle:focus-visible {
  outline: none;
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.35);
}

.login-field__toggle-icon {
  flex-shrink: 0;
  opacity: 0.95;
}

.login-field__toggle[aria-pressed="true"] .login-field__toggle-icon--show {
  display: none;
}

.login-field__toggle[aria-pressed="true"] .login-field__toggle-icon--hide {
  display: block;
}

.login-field__toggle[aria-pressed="false"] .login-field__toggle-icon--hide {
  display: none;
}

.login-field input {
  width: 100%;
  padding: clamp(0.8rem, 1.5vw, 0.95rem) 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  color: var(--portal-text);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-field input::placeholder {
  color: var(--portal-subtle);
}

.login-field input:focus {
  outline: none;
  border-color: rgba(77, 159, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(77, 159, 255, 0.12);
}

.login-field.is-error input {
  border-color: rgba(248, 113, 113, 0.45);
}

.login-field__error {
  display: none;
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--portal-error);
}

.login-field.is-error .login-field__error {
  display: block;
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 420px;
  margin-top: 0.35rem;
  padding: clamp(0.875rem, 1.5vw, 1rem) 1.25rem;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: var(--portal-blue-deep);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}

.login-btn:hover:not(:disabled) {
  background: var(--portal-blue);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(77, 159, 255, 0.4);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-btn__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: portal-spin 0.7s linear infinite;
}

.login-btn.is-loading .login-btn__spinner {
  display: block;
}

.login-btn.is-loading .login-btn__text {
  display: none;
}

.login__demo {
  font-size: 0.75rem;
  color: var(--portal-subtle);
  text-align: center;
}

.login__demo code {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.6875rem;
  color: var(--portal-muted);
}

/* Legacy */
.login-bg,
.login,
.login__brand,
.login__panel,
.login__footer,
.login__help {
  display: none;
}

/* Campos (base / dashboard) */
.portal-field {
  margin-bottom: 1.25rem;
}

.portal-field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.portal-field label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--portal-muted);
}

.portal-field__toggle {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--portal-subtle);
  cursor: pointer;
  transition: color 0.2s;
}

.portal-field__toggle:hover {
  color: var(--portal-blue);
}

.portal-input-wrap {
  position: relative;
}

.portal-input-wrap__icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--portal-subtle);
  pointer-events: none;
  display: flex;
}

.portal-input-wrap__icon svg {
  width: 18px;
  height: 18px;
}

.portal-field input {
  width: 100%;
  padding: 0.8rem 0.9rem 0.8rem 2.65rem;
  border-radius: var(--portal-radius-sm);
  border: 0.5px solid var(--portal-border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--portal-text);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.portal-field input::placeholder {
  color: var(--portal-subtle);
}

.portal-field input:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.38);
}

.portal-field input:focus {
  outline: none;
  border-color: var(--portal-border-focus);
  box-shadow: 0 0 0 4px rgba(77, 159, 255, 0.15);
  background: rgba(0, 0, 0, 0.42);
}

.portal-field.is-error input {
  border-color: rgba(248, 113, 113, 0.5);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.1);
}

.portal-field__error {
  display: none;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--portal-error);
}

.portal-field.is-error .portal-field__error {
  display: block;
}

/* Alerta global */
.portal-alert {
  display: none;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: var(--portal-radius-sm);
  background: var(--portal-error-bg);
  border: 0.5px solid rgba(248, 113, 113, 0.3);
  margin-bottom: 1.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #fca5a5;
  line-height: 1.45;
}

.portal-alert.is-visible {
  display: flex;
}

.portal-alert__icon {
  flex-shrink: 0;
  margin-top: 1px;
}

/* Botón principal */
.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  border: none;
  border-radius: var(--portal-radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.portal-btn--primary {
  background: linear-gradient(180deg, var(--portal-blue-deep) 0%, var(--portal-blue-dark) 100%);
  color: #fff;
  box-shadow:
    0 4px 20px rgba(59, 130, 246, 0.35),
    inset 0 0 0 1px rgba(77, 159, 255, 0.25);
}

.portal-btn--primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(59, 130, 246, 0.45);
}

.portal-btn--primary:active:not(:disabled) {
  transform: translateY(0);
}

.portal-btn--primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(77, 159, 255, 0.3);
}

.portal-btn--primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.portal-btn__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: portal-spin 0.7s linear infinite;
}

.portal-btn.is-loading .portal-btn__spinner {
  display: block;
}

.portal-btn.is-loading .portal-btn__text {
  display: none;
}

@keyframes portal-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Footer del card */
.portal-card__footer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 0.5px solid var(--portal-border);
  text-align: center;
}

.portal-card__footer p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--portal-subtle);
  line-height: 1.5;
}

.portal-card__footer a {
  color: var(--portal-blue);
  text-decoration: none;
  font-weight: 600;
}

.portal-card__footer a:hover {
  text-decoration: underline;
}

/* Credenciales demo */
.portal-demo-hint {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--portal-radius-sm);
  background: rgba(77, 159, 255, 0.06);
  border: 0.5px dashed rgba(77, 159, 255, 0.25);
}

.portal-demo-hint__label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--portal-blue);
  margin-bottom: 0.4rem;
}

.portal-demo-hint__creds {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--portal-muted);
  line-height: 1.6;
  font-family: ui-monospace, "SF Mono", monospace;
}

.portal-demo-hint__creds strong {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

/* Footer página */
.portal-page-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--portal-subtle);
}

.portal-page-footer a {
  color: var(--portal-muted);
  text-decoration: none;
}

.portal-page-footer a:hover {
  color: var(--portal-blue);
}

/* ── Dashboard (post-login) ── */
.portal-dashboard {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--portal-gutter);
  border-bottom: 0.5px solid var(--portal-border);
  background: rgba(7, 8, 15, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.portal-header__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.portal-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

.portal-lang-switcher {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  border: 0.5px solid var(--portal-border);
  background: rgba(255, 255, 255, 0.03);
}

.portal-lang-switcher__btn {
  min-width: 2rem;
  padding: 0.3rem 0.55rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--portal-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.portal-lang-switcher__btn:hover {
  color: #fff;
}

.portal-lang-switcher__btn.is-active {
  background: rgba(96, 165, 250, 0.16);
  color: #93c5fd;
}

.portal-header__referral {
  display: none;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  padding: 0.4rem 0.75rem;
  border: none;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.08);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: #60a5fa;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

@media (min-width: 1025px) {
  .portal-header__referral {
    display: inline-flex;
  }
}

.portal-header__referral svg {
  flex-shrink: 0;
}

.portal-header__referral:hover {
  background: rgba(96, 165, 250, 0.14);
  color: #93c5fd;
  text-decoration: none;
}

.portal-header__brand img {
  height: 54px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

.portal-header__brand-text {
  display: flex;
  align-items: center;
  min-width: 0;
}

.portal-header__brand-name {
  font-size: 0.9375rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.portal-header__brand-sub {
  display: none;
}

.portal-btn--ghost {
  width: auto;
  padding: 0.55rem 1rem;
  background: transparent;
  border: 0.5px solid var(--portal-border);
  color: var(--portal-muted);
  font-size: 0.8125rem;
  box-shadow: none;
}

.portal-btn--ghost:hover:not(:disabled) {
  background: var(--portal-surface-hover);
  color: #fff;
  transform: none;
  filter: none;
}

/* ── Dashboard layout ── */
.dashboard-page {
  background: var(--portal-bg);
}

.portal-app {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  min-height: calc(100vh - 65px);
}

@media (min-width: 1025px) {
  body.dashboard-page {
    height: 100vh;
    overflow: hidden;
  }

  .portal-dashboard {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  .portal-header {
    flex-shrink: 0;
  }

  .portal-app {
    grid-template-columns: 268px minmax(0, 1fr);
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
}

.portal-sidebar {
  padding: 1.25rem var(--portal-gutter);
  border-bottom: 1px solid var(--portal-border);
  background: rgba(7, 8, 15, 0.6);
}

.portal-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.portal-sidebar__head .portal-sidebar__label {
  margin-bottom: 0;
}

/* ── Menú hamburguesa + drawer (móvil/tablet) ── */
.portal-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--portal-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.portal-menu-toggle:hover {
  background: var(--portal-surface-hover);
}

.portal-menu-toggle:focus-visible {
  outline: 2px solid rgba(77, 159, 255, 0.45);
  outline-offset: 2px;
}

.portal-drawer-overlay {
  display: none;
}

.portal-drawer__close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--portal-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.portal-drawer__close:hover {
  background: var(--portal-surface-hover);
  color: #fff;
}

.portal-sidebar__referral {
  display: none;
}

@media (max-width: 1024px) {
  .portal-menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .portal-drawer-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 180;
    background: rgba(0, 0, 0, 0.58);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  .portal-drawer-overlay.is-visible {
    opacity: 1;
    visibility: visible;
  }

  .portal-drawer__close {
    display: inline-flex;
  }

  .portal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 190;
    width: min(300px, 88vw);
    max-width: 100%;
    margin: 0;
    padding: 1.25rem 1.25rem 1.5rem;
    border-bottom: none;
    border-right: 1px solid var(--portal-border);
    background: #0a0b12;
    overflow-x: hidden;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .portal-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 16px 0 48px rgba(0, 0, 0, 0.45);
  }

  .portal-sidebar__support {
    display: block;
  }

  .portal-nav__item {
    width: 100%;
  }

  .portal-sidebar__referral {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: rgba(96, 165, 250, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.18);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #60a5fa;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
  }

  .portal-sidebar__referral:hover {
    background: rgba(96, 165, 250, 0.14);
    color: #93c5fd;
    text-decoration: none;
  }

  .portal-sidebar__referral svg {
    flex-shrink: 0;
  }

  .portal-content {
    padding: 1.25rem 1rem 3rem;
  }

  body.portal-drawer-open {
    overflow: hidden;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .portal-content {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1025px) {
  .portal-sidebar__head {
    display: none;
  }

  .portal-drawer__close {
    display: none;
  }
}

@media (min-width: 1025px) {
  .portal-sidebar {
    padding: 2rem var(--portal-gutter);
    border-bottom: none;
    border-right: 1px solid var(--portal-border);
    background: transparent;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }
}

.portal-sidebar__bottom {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-width: 0;
}

@media (min-width: 1025px) {
  .portal-sidebar__bottom {
    margin-top: auto;
    width: 100%;
  }
}

.portal-sidebar__label {
  margin: 0 0 0.75rem;
  padding: 0;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--portal-subtle);
}

.portal-sidebar__label--drawer {
  margin-bottom: 0;
}

.portal-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.portal-nav__group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.portal-nav__group + .portal-nav__group {
  margin-top: 1.25rem;
}

.portal-nav__group--soon {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--portal-border);
}

.portal-nav__soon {
  margin-left: auto;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--portal-subtle);
}

@media (min-width: 1025px) {
  .portal-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.35rem;
    margin-right: -0.35rem;
  }
}

@media (max-width: 1024px) {
  .portal-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 0.25rem;
  }
}

.portal-nav__item {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  width: auto;
  padding: 0.7rem 0.9rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--portal-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-align: left;
}

@media (min-width: 1025px) {
  .portal-nav__item {
    width: 100%;
  }
}

.portal-nav__item:hover:not(.is-active):not(:disabled) {
  background: var(--portal-surface-hover);
  color: #fff;
}

.portal-nav__item:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.portal-nav__item.is-active,
.portal-nav__item[aria-current="page"] {
  background: rgba(77, 159, 255, 0.12);
  color: var(--portal-blue);
  box-shadow: inset 0 0 0 1px rgba(77, 159, 255, 0.2);
}

.portal-nav__item--vip.is-active,
.portal-nav__item--vip[aria-current="page"] {
  background: rgba(255, 214, 102, 0.08);
  color: #fde68a;
  box-shadow: inset 0 0 0 1px rgba(253, 224, 138, 0.15);
}

.portal-nav__item:focus {
  outline: none;
}

.portal-nav__item:focus:not(.is-active):not([aria-current="page"]) {
  background: transparent;
  color: var(--portal-muted);
  box-shadow: none;
}

.portal-nav__item:focus-visible {
  outline: 2px solid rgba(77, 159, 255, 0.45);
  outline-offset: 2px;
}

.portal-sidebar__support {
  display: none;
  margin-top: 0;
  padding: 1rem;
  border-radius: 12px;
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  min-width: 0;
}

@media (min-width: 1025px) {
  .portal-sidebar__support {
    display: block;
  }
}

.portal-sidebar__support-title {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.portal-sidebar__support-text {
  margin: 0 0 0.85rem;
  font-size: 0.75rem;
  color: var(--portal-muted);
  line-height: 1.5;
}

.portal-sidebar__support-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--portal-border);
  background: rgba(255, 255, 255, 0.03);
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--portal-muted);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.portal-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--portal-border);
  background: rgba(255, 255, 255, 0.03);
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--portal-muted);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.portal-sidebar__support-btn:hover,
.portal-btn-secondary:hover {
  background: var(--portal-surface-hover);
  color: #fff;
  text-decoration: none;
}

.portal-sidebar__profile {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  min-width: 0;
}

@media (max-width: 1024px) {
  .portal-sidebar__bottom {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--portal-border);
  }
}

.portal-profile {
  width: 100%;
  padding: 1.15rem;
  border-radius: 12px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.portal-profile__top {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.portal-profile__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: linear-gradient(145deg, #2563eb 0%, #3b82f6 100%);
  font-size: 1.0625rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.portal-profile__info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.portal-profile__name {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
}

.portal-profile__plan {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--portal-muted);
  line-height: 1.45;
}

.profile-footer-row,
.portal-profile__footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  width: 100%;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.portal-profile__thanks {
  margin: 0;
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--portal-subtle);
  line-height: 1.4;
}

.logout-action,
.portal-profile__logout {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #f87171;
  cursor: pointer;
  white-space: nowrap;
}

.portal-profile__logout svg {
  display: block;
  flex-shrink: 0;
}

.portal-profile__logout span {
  flex-shrink: 0;
}

.portal-profile__logout:hover {
  color: #fca5a5;
}

.portal-profile__logout:focus {
  outline: none;
}

.portal-profile__logout:focus-visible {
  outline: 2px solid rgba(248, 113, 113, 0.45);
  outline-offset: 2px;
  border-radius: 4px;
}

.portal-content {
  width: 100%;
  min-width: 0;
  padding: 1.5rem var(--portal-gutter) 3rem;
}

@media (min-width: 1025px) {
  .portal-content {
    padding: 2.5rem var(--portal-gutter) 4rem 2rem;
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.portal-panel {
  display: none;
  animation: dash-fade 0.25s ease;
}

.portal-panel.is-active {
  display: block;
}

@keyframes dash-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.portal-panel__head {
  margin-bottom: 2rem;
}

.portal-panel__eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--portal-blue);
}

.portal-panel__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.portal-panel__sub {
  margin: 0;
  max-width: 520px;
  font-size: 0.9375rem;
  color: var(--portal-muted);
  line-height: 1.55;
}

.portal-panel__since {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--portal-blue);
  letter-spacing: 0.01em;
}

/* Inicio — layout ancho completo */
.dash-home {
  width: 100%;
  max-width: 100%;
}

.dash-home__sub {
  max-width: 640px;
}

.dash-home__stats {
  width: 100%;
}

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

@media (min-width: 768px) {
  .dash-home__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: stretch;
  }

  .dash-home__row--quick {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.dash-home__row--quick {
  margin-top: 0.25rem;
}

.dash-card--compact {
  padding: 1.1rem 1.2rem;
}

.dash-card__top--compact {
  margin-bottom: 0.75rem;
}

.dash-card__top--compact h2 {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--portal-subtle);
}

.dash-quick__value {
  margin: 0 0 0.35rem;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
}

.dash-quick__subject {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
}

/* Stats */
.dash-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

@media (min-width: 768px) {
  .dash-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1025px) {
  .dash-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.dash-stat {
  padding: 1.1rem 1rem;
  border-radius: 14px;
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
}

.dash-stat--accent {
  border-color: rgba(77, 159, 255, 0.2);
  background: rgba(77, 159, 255, 0.06);
}

.dash-stat__value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.1;
}

.dash-stat__label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--portal-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-card {
  padding: 1.35rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--portal-border);
}

.dash-card--stretch {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.dash-card__body {
  flex: 1;
}

.dash-card__actions {
  margin-top: auto;
  padding-top: 1rem;
}

.dash-card__actions--inline {
  margin-top: 0.85rem;
  padding-top: 0;
}

.dash-card--highlight {
  background: linear-gradient(145deg, rgba(77, 159, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-color: rgba(77, 159, 255, 0.15);
}

.dash-next-payment {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--portal-border);
}

.dash-next-payment__label {
  margin: 0 0 0.25rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--portal-subtle);
}

.dash-next-payment__value {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
}

.dash-next-payment__concept {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: var(--portal-muted);
}

/* Club VIP — tarjeta premium en Inicio */
.dash-home-vip {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(145deg, #1e3a8a 0%, #2563eb 38%, #3b82f6 72%, #4d9fff 100%);
  box-shadow:
    0 0 0 1px rgba(253, 224, 138, 0.08) inset,
    0 20px 48px rgba(37, 99, 235, 0.22);
}

.dash-home-vip__glow {
  position: absolute;
  top: -40%;
  right: -15%;
  width: 55%;
  height: 140%;
  background: radial-gradient(circle, rgba(253, 224, 138, 0.18) 0%, transparent 68%);
  pointer-events: none;
}

.dash-home-vip__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem 1.35rem;
}

@media (min-width: 768px) {
  .dash-home-vip__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1.65rem 1.75rem;
  }
}

.dash-home-vip .dash-btn--vip {
  width: 100%;
}

@media (min-width: 768px) {
  .dash-home-vip .dash-btn--vip {
    width: auto;
  }
}

.dash-home-vip__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex: 1;
}

.dash-home-vip__eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.dash-home-vip__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.3;
}

.dash-home-vip__desc {
  margin: 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
}

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

.dash-card__top h2 {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--portal-subtle);
}

.dash-card__name {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.dash-card__meta,
.dash-card__desc {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  color: var(--portal-muted);
  line-height: 1.5;
}

.dash-invoice-ref {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--portal-subtle);
  font-family: ui-monospace, "SF Mono", monospace;
}

.dash-invoice-amount {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.dash-vip-resource {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fde68a;
}

/* Badges */
.dash-badge {
  display: inline-flex;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dash-badge--blue {
  background: rgba(77, 159, 255, 0.15);
  color: var(--portal-blue);
}

.dash-badge--green {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
}

.dash-badge--amber {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.dash-badge--gray {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.dash-suscripcion-card {
  max-width: 640px;
  padding: 1.15rem 1.25rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dash-suscripcion-card + .dash-suscripcion-card {
  margin-top: 0.85rem;
}

.dash-suscripcion-card.is-cancelled {
  opacity: 0.72;
}

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

.dash-suscripcion-card__title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.dash-suscripcion-card__meta {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--portal-muted);
}

.dash-suscripcion-card__amount {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
}

.dash-suscripcion-card__amount span {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--portal-muted);
}

.dash-suscripciones-help {
  max-width: 640px;
  margin: 1.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--portal-muted);
}

.dash-suscripciones-help a {
  color: var(--portal-blue);
  text-decoration: none;
}

.dash-suscripciones-help a:hover {
  text-decoration: underline;
}

.dash-empty-state {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--portal-subtle);
}

.dash-empty-state--inline {
  padding: 0.5rem 0 0.25rem;
}

.dash-card.is-empty .dash-card__top .dash-badge {
  display: none;
}

.dash-table__empty {
  padding: 1.25rem 0.75rem !important;
  color: var(--portal-subtle);
  text-align: center;
}

#proyectosMount .dash-project + .dash-project {
  margin-top: 1.25rem;
}

.dash-badge--gold {
  background: rgba(253, 224, 138, 0.12);
  color: #fde68a;
}

.dash-badge--exclusive {
  flex-shrink: 0;
  background: #fde68a;
  color: #1e3a5f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Progress */
.dash-progress {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.dash-progress--lg {
  height: 10px;
  flex: 1;
  margin-bottom: 0;
}

.dash-progress__bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--portal-blue-deep), var(--portal-blue));
}

.dash-progress__bar.is-complete {
  background: linear-gradient(90deg, #059669, #34d399);
}

.dash-progress__label {
  margin: 0;
  font-size: 0.75rem;
  color: var(--portal-muted);
}

.dash-card--stretch .dash-progress__label {
  margin-bottom: 0;
}

/* Buttons */
.dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.1rem;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.dash-btn--sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.75rem;
}

.dash-btn--primary {
  background: var(--portal-blue-deep);
  color: #fff;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.dash-btn--primary:hover:not(:disabled) {
  background: var(--portal-blue);
  transform: translateY(-1px);
}

.dash-btn--ghost {
  background: transparent;
  border: 1px solid var(--portal-border);
  color: var(--portal-muted);
}

.dash-btn--ghost:hover:not(:disabled) {
  background: var(--portal-surface-hover);
  color: #fff;
}

.dash-btn--vip {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.95);
  color: #1e40af;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.dash-btn--vip:hover:not(:disabled) {
  background: #fff;
  transform: translateY(-1px);
}

.dash-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dash-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--portal-blue);
  cursor: pointer;
}

.dash-link-btn:hover {
  text-decoration: underline;
}

/* Project detail */
.dash-project {
  padding: 1.75rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--portal-border);
}

.dash-project__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dash-project__title {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.dash-project__type {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--portal-muted);
}

.dash-project__updated {
  margin: 0.35rem 0 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--portal-subtle);
}

.dash-project__contact {
  display: inline-block;
  margin-bottom: 1.75rem;
}

.dash-project__progress-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.dash-project__pct {
  font-size: 1rem;
  font-weight: 800;
  color: var(--portal-blue);
  min-width: 2.5rem;
}

.dash-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 2rem;
  padding-left: 0.5rem;
}

.dash-timeline__item {
  display: flex;
  gap: 1rem;
  padding-bottom: 1.5rem;
  position: relative;
}

.dash-timeline__item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.dash-timeline__item.is-done:not(:last-child)::before {
  background: rgba(77, 159, 255, 0.25);
}

.dash-timeline__dot {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.dash-timeline__item.is-done .dash-timeline__dot {
  background: var(--portal-blue);
  box-shadow: 0 0 0 3px rgba(77, 159, 255, 0.2);
}

.dash-timeline__item.is-active .dash-timeline__dot {
  background: var(--portal-accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.2);
  animation: dash-pulse 2s ease infinite;
}

@keyframes dash-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.65;
  }
}

.dash-timeline__item strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.dash-timeline__item span {
  font-size: 0.75rem;
  color: var(--portal-subtle);
}

.dash-project__team p {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--portal-subtle);
}

.dash-team {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dash-team__member {
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--portal-muted);
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
}

/* Table */
.dash-facturas-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dash-facturas-search {
  position: relative;
  max-width: 420px;
}

.dash-facturas-search__icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--portal-subtle);
  pointer-events: none;
}

.dash-facturas-search__input {
  width: 100%;
  padding: 0.65rem 0.9rem 0.65rem 2.5rem;
  border-radius: 10px;
  border: 1px solid var(--portal-border);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color 0.2s, background 0.2s;
}

.dash-facturas-search__input::placeholder {
  color: var(--portal-subtle);
}

.dash-facturas-search__input:focus {
  outline: none;
  border-color: var(--portal-border-focus);
  background: rgba(255, 255, 255, 0.05);
}

.dash-facturas-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.25rem;
}

.dash-facturas-filter {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.dash-facturas-filter__label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--portal-subtle);
}

.dash-segment {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--portal-border);
}

.dash-segment__btn {
  padding: 0.45rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--portal-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.dash-segment__btn.is-selected {
  background: rgba(77, 159, 255, 0.14);
  color: var(--portal-blue);
  box-shadow: inset 0 0 0 1px rgba(77, 159, 255, 0.22);
}

.dash-segment__btn:not(.is-selected):hover {
  background: var(--portal-surface-hover);
  color: #fff;
}

.dash-segment__btn:focus-visible {
  outline: 2px solid rgba(77, 159, 255, 0.45);
  outline-offset: 2px;
}

.dash-select {
  min-width: 9.5rem;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--portal-border);
  background: rgba(255, 255, 255, 0.03) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.65rem center;
  color: #fff;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
}

.dash-select:focus {
  outline: none;
  border-color: var(--portal-border-focus);
}

.dash-facturas-empty {
  margin-top: 1rem;
}

.dash-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 0.5rem;
}

.dash-pagination__info {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--portal-muted);
  min-width: 8rem;
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dash-table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--portal-border);
  background: rgba(255, 255, 255, 0.02);
}

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

.dash-table th,
.dash-table td {
  padding: 1rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--portal-border);
}

.dash-table th {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--portal-subtle);
  background: rgba(0, 0, 0, 0.2);
}

.dash-table tr:last-child td {
  border-bottom: none;
}

.dash-table td {
  color: var(--portal-muted);
}

.dash-table td strong {
  color: #fff;
  font-weight: 700;
}

.dash-table .dash-btn {
  white-space: nowrap;
}

.dash-table--facturas {
  table-layout: fixed;
}

.dash-table--facturas .dash-table__col-ref {
  width: 9.5rem;
}

.dash-table--facturas .dash-table__col-concepto {
  width: auto;
}

.dash-table--facturas .dash-table__col-fecha {
  width: 7.5rem;
}

.dash-table--facturas .dash-table__col-importe {
  width: 7rem;
}

.dash-table--facturas .dash-table__col-estado {
  width: 6.5rem;
}

.dash-table--facturas .dash-table__col-action {
  width: 9.5rem;
}

.dash-table--facturas td.dash-table__col-ref,
.dash-table--facturas td.dash-table__col-fecha,
.dash-table--facturas td.dash-table__col-importe,
.dash-table--facturas td.dash-table__col-estado {
  white-space: nowrap;
}

.dash-table--facturas td.dash-table__col-ref strong {
  white-space: nowrap;
}

.dash-table--facturas td.dash-table__col-concepto {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 0;
}

.dash-table--facturas td.dash-table__col-action {
  text-align: right;
}

@media (max-width: 767px) {
  .dash-facturas-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-segment {
    flex-wrap: wrap;
  }

  .dash-select {
    width: 100%;
  }
}

/* VIP — vista editorial */
.dash-vip {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dash-vip-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
}

@media (min-width: 768px) {
  .dash-vip-hero {
    grid-template-columns: minmax(200px, 280px) 1fr;
  }
}

.dash-vip-hero__cover {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 2rem;
}

.dash-vip-hero__cover svg {
  width: 56px;
  height: 56px;
  color: rgba(255, 255, 255, 0.92);
}

.dash-vip-hero__cover--guia {
  background: linear-gradient(145deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
}

.dash-vip-hero__cover--plantilla {
  background: linear-gradient(145deg, #312e81 0%, #4f46e5 55%, #6366f1 100%);
}

.dash-vip-hero__cover--video {
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 45%, #334155 100%);
}

.dash-vip-hero__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 1.5rem 1.35rem;
}

@media (min-width: 768px) {
  .dash-vip-hero__body {
    padding: 1.75rem 2rem;
  }
}

.dash-vip-hero__badge {
  display: inline-flex;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: #fde68a;
  color: #1e3a5f;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.dash-vip-hero__type {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--portal-blue);
}

.dash-vip-hero__title {
  margin: 0;
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: #fff;
}

.dash-vip-hero__desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--portal-muted);
  line-height: 1.55;
  max-width: 520px;
}

.dash-vip-hero__date {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--portal-subtle);
}

.dash-vip-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .dash-vip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .dash-vip-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.dash-vip-card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--portal-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dash-vip-card:hover {
  transform: translateY(-2px);
  border-color: rgba(77, 159, 255, 0.22);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.dash-vip-card__cover {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  flex-shrink: 0;
}

.dash-vip-card__cover svg {
  width: 40px;
  height: 40px;
  color: rgba(255, 255, 255, 0.9);
}

.dash-vip-card__cover--guia {
  background: linear-gradient(145deg, #1e40af 0%, #2563eb 60%, #60a5fa 100%);
}

.dash-vip-card__cover--plantilla {
  background: linear-gradient(145deg, #4338ca 0%, #6366f1 70%, #818cf8 100%);
}

.dash-vip-card__cover--video {
  background: linear-gradient(160deg, #020617 0%, #0f172a 50%, #1e293b 100%);
}

.dash-vip-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.15rem 1.15rem 1.25rem;
}

.dash-vip-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.dash-vip-card__type {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--portal-blue);
  flex-shrink: 0;
}

.dash-vip-card__type--plantilla {
  color: #a5b4fc;
}

.dash-vip-card__type--video {
  color: #94a3b8;
}

.dash-vip-card__date {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--portal-subtle);
  text-align: right;
  white-space: nowrap;
}

.dash-vip-card__title {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
}

.dash-vip-card__desc {
  margin: 0 0 1.15rem;
  flex: 1;
  font-size: 0.8125rem;
  color: var(--portal-muted);
  line-height: 1.55;
}

.dash-vip-card .dash-btn {
  align-self: flex-start;
  text-decoration: none;
}

.dash-vip-hero .dash-btn {
  text-decoration: none;
}

/* VIP — página de artículo */
.vip-article-wrap {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 1.5rem var(--portal-gutter) 4rem;
}

@media (max-width: 767px) {
  .vip-article-wrap {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .vip-article-wrap {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

.vip-article {
  width: 100%;
}

.vip-article__loading {
  margin: 0;
  font-size: 0.875rem;
  color: var(--portal-muted);
}

.vip-article__back {
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--portal-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.vip-article__back--top {
  margin-bottom: 1.25rem;
}

.vip-article__back--top:hover {
  color: #fff;
  text-decoration: none;
}

.vip-article__btn {
  font-size: 0.8125rem;
  padding: 0.65rem 1rem;
}

.vip-article__hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  margin-bottom: 1.75rem;
  border-radius: 18px;
  overflow: hidden;
}

.vip-article__hero svg {
  width: 72px;
  height: 72px;
  color: rgba(255, 255, 255, 0.92);
}

.vip-article__hero--guia {
  background: linear-gradient(145deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
}

.vip-article__hero--plantilla {
  background: linear-gradient(145deg, #312e81 0%, #4f46e5 55%, #6366f1 100%);
}

.vip-article__hero--video {
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 45%, #334155 100%);
}

.vip-article__header {
  margin-bottom: 2rem;
}

.vip-article__badge {
  display: inline-flex;
  margin-right: 0.5rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: #fde68a;
  color: #1e3a5f;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.vip-article__type {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--portal-blue);
}

.vip-article__type.dash-vip-card__type--plantilla {
  color: #a5b4fc;
}

.vip-article__type.dash-vip-card__type--video {
  color: #94a3b8;
}

.vip-article__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #fff;
}

.vip-article__date {
  margin: 0 0 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--portal-subtle);
}

.vip-article__excerpt {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--portal-muted);
  line-height: 1.6;
  max-width: 640px;
}

.vip-article__body {
  margin-bottom: 2.5rem;
}

.vip-article__video {
  margin-bottom: 2rem;
}

.vip-article__video iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 14px;
  background: #000;
}

.vip-article__video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 280px;
  border-radius: 14px;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  border: 1px solid var(--portal-border);
  color: var(--portal-muted);
}

.vip-article__video-placeholder p {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.vip-article__content {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.82);
}

.vip-article__content h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.vip-article__content h2:first-child {
  margin-top: 0;
}

.vip-article__content p {
  margin: 0 0 1rem;
}

.vip-article__content ul {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
}

.vip-article__content li {
  margin-bottom: 0.45rem;
}

.vip-article__content li::marker {
  color: var(--portal-blue);
}

.vip-article__footer {
  padding-top: 1.5rem;
  border-top: 1px solid var(--portal-border);
}

.vip-article__related {
  margin-bottom: 2rem;
}

.vip-article__related-title {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--portal-subtle);
}

.vip-related-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .vip-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.vip-related-card {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--portal-border);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.vip-related-card:hover {
  transform: translateY(-2px);
  border-color: rgba(77, 159, 255, 0.22);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.vip-related-card__cover {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 72px;
  flex-shrink: 0;
}

.vip-related-card__cover svg {
  width: 28px;
  height: 28px;
  color: rgba(255, 255, 255, 0.9);
}

.vip-related-card__cover--guia {
  background: linear-gradient(145deg, #1e40af 0%, #2563eb 60%, #60a5fa 100%);
}

.vip-related-card__cover--plantilla {
  background: linear-gradient(145deg, #4338ca 0%, #6366f1 70%, #818cf8 100%);
}

.vip-related-card__cover--video {
  background: linear-gradient(160deg, #020617 0%, #0f172a 50%, #1e293b 100%);
}

.vip-related-card__body {
  padding: 0.85rem 0.9rem 1rem;
}

.vip-related-card__type {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--portal-blue);
}

.vip-related-card__type.dash-vip-card__type--plantilla {
  color: #a5b4fc;
}

.vip-related-card__type.dash-vip-card__type--video {
  color: #94a3b8;
}

.vip-related-card__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
}

.vip-article__support {
  margin-bottom: 2rem;
  padding: 1.15rem 0 0;
  border-top: 1px solid var(--portal-border);
}

.vip-article__support-text {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--portal-muted);
  line-height: 1.5;
}

/* Toast */
.dash-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  left: 1.5rem;
  max-width: 360px;
  margin-left: auto;
  padding: 0.9rem 1.15rem;
  border-radius: 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  background: #1e293b;
  border: 1px solid var(--portal-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 200;
}

.dash-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Modal referidos (SweetAlert2) ── */
.referral-swal-popup {
  width: min(22rem, calc(100vw - 2rem)) !important;
  padding: 1.75rem 1.5rem 1.35rem !important;
  background: #11182b !important;
  border: 1px solid var(--portal-border) !important;
  border-radius: var(--portal-radius) !important;
  box-shadow: var(--portal-shadow) !important;
  font-family: var(--portal-font) !important;
  color: var(--portal-text) !important;
}

.referral-swal-popup .swal2-title {
  display: none !important;
}

.referral-swal-popup .swal2-icon {
  display: none !important;
}

.referral-swal-html {
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
}

.referral-swal-popup .swal2-actions {
  width: 100%;
  margin: 1.35rem 0 0 !important;
  padding: 0 !important;
}

.referral-swal-confirm {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  margin: 0 !important;
  padding: 0.85rem 1.25rem !important;
  border: none !important;
  border-radius: var(--portal-radius-sm) !important;
  background: linear-gradient(180deg, var(--portal-blue-deep) 0%, var(--portal-blue-dark) 100%) !important;
  box-shadow:
    0 4px 20px rgba(59, 130, 246, 0.35),
    inset 0 0 0 1px rgba(77, 159, 255, 0.25) !important;
  font-family: var(--portal-font) !important;
  font-size: 0.9375rem !important;
  font-weight: 700 !important;
  color: #fff !important;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s, box-shadow 0.2s;
}

.referral-swal-confirm:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.referral-swal-confirm:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(77, 159, 255, 0.3) !important;
}

.referral-swal-validation {
  margin: 0.75rem 0 0 !important;
  padding: 0 !important;
  font-size: 0.8125rem !important;
  color: var(--portal-error) !important;
  background: transparent !important;
}

.referral-modal {
  text-align: center;
}

.referral-modal__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 1.15rem;
  border-radius: 50%;
  background: rgba(77, 159, 255, 0.15);
  color: var(--portal-blue);
}

.referral-modal__eyebrow {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--portal-blue);
}

.referral-modal__title {
  margin: 0 0 1rem;
  font-size: 1.3125rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--portal-text);
}

.referral-modal__text {
  margin: 0 0 0.85rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--portal-muted);
  text-align: left;
}

.referral-modal__text:last-child {
  margin-bottom: 0;
}

/* Soporte — tickets (portal cliente) */

.portal-panel__head--actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.portal-panel__head--actions .portal-panel__head-text {
  flex: 1;
  min-width: 0;
}

.portal-panel__head--actions .dash-btn {
  flex-shrink: 0;
  width: auto;
  align-self: flex-start;
  margin-top: 0.15rem;
}

.portal-tickets-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.75rem 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--portal-border);
  background: rgba(255, 255, 255, 0.025);
}

.portal-tickets-empty[hidden] {
  display: none !important;
}

#soporteTableWrap[hidden] {
  display: none !important;
}

.portal-tickets-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 1.15rem;
  border-radius: 18px;
  background: rgba(77, 159, 255, 0.12);
  color: var(--portal-blue);
}

.portal-tickets-empty__title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--portal-text);
}

.portal-tickets-empty__sub {
  margin: 0 0 1.35rem;
  max-width: 320px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--portal-muted);
}

.portal-tickets-empty .dash-btn {
  width: auto;
}

.portal-ticket-row {
  cursor: pointer;
  transition: background 0.15s;
}

.portal-ticket-row:hover td,
.portal-ticket-row:focus-visible td {
  background: rgba(255, 255, 255, 0.03);
}

.portal-ticket-row:focus-visible {
  outline: none;
}

.portal-ticket-row:focus-visible td:first-child {
  box-shadow: inset 3px 0 0 var(--portal-blue);
}

.dash-table--tickets .dash-table__col-subject {
  min-width: 10rem;
}

.dash-table--tickets .dash-table__col-type {
  min-width: 6.5rem;
}

.dash-table--tickets .dash-table__col-estado {
  min-width: 7rem;
}

.dash-table--tickets .dash-table__col-fecha {
  min-width: 8rem;
  white-space: nowrap;
}

.dash-table--tickets td.dash-table__col-subject strong {
  color: #fff;
  font-weight: 700;
}

.dash-table--tickets td.dash-table__col-fecha {
  color: var(--portal-subtle);
  font-size: 0.8125rem;
}

.dash-table--documentos .dash-table__col-subject {
  min-width: 10rem;
}

.dash-table--documentos .dash-table__col-type {
  width: 7.5rem;
}

.dash-table--documentos .dash-table__col-fecha {
  width: 7rem;
}

.dash-table--documentos .dash-table__col-size {
  width: 5.5rem;
}

.dash-table--documentos .dash-table__col-actions {
  width: 8rem;
  text-align: right;
}

.dash-table--documentos td.dash-table__col-subject strong {
  display: block;
  font-weight: 700;
}

.dash-table--documentos .dash-table__sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--portal-subtle);
}

.dash-table--documentos td.dash-table__col-fecha,
.dash-table--documentos td.dash-table__col-size {
  color: var(--portal-subtle);
  font-size: 0.8125rem;
}

.portal-documents-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1.5rem;
  border-radius: 16px;
  border: 1px dashed var(--portal-border);
  background: rgba(255, 255, 255, 0.02);
}

.portal-documents-empty[hidden] {
  display: none !important;
}

.portal-documents-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 1rem;
  border-radius: 14px;
  background: rgba(96, 165, 250, 0.08);
  color: #60a5fa;
}

.portal-documents-empty__title {
  margin: 0 0 0.45rem;
  font-size: 1.0625rem;
  font-weight: 700;
}

.portal-documents-empty__sub {
  margin: 0;
  max-width: 360px;
  font-size: 0.875rem;
  color: var(--portal-muted);
  line-height: 1.55;
}

.portal-ticket-detail__head {
  margin-bottom: 1.5rem;
}

.portal-ticket-back {
  margin-bottom: 0.75rem;
}

.portal-ticket-detail__title {
  margin: 0 0 0.65rem;
  font-size: 1.375rem;
  font-weight: 700;
}

.portal-ticket-detail__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}

.portal-ticket-detail__meta {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--portal-muted);
}

.portal-ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: min(52vh, 480px);
  overflow-y: auto;
  margin-bottom: 1.25rem;
  padding: 0.25rem 0.15rem;
}

.portal-ticket-msg {
  max-width: min(88%, 560px);
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--portal-border);
  background: rgba(255, 255, 255, 0.03);
}

.portal-ticket-msg--client {
  align-self: flex-end;
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.08);
}

.portal-ticket-msg--staff {
  align-self: flex-start;
  border-color: rgba(255, 255, 255, 0.08);
}

.portal-ticket-msg__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
}

.portal-ticket-msg__head strong {
  font-weight: 700;
  color: var(--portal-text);
}

.portal-ticket-msg__head time {
  color: var(--portal-muted);
  white-space: nowrap;
}

.portal-ticket-msg__body {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--portal-text);
}

.portal-ticket-reply {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: flex-start;
}

.portal-ticket-reply .dash-btn,
.portal-ticket-reply .portal-btn {
  width: auto;
}

.portal-textarea,
.portal-input.portal-input--field {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--portal-border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--portal-text);
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
}

.portal-textarea:focus,
.portal-input.portal-input--field:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.portal-sidebar__support-btn {
  cursor: pointer;
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.portal-badge--gray {
  color: var(--portal-muted);
  background: rgba(255, 255, 255, 0.08);
}

.portal-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.portal-modal.is-open {
  display: flex;
}

.portal-modal__card {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.35rem;
  border-radius: 16px;
  background: var(--portal-surface, #11182b);
  border: 1px solid var(--portal-border);
}

.portal-modal__card--ticket {
  padding: 1.5rem;
}

.portal-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.portal-modal__head--brand {
  align-items: flex-start;
}

.portal-modal__head-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}

.portal-modal__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--portal-blue-deep) 0%, var(--portal-blue) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
}

.portal-modal__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

.portal-modal__close {
  padding: 0.35rem;
  border: none;
  background: none;
  color: var(--portal-muted);
  font-size: 1.35rem;
  cursor: pointer;
  line-height: 1;
}

.portal-modal__form .portal-field {
  margin-bottom: 1.25rem;
}

.portal-modal__form .portal-field:last-of-type {
  margin-bottom: 0;
}

.portal-modal__form label,
.portal-modal__form .portal-field__label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--portal-muted);
}

.portal-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.5rem;
  padding-top: 0.25rem;
}

.portal-btn--auto {
  width: auto;
}

/* Dropdown proyecto (modal ticket) */
.portal-dropdown {
  position: relative;
}

.portal-dropdown__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--portal-border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--portal-text);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.portal-dropdown__trigger:hover {
  background: rgba(255, 255, 255, 0.04);
}

.portal-dropdown.is-open .portal-dropdown__trigger,
.portal-dropdown__trigger:focus-visible {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.portal-dropdown__value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-dropdown__chevron {
  flex-shrink: 0;
  color: var(--portal-muted);
  transition: transform 0.15s;
}

.portal-dropdown.is-open .portal-dropdown__chevron {
  transform: rotate(180deg);
}

.portal-dropdown__list {
  position: absolute;
  z-index: 10;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid var(--portal-border);
  background: #141c2e;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.portal-dropdown__option {
  display: block;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--portal-text);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.portal-dropdown__option:hover,
.portal-dropdown__option:focus-visible {
  outline: none;
  background: rgba(77, 159, 255, 0.12);
  color: #fff;
}

@media (max-width: 640px) {
  .portal-panel__head--actions {
    flex-direction: column;
    align-items: stretch;
  }

  .portal-panel__head--actions .dash-btn {
    align-self: flex-end;
    margin-top: 0;
  }
}

