:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --border: #2a2f3a;
  --text: #e8eaed;
  --muted: #9aa3af;
  --brand: #7c5cff;
  --brand-2: #22d3c5;
  --ok: #2ecc71;
  --warn: #f5a623;
  --danger: #ef4444;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--brand-2); }

header.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

header.topbar .brand {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.3px;
}
header.topbar .brand span { color: var(--brand-2); }

nav.tabs {
  display: flex;
  gap: 4px;
  padding: 10px 24px 0;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  flex-wrap: wrap;
}
nav.tabs button {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-size: 14px;
}
nav.tabs button.active {
  color: var(--text);
  border-bottom-color: var(--brand);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.card h3 { margin: 0 0 8px; font-size: 15px; color: var(--muted); font-weight: 600; }
.card .big { font-size: 28px; font-weight: 700; }

.btn {
  display: inline-block;
  background: var(--brand);
  color: white;
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.btn.danger { background: var(--danger); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

input, select {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
  width: 100%;
}

label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.active, .badge.paid, .badge.available { background: rgba(46,204,113,.15); color: var(--ok); }
.badge.pending, .badge.pending_verification, .badge.maintenance { background: rgba(245,166,35,.15); color: var(--warn); }
.badge.expired, .badge.cancelled, .badge.suspended, .badge.blocked, .badge.disabled, .badge.failed { background: rgba(239,68,68,.15); color: var(--danger); }
.badge.closed, .badge.assigned, .badge.fulfilled { background: rgba(124,92,255,.15); color: var(--brand); }

.msg { padding: 10px 14px; border-radius: 8px; margin: 12px 0; font-size: 14px; }
.msg.error { background: rgba(239,68,68,.12); color: #ff9b9b; }
.msg.ok { background: rgba(46,204,113,.12); color: #9df0bb; }

.hero {
  text-align: center;
  padding: 60px 20px;
}
.hero h1 { font-size: 34px; margin-bottom: 8px; }
.hero p { color: var(--muted); font-size: 16px; }

.muted { color: var(--muted); }
.hidden { display: none !important; }
.access-box {
  background: var(--panel-2);
  border: 1px dashed var(--brand);
  border-radius: 8px;
  padding: 12px;
  font-family: monospace;
  font-size: 13px;
  margin-top: 10px;
}
footer { text-align: center; color: var(--muted); padding: 30px; font-size: 13px; }

/* --- Modal de credenciales (persistente, no se autocierra) --- */
.cred-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
.cred-modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.cred-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.cred-head h3 { margin: 0; font-size: 16px; }
.cred-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.cred-close:hover { color: var(--text); }
.cred-body { padding: 8px 18px; }
.cred-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.cred-row:last-child { border-bottom: none; }
.cred-label {
  color: var(--muted);
  font-size: 13px;
  min-width: 90px;
  flex-shrink: 0;
}
.cred-value {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 14px;
  word-break: break-all;
  flex: 1;
}
.cred-value.is-secret.masked { letter-spacing: 2px; color: var(--muted); }
.cred-actions { display: flex; gap: 6px; flex-shrink: 0; }
.btn.tiny { padding: 5px 10px; font-size: 12px; }
.btn.tiny.copied { background: var(--ok); color: #05230f; border-color: transparent; }
.cred-note {
  margin: 0;
  padding: 0 18px 4px;
  color: var(--muted);
  font-size: 12px;
}
.cred-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  text-align: right;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.cred-modal { max-height: 86vh; display: flex; flex-direction: column; }
.cred-body { overflow-y: auto; }
.zx-form label:first-of-type { margin-top: 2px; }

/* Lista de perfiles dentro del modal de gestión */
.prof-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.prof-row:last-child { border-bottom: none; }
.prof-name { font-weight: 600; flex: 1; min-width: 120px; }
.prof-meta { color: var(--muted); font-size: 12px; width: 100%; }
.prof-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.section-title {
  margin: 18px 0 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}
.rot-account {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  background: var(--panel);
}
.rot-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.rot-head strong { flex: 1; min-width: 160px; }
.rot-profiles { margin-left: 4px; border-left: 2px solid var(--border); padding-left: 12px; }
.rot-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  flex-wrap: wrap;
}
.rot-profile span.pname { flex: 1; min-width: 120px; font-size: 14px; }

/* Vista única de credenciales + rotación */
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 18px;
}
.cred-table { font-size: 13px; }
.cred-table th { white-space: nowrap; }
.cred-table td { vertical-align: middle; }
.cred-table .row-account td { border-top: 2px solid var(--border); }
.cred-table .row-account td:first-child { font-weight: 600; }
.cred-table .row-profile td { color: var(--text); }
.cred-table .indent { padding-left: 24px; position: relative; }
.cred-table .indent::before {
  content: '└';
  position: absolute;
  left: 8px;
  color: var(--muted);
}
.cred-table .mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.cred-table .nowrap { white-space: nowrap; }
.cred-table .secret-val {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  user-select: all;
}
@media (max-width: 900px) {
  .cred-table { display: block; overflow-x: auto; }
}

/* Resultados de la rotación masiva */
.rot-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.rot-result:last-child { border-bottom: none; }
.rot-result.done { opacity: .5; }
.rot-check input { width: auto; }
.rot-info { flex: 1; min-width: 150px; }
.rot-title { font-weight: 600; font-size: 14px; }
.rot-sub { color: var(--muted); font-size: 12px; }
.rot-cred { display: flex; flex-direction: column; gap: 2px; }
.rot-label { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.rot-cred code {
  font-size: 15px;
  background: var(--panel-2);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.rot-btns { display: flex; gap: 6px; }
@media (max-width: 560px) {
  .rot-btns, .rot-cred { width: 100%; }
}
@media (max-width: 560px) {
  .cred-row { flex-wrap: wrap; }
  .cred-label { min-width: 100%; }
}

/* Detalle operativo de una cuenta y sus perfiles */
.account-cred-modal { max-width: 680px; }
.account-rotate-btn { margin-left: auto; margin-right: 10px; }
.account-cred-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  margin: 10px 0 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--border);
}
.account-cred-meta > div,
.account-main-creds > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  background: var(--panel-2);
}
.account-cred-meta span,
.account-main-creds span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.account-main-creds { display: grid; gap: 8px; }
.account-cred-value {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 14px;
  word-break: break-all;
  user-select: all;
}
.account-profiles-wrap { overflow-x: auto; margin-bottom: 10px; }
.account-profiles td { vertical-align: middle; }
.account-profiles-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.account-profiles-head .section-title { margin: 0; }
.account-profiles-head .section-title span {
  margin-left: 5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.account-add-profile-btn { flex-shrink: 0; }
.account-profiles-head + .account-profiles-wrap { margin-top: 7px; }
@media (max-width: 560px) {
  .account-cred-meta { grid-template-columns: 1fr; }
  .account-rotate-btn { padding: 7px 11px; }
}

/* --- Portada cinematográfica ZynexPass --- */
.home {
  --home-bg: #050608;
  --home-surface: #111318;
  --home-line: rgba(177, 196, 218, .14);
  --home-cyan: #27d7ee;
  --home-violet: #8b62ff;
  background:
    radial-gradient(circle at 14% 28%, rgba(39, 215, 238, .055), transparent 30rem),
    radial-gradient(circle at 82% 58%, rgba(139, 98, 255, .05), transparent 34rem),
    var(--home-bg);
  color: #f4f2ef;
  min-height: 100vh;
}
.home::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}
.home .home-topbar {
  min-height: 64px;
  padding: 0 max(22px, calc((100vw - 1280px) / 2));
  background: rgba(5, 6, 8, .94);
  border-bottom-color: var(--home-line);
  position: relative;
  z-index: 10;
}
.home .brand {
  color: #fff;
  text-decoration: none;
  font-size: 21px;
  font-weight: 850;
  letter-spacing: -.7px;
}
.home-actions { display: flex; gap: 10px; }
.home .btn {
  text-decoration: none;
  border-radius: 7px;
  padding: 10px 17px;
  background: var(--home-violet);
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.home .btn:hover { transform: translateY(-1px); box-shadow: 0 8px 25px rgba(139, 98, 255, .22); }
.home .btn.secondary { background: #14171d; border-color: var(--home-line); }
.home .btn:focus-visible,
.home .service-cta:focus-visible {
  outline: 3px solid rgba(39, 215, 238, .55);
  outline-offset: 3px;
}
.home .home-main {
  max-width: 1280px;
  padding: 28px 24px 54px;
  position: relative;
}
.home-hero {
  min-height: 300px;
  display: flex;
  align-items: center;
  border: 1px solid var(--home-line);
  border-radius: 18px;
  overflow: hidden;
  background-image:
    linear-gradient(90deg, rgba(5, 6, 8, .98) 0%, rgba(5, 6, 8, .83) 38%, rgba(5, 6, 8, .08) 75%),
    url("assets/zynex-hero.jpg");
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 55px rgba(0, 0, 0, .4), 0 22px 60px rgba(0, 0, 0, .28);
  animation: homeReveal .65s ease both;
}
.hero-copy { max-width: 590px; padding: 42px 46px; }
.eyebrow, .section-kicker {
  margin: 0 0 9px;
  color: var(--home-cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.home-hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: .98;
  letter-spacing: -2.6px;
}
.home-hero h1 span { color: #fff; text-shadow: 0 0 30px rgba(139, 98, 255, .38); }
.home-hero .hero-copy > p:not(.eyebrow) {
  max-width: 500px;
  margin: 18px 0 21px;
  color: #bec5ce;
  line-height: 1.55;
}
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-chips span {
  padding: 6px 10px;
  border: 1px solid rgba(39, 215, 238, .28);
  border-radius: 5px;
  color: #c9f9ff;
  background: rgba(39, 215, 238, .08);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.hero-chips span + span {
  border-color: rgba(139, 98, 255, .32);
  color: #d8ccff;
  background: rgba(139, 98, 255, .09);
}
.home-section { margin-top: 46px; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 17px;
}
.section-heading h2 { margin: 0; font-size: 25px; letter-spacing: -.65px; }
.section-heading > p { margin: 0 0 2px; color: #7f8998; font-size: 13px; }
.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 13px;
}
.package-card {
  min-width: 0;
  padding: 21px;
  position: relative;
  text-align: center;
  border: 1px solid var(--home-line);
  background: linear-gradient(150deg, rgba(23, 26, 32, .96), rgba(10, 11, 14, .97));
  transition: transform .24s ease, border-color .24s ease;
  animation: homeReveal .55s ease both;
}
.package-card:nth-child(2) { animation-delay: .07s; }
.package-card:nth-child(3) { animation-delay: .14s; }
.package-card:nth-child(4) { animation-delay: .21s; }
.package-card:hover { transform: translateY(-4px); border-color: rgba(39, 215, 238, .34); }
.package-card.recommended {
  border-color: #9781ff;
  background: linear-gradient(145deg, #20252d 18%, #151922);
  box-shadow: inset 0 0 28px rgba(39, 215, 238, .05), 0 0 28px rgba(139, 98, 255, .08);
}
.recommend-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 4px 7px;
  border-radius: 4px;
  background: #c7b6ff;
  color: #21164d;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}
.package-icon {
  display: block;
  height: 33px;
  color: var(--home-cyan);
  font-size: 27px;
}
.package-card:nth-child(odd) .package-icon { color: #bba9ff; }
.package-card h3 { margin: 9px 0; font-size: 16px; color: #dfe3e9; }
.credit-count { display: flex; justify-content: center; align-items: baseline; gap: 6px; }
.credit-count strong { font-size: 33px; letter-spacing: -1.5px; }
.credit-count span { color: #909aa8; font-size: 11px; font-weight: 800; }
.package-price { margin: 12px 0 16px; color: #f3f1ed; font-size: 20px; font-weight: 750; }
.home .package-buy { display: block; padding: 10px; background: #30343a; }
.home .recommended .package-buy { color: #061116; background: linear-gradient(100deg, var(--home-violet), var(--home-cyan)); }
.package-card.ultra {
  overflow: hidden;
  border-color: #42e6a4;
  background: radial-gradient(circle at 50% 0%, rgba(30, 215, 96, .18), transparent 52%), linear-gradient(145deg, #182221, #121419 72%);
  box-shadow: inset 0 0 32px rgba(30, 215, 96, .11), 0 0 32px rgba(30, 215, 96, .12);
}
.package-card.ultra::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 35%, rgba(255,255,255,.08), transparent 65%);
}
.ultra-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 4px 7px;
  border-radius: 4px;
  background: #43e6a5;
  color: #052517;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}
.package-card.ultra .package-icon { color: #43e6a5; }
.spotify-bonus {
  margin: -5px 0 13px;
  color: #79f3bb;
  font-size: 11px;
  font-weight: 800;
}
.spotify-bonus span { font-size: 16px; vertical-align: -1px; }
.home .ultra .package-buy { color: #071b11; background: linear-gradient(100deg, #43e6a5, #1ec4d9); }
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
}
.service-card {
  min-height: 390px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--home-line);
  border-radius: 13px;
  background: #111318;
  isolation: isolate;
  animation: homeReveal .55s ease both;
}
.service-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .55s cubic-bezier(.2,.7,.2,1), filter .4s ease;
}
.service-card:hover img { transform: scale(1.045); filter: saturate(1.12); }
.service-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 34%, rgba(4, 5, 7, .34) 55%, #050608 82%);
  z-index: 1;
}
.service-content {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  padding: 18px;
}
.service-line { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.platform-wordmark { margin: 0; font-size: 23px; letter-spacing: -.9px; color: #fff; }
.platform-wordmark.netflix { color: #ff2537; letter-spacing: -1.4px; text-transform: uppercase; }
.platform-wordmark.disney { font-style: italic; font-weight: 750; }
.platform-wordmark.max { font-weight: 900; letter-spacing: -1.6px; }
.platform-wordmark.paramount { font-family: Georgia, serif; font-style: italic; }
.service-line > strong { flex-shrink: 0; color: var(--home-cyan); font-size: 17px; }
.service-line small { font-size: 10px; }
.service-content p { margin: 7px 0 13px; color: #9ca6b4; font-size: 12px; }
.service-cta {
  display: block;
  padding: 11px 10px;
  color: #071014;
  background: var(--home-cyan);
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .4px;
  text-transform: uppercase;
  transition: filter .2s ease, transform .2s ease;
}
.service-cta:hover { filter: brightness(1.1); transform: translateY(-1px); }
.service-cta.disabled { background: #30343b; color: #989faa; cursor: not-allowed; }
.home-loading, .home-empty, .home-error {
  grid-column: 1 / -1;
  padding: 30px;
  border: 1px solid var(--home-line);
  color: #98a2b0;
  background: #0e1014;
  text-align: center;
}
.home-error { color: #ffaaaa; border-color: rgba(239, 68, 68, .28); }
.home-footer {
  position: relative;
  border-top: 1px solid var(--home-line);
  color: #707987;
}
@keyframes homeReveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .home *, .home *::before, .home *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 900px) {
  .package-grid, .service-grid { grid-template-columns: repeat(2, 1fr); }
  .home-hero { min-height: 280px; background-position: 58% center; }
}
@media (max-width: 560px) {
  .home .home-topbar { min-height: 58px; padding: 0 14px; }
  .home .btn { padding: 8px 11px; font-size: 12px; }
  .home .home-main { padding: 16px 12px 38px; }
  .home-hero {
    min-height: 340px;
    align-items: end;
    border-radius: 13px;
    background-image:
      linear-gradient(0deg, rgba(5, 6, 8, .99) 5%, rgba(5, 6, 8, .72) 62%, rgba(5, 6, 8, .22)),
      url("assets/zynex-hero.jpg");
    background-position: 66% center;
  }
  .hero-copy { padding: 28px 22px; }
  .home-hero h1 { font-size: 37px; letter-spacing: -1.8px; }
  .home-section { margin-top: 35px; }
  .section-heading { align-items: start; flex-direction: column; gap: 5px; }
  .section-heading h2 { font-size: 22px; }
  .package-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .package-card { padding: 16px 12px; }
  .recommend-tag { position: static; display: inline-block; margin-bottom: 7px; }
  .package-icon { font-size: 22px; height: 27px; }
  .credit-count strong { font-size: 28px; }
  .package-price { font-size: 18px; }
  .service-grid {
    grid-template-columns: repeat(4, minmax(238px, 76vw));
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    scrollbar-width: thin;
  }
  .service-card { min-height: 360px; scroll-snap-align: start; }
}

/* --- Área autenticada del cliente --- */
.client-dashboard {
  --client-line: rgba(177, 196, 218, .14);
  --client-cyan: #27d7ee;
  --client-violet: #8b62ff;
  min-height: 100vh;
  background:
    radial-gradient(circle at 9% 17%, rgba(39, 215, 238, .07), transparent 28rem),
    radial-gradient(circle at 88% 62%, rgba(139, 98, 255, .065), transparent 34rem),
    #050608;
  color: #f4f2ef;
}
.client-dashboard::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .14;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}
.client-dashboard .client-topbar {
  min-height: 60px;
  padding: 0 max(22px, calc((100vw - 1180px) / 2));
  background: rgba(5, 6, 8, .95);
  border-color: var(--client-line);
}
.client-dashboard .brand {
  color: #fff;
  text-decoration: none;
  font-weight: 850;
  letter-spacing: -.7px;
}
.client-dashboard .client-topbar > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.client-dashboard .client-tabs {
  gap: 7px;
  padding: 9px max(22px, calc((100vw - 1180px) / 2));
  background: #0b0d11;
  border-color: var(--client-line);
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}
.client-dashboard .client-tabs button {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 12px;
  color: #8e98a6;
}
.client-dashboard .client-tabs button.active {
  color: #e9fdff;
  border-color: rgba(39, 215, 238, .22);
  background: rgba(39, 215, 238, .08);
}
.client-main {
  max-width: 1180px;
  padding: 34px 24px 64px;
}
.client-main > section { animation: homeReveal .4s ease both; }
.client-welcome {
  min-height: 210px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding: 34px 38px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--client-line);
  border-radius: 17px;
  background:
    linear-gradient(100deg, rgba(5, 6, 8, .98), rgba(5, 6, 8, .72) 60%, rgba(5, 6, 8, .2)),
    url("assets/zynex-hero.jpg") center 43% / cover;
  box-shadow: 0 22px 55px rgba(0, 0, 0, .25);
}
.client-welcome h1 {
  margin: 0;
  font-size: clamp(31px, 4.6vw, 50px);
  line-height: 1;
  letter-spacing: -2px;
}
.client-welcome h1 span { color: var(--client-cyan); }
.client-welcome > div > p:last-child { margin: 14px 0 0; color: #aeb7c4; }
.client-week-label {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(139, 98, 255, .32);
  border-radius: 5px;
  color: #d8ccff;
  background: rgba(139, 98, 255, .1);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.metric-grid { margin-top: 16px; }
.client-dashboard .metric-card {
  min-height: 155px;
  position: relative;
  border-color: var(--client-line);
  background: linear-gradient(145deg, rgba(23, 26, 32, .96), rgba(9, 10, 13, .98));
}
.metric-icon { position: absolute; top: 17px; right: 20px; color: var(--client-cyan); font-size: 27px; }
.metric-icon.violet { color: #bcaaff; }
.client-dashboard .metric-card h3 { color: #9da7b4; }
.client-dashboard .metric-card .big { margin: 15px 0 11px; font-size: 38px; letter-spacing: -1.5px; }
.client-dashboard .metric-card .big small { color: #8d97a4; font-size: 11px; letter-spacing: .5px; }
.metric-link {
  padding: 0;
  border: 0;
  color: var(--client-cyan);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.client-promos { margin-top: 34px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.catalog-explorer {
  margin-top: 34px;
  padding: 25px;
  border: 1px solid var(--client-line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(20, 24, 31, .97), rgba(7, 9, 12, .98));
}
.catalog-explorer-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.catalog-explorer-heading h2 { margin: 0; font-size: 25px; letter-spacing: -.7px; }
.catalog-explorer-heading p:last-child { margin: 8px 0 0; color: #909aa7; font-size: 13px; }
.catalog-explorer-heading > span { color: #697482; font-size: 10px; text-transform: uppercase; letter-spacing: .7px; }
.catalog-search { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-top: 20px; }
.catalog-search input {
  min-width: 0; height: 44px; padding: 0 14px; border: 1px solid rgba(177, 196, 218, .2);
  border-radius: 7px; outline: none; color: #f6f7f8; background: #0b0e13; font: inherit;
}
.catalog-search input:focus { border-color: var(--client-cyan); box-shadow: 0 0 0 3px rgba(39, 215, 238, .1); }
.catalog-search-hint { min-height: 17px; margin: 8px 0 0; color: #788391; font-size: 11px; }
.catalog-results { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.catalog-title-card { min-width: 0; overflow: hidden; border: 1px solid var(--client-line); border-radius: 9px; background: #0d1015; }
.catalog-poster { aspect-ratio: 2 / 3; overflow: hidden; background: #151922; }
.catalog-poster img { width: 100%; height: 100%; display: block; object-fit: cover; }
.catalog-poster-fallback { width: 100%; height: 100%; display: grid; place-items: center; background: radial-gradient(circle, #25313d, #101319 65%); }
.catalog-poster-fallback span { color: rgba(39, 215, 238, .4); font-size: 55px; font-weight: 900; }
.catalog-title-info { padding: 13px; }
.catalog-title-info > span { color: var(--client-cyan); font-size: 9px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.catalog-title-info h3 { min-height: 39px; margin: 6px 0 12px; font-size: 15px; line-height: 1.25; }
.catalog-availability-btn {
  width: 100%; padding: 8px; border: 1px solid rgba(139, 98, 255, .35); border-radius: 5px;
  color: #ddd5ff; background: rgba(139, 98, 255, .1); cursor: pointer; font-size: 10px; font-weight: 800;
}
.catalog-availability-btn:hover:not(:disabled) { background: rgba(139, 98, 255, .2); }
.catalog-availability-btn:focus-visible { outline: 3px solid rgba(39, 215, 238, .5); outline-offset: 2px; }
.catalog-availability-btn:disabled { cursor: default; opacity: .72; }
.catalog-source-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.catalog-source-chip { padding: 5px 6px; border-left: 2px solid var(--client-cyan); color: #d9e0e8; background: #171b22; font-size: 9px; }
.catalog-source-chip small { display: block; margin-top: 2px; color: #8994a1; font-size: 8px; }
.catalog-source-chip.access-rent { border-color: #f0a54b; }
.catalog-source-chip.access-buy { border-color: #c49cff; }
.catalog-source-chip.access-free { border-color: #55d68b; }
.catalog-source-message, .catalog-disclaimer { margin: 10px 0 0; color: #8994a1; font-size: 9px; line-height: 1.4; }
.catalog-source-error { color: #ff9f9f; }
.catalog-state { grid-column: 1 / -1; padding: 30px; border: 1px dashed var(--client-line); color: #8e99a7; text-align: center; }
.catalog-loading span { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border: 2px solid #33404d; border-top-color: var(--client-cyan); border-radius: 50%; animation: catalogSpin .7s linear infinite; }
.catalog-error { color: #ffaaaa; border-color: rgba(239, 68, 68, .3); }
@keyframes catalogSpin { to { transform: rotate(360deg); } }
.client-promo-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
}
.client-promo-heading h2 { margin: 0; font-size: 21px; letter-spacing: -.5px; }
.client-promo-heading > span {
  color: #687381;
  font-size: 10px;
  letter-spacing: .7px;
  text-transform: uppercase;
}
.client-promo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.client-promo {
  min-height: 205px;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--client-line);
  border-radius: 12px;
  background-position: center;
  background-size: cover;
  isolation: isolate;
}
.client-promo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(5, 6, 8, .97) 0%, rgba(5, 6, 8, .84) 47%, rgba(5, 6, 8, .14) 100%);
}
.promo-tires { background-image: url("assets/promo-llantas.jpg"); }
.promo-life { background-image: url("assets/promo-seguro-vida.jpg"); }
.client-promo-copy { width: 68%; padding: 24px; }
.client-promo-copy > span {
  color: var(--client-cyan);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.promo-life .client-promo-copy > span { color: #c6b7ff; }
.client-promo-copy h3 { margin: 6px 0 7px; font-size: 23px; letter-spacing: -.7px; }
.client-promo-copy p { margin: 0 0 16px; color: #aab3bf; font-size: 12px; line-height: 1.45; }
.promo-cta {
  padding: 8px 12px;
  border: 1px solid rgba(39, 215, 238, .35);
  border-radius: 6px;
  color: #dffcff;
  background: rgba(39, 215, 238, .12);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}
.promo-cta.violet {
  border-color: rgba(139, 98, 255, .4);
  color: #e0d8ff;
  background: rgba(139, 98, 255, .14);
}
.promo-cta:hover { filter: brightness(1.2); }
.promo-cta:focus-visible { outline: 3px solid rgba(39, 215, 238, .5); outline-offset: 3px; }
.client-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.client-section-heading h2 { margin: 0; font-size: 27px; letter-spacing: -.7px; }
.client-section-heading > p { margin: 0 0 3px; color: #818b99; font-size: 13px; }
.client-dashboard .section-kicker, .client-dashboard .eyebrow { color: var(--client-cyan); }
.client-dashboard .package-card { border-radius: 10px; }
.client-dashboard .package-buy { width: 100%; }
.client-service-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.client-service-card {
  min-height: 170px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 23px;
  border: 1px solid var(--client-line);
  border-radius: 12px;
  background:
    radial-gradient(circle at 90% 10%, rgba(39, 215, 238, .12), transparent 45%),
    linear-gradient(145deg, #161920, #0b0d11);
}
.client-service-card:nth-child(even) {
  background:
    radial-gradient(circle at 90% 10%, rgba(139, 98, 255, .14), transparent 45%),
    linear-gradient(145deg, #161920, #0b0d11);
}
.client-service-card h3 { margin: 4px 0 12px; font-size: 25px; letter-spacing: -1px; }
.client-service-card p { margin: 0; color: #909aa7; font-size: 12px; }
.service-overline { color: var(--client-cyan) !important; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.client-service-action { flex: 0 0 auto; text-align: right; }
.client-service-action strong { display: block; margin-bottom: 14px; color: var(--client-cyan); font-size: 22px; }
.client-service-action small { font-size: 10px; }
.client-dashboard .btn { background: var(--client-violet); border-radius: 7px; }
.client-dashboard .btn.secondary { background: #14171d; border-color: var(--client-line); }
.client-dashboard .btn:focus-visible, .metric-link:focus-visible {
  outline: 3px solid rgba(39, 215, 238, .5);
  outline-offset: 3px;
}
.client-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--client-line);
  border-radius: 10px;
  background: rgba(15, 17, 22, .82);
}
.client-table-wrap th, .client-table-wrap td { padding: 13px 14px; border-color: var(--client-line); }
.client-table-wrap tbody tr:hover { background: rgba(39, 215, 238, .025); }
@media (prefers-reduced-motion: reduce) {
  .client-dashboard * { animation: none !important; transition: none !important; }
}
@media (max-width: 720px) {
  .client-dashboard .client-topbar { padding: 0 14px; }
  .client-dashboard .client-topbar .muted { display: none; }
  .client-dashboard .client-tabs { padding: 8px 12px; }
  .client-main { padding: 18px 12px 42px; }
  .client-welcome { min-height: 260px; padding: 27px 23px; align-items: end; flex-direction: column; justify-content: end; }
  .client-week-label { align-self: flex-start; }
  .client-section-heading { align-items: start; flex-direction: column; gap: 5px; }
  .client-promo-grid { grid-template-columns: 1fr; }
  .client-service-grid { grid-template-columns: 1fr; }
  .catalog-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .client-dashboard .package-grid { grid-template-columns: 1fr 1fr; }
  .client-dashboard .package-card { padding: 15px 10px; }
  .client-service-card { align-items: stretch; flex-direction: column; }
  .client-service-action { display: flex; align-items: center; justify-content: space-between; text-align: left; }
  .client-service-action strong { margin: 0; }
  .client-promo-heading { align-items: start; flex-direction: column; gap: 4px; }
  .client-promo { min-height: 220px; align-items: end; }
  .client-promo::after { background: linear-gradient(0deg, rgba(5, 6, 8, .98), rgba(5, 6, 8, .73) 70%, rgba(5, 6, 8, .15)); }
  .client-promo-copy { width: 100%; padding: 20px; }
  .catalog-explorer { padding: 18px 14px; }
  .catalog-explorer-heading { align-items: start; flex-direction: column; gap: 5px; }
  .catalog-search { grid-template-columns: 1fr; }
}


/* --- Enlace de gestión por perfil y edición de cuentas --- */
.manage-link { color: var(--accent, #6aa9ff); text-decoration: none; font-size: 12px; word-break: break-all; }
.manage-link:hover { text-decoration: underline; }
a.btn { display: inline-block; text-decoration: none; text-align: center; line-height: normal; }
.field-hint { display: block; margin: -4px 0 10px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.over-limit { color: var(--danger, #e5484d); }
.account-profiles td .manage-link { max-width: 260px; display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

.cargo { display: inline-flex; flex-direction: column; line-height: 1.25; }
.cargo b { font-size: 13px; }
.cargo small { color: var(--muted); font-size: 11px; }
.cargo.cargo-pronto b { color: var(--danger, #e5484d); }
.cargo.cargo-pronto small { color: var(--danger, #e5484d); }
