/* ═══════════════════════════════════════════════════════════
   ReplicatorNT — panel web (tema oscuro, acento sky→teal)
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #06090f;
  --bg-soft: #0a1018;
  --card: #0e1520;
  --card-2: #121b28;
  --text: #e8eef7;
  --muted: #8b9bb4;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.26);
  --accent: #0ea5e9;
  --accent-2: #2dd4bf;
  --accent-rgb: 14, 165, 233;
  --accent2-rgb: 45, 212, 191;
  --grad: linear-gradient(135deg, #0ea5e9 0%, #14b8a6 100%);
  --error: #f87171;
  --ok: #34d399;
  --warn: #fbbf24;
  --violet: #5eead4;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  --font: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-display: "Manrope", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1000px 560px at 90% -8%, rgba(var(--accent-rgb), 0.14), transparent 58%),
    radial-gradient(780px 420px at -8% 35%, rgba(var(--accent2-rgb), 0.09), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.015) 0%, transparent 18%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 20%, transparent 75%);
}

#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

.hidden { display: none !important; }
.error { color: var(--error); font-size: 0.9rem; }
.hint { color: var(--muted); font-size: 0.9rem; }
.hint.tiny { font-size: 0.78rem; }
.hint code { font-family: var(--mono); font-size: 0.85em; color: var(--accent-2); }

::selection { background: rgba(var(--accent-rgb), 0.35); }

/* ── Marca ─────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 0.65rem; }
.brand-mark { display: inline-flex; filter: drop-shadow(0 6px 18px rgba(var(--accent-rgb), 0.4)); }
.brand-name {
  font-family: var(--font);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.brand-accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-lg .brand-name { font-size: clamp(1.55rem, 3vw, 1.9rem); }
.brand-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.brand-link:hover { opacity: 0.92; }

.text-gradient { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background:
    linear-gradient(165deg, rgba(var(--accent-rgb), 0.06), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 45%),
    var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.4rem; }
.card-icon { margin-right: 0.35rem; }

.pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  white-space: nowrap;
}
.pill-warn { color: var(--warn); border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.08); }

/* ── Formularios ───────────────────────────────────────── */
label { display: block; margin-bottom: 0.9rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: rgba(147, 160, 184, 0.5); }
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.22);
}

button {
  font-family: var(--font);
  background: var(--grad);
  color: #041018;
  border: none;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  transition: transform 0.12s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 4px 18px rgba(var(--accent-rgb), 0.28);
}
button:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.4); }
button:active { transform: translateY(0); }
button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-block { width: 100%; padding: 0.8rem; font-size: 0.95rem; margin-top: 0.25rem; }

.btn-secondary {
  background: var(--card-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  box-shadow: none;
  font-weight: 600;
}
.btn-secondary:hover { background: #182433; box-shadow: none; border-color: var(--accent); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  box-shadow: none;
  font-weight: 600;
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent); box-shadow: none; }

.btn-danger { background: rgba(248, 113, 113, 0.12); color: var(--error); border: 1px solid rgba(248, 113, 113, 0.35); box-shadow: none; }
.btn-danger:hover { background: rgba(248, 113, 113, 0.22); box-shadow: none; }

/* ══════════ PANTALLA DE ACCESO ══════════ */
.auth-shell {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 440px);
  gap: 3.5rem;
  align-items: center;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 3.5rem 2rem 2rem;
  min-height: min(100vh, 820px);
}

.auth-hero .brand { margin-bottom: 1.75rem; animation: fadeUp 0.55s ease both; }

.hero-title {
  font-family: var(--font);
  font-size: clamp(2rem, 4vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0 0 1rem;
  max-width: 18ch;
  animation: fadeUp 0.55s ease 0.06s both;
}
.hero-sub {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 32rem;
  margin: 0 0 1.4rem;
  animation: fadeUp 0.55s ease 0.12s both;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  animation: fadeUp 0.55s ease 0.18s both;
}
.hero-trust span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(14, 21, 32, 0.65);
}

.hero-visual { animation: fadeUp 0.55s ease 0.24s both; }
.hero-terminal {
  max-width: 420px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #0a121c, #070b12);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.hero-terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.hero-terminal-bar span {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--border-strong);
}
.hero-terminal-bar span:nth-child(1) { background: #f87171; }
.hero-terminal-bar span:nth-child(2) { background: #fbbf24; }
.hero-terminal-bar span:nth-child(3) { background: #34d399; }
.hero-terminal-bar em {
  margin-left: 0.5rem;
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
}
.hero-terminal-body {
  margin: 0;
  padding: 1rem 1.1rem 1.15rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.7;
  color: #c5d0e0;
}
.ht-ok { color: var(--ok); }
.ht-accent { color: var(--accent-2); }
.ht-dim { color: var(--muted); }

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

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

.auth-card {
  padding: 2rem;
  animation: fadeUp 0.55s ease 0.1s both;
}
.auth-card h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}
.auth-hint { margin: 0 0 1.25rem; }
.auth-note { text-align: center; margin: 0.85rem 0 0; }

.tabs { display: flex; gap: 0.5rem; margin-bottom: 1.4rem; background: var(--bg-soft); padding: 0.3rem; border-radius: 12px; border: 1px solid var(--border); }
.tabs button {
  flex: 1;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  padding: 0.55rem;
  font-weight: 600;
}
.tabs button:hover { transform: none; color: var(--text); }
.tabs button.active {
  background: var(--grad);
  color: #041018;
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.3);
}

/* Tabs del panel de control */
.dash-tabs {
  position: sticky;
  top: 64px;
  z-index: 15;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: rgba(6, 9, 15, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.dash-tabs::-webkit-scrollbar { display: none; }
.dash-tabs button {
  flex: 1 0 auto;
  white-space: nowrap;
  min-width: 0;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
}
.dash-tab { animation: dashTabIn 0.22s ease; }
@keyframes dashTabIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.steps-strip li[data-goto-tab] {
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.steps-strip li[data-goto-tab]:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}
.steps-strip li[data-goto-tab]:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.7);
  outline-offset: 2px;
}

/* ══════════ TOPBAR + PÁGINA ══════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: rgba(6, 9, 15, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.page { max-width: 1200px; width: 100%; margin: 0 auto; padding: 2rem; }
.page-eyebrow,
.landing-eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.page-head h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.25rem;
}
.page-head { margin-bottom: 1.5rem; }
.landing-section .landing-eyebrow { text-align: center; }

/* Pasos 1-2-3 */
.steps-strip {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}
.steps-strip li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}
.step-n {
  flex: none;
  width: 2.1rem; height: 2.1rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--grad);
  font-weight: 800;
  font-size: 0.95rem;
}
.steps-strip strong { display: block; font-size: 0.88rem; letter-spacing: -0.01em; }
.steps-strip div span { color: var(--muted); font-size: 0.76rem; }

/* Grid del dashboard */
.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.1rem; }
.span-12 { grid-column: span 12; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }

/* API key */
#api-key-display {
  display: block;
  word-break: break-all;
  padding: 0.9rem 1rem;
  background: var(--bg-soft);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  margin: 0.85rem 0;
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--accent-2);
}

.ws-hint {
  font-family: var(--mono);
  font-size: 0.72rem;
  overflow-x: auto;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
}

/* ── Tienda de licencias ───────────────────────────────── */
.license-store {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.1rem;
}
.license-product-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem;
  background: var(--card-2);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.2s;
}
.license-product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}
.license-product-card.featured { border-color: rgba(var(--accent-rgb), 0.55); }
/* Badge configurable desde el panel admin (texto libre por producto) */
.card-badge {
  position: absolute;
  top: -0.7rem;
  right: 1rem;
  max-width: calc(100% - 2rem);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-icon {
  width: 2.7rem; height: 2.7rem;
  display: grid; place-items: center;
  font-size: 1.3rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.8rem;
}
.license-product-card h4 { margin: 0 0 0.3rem; font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; }
.license-product-card .product-desc { font-size: 0.82rem; color: var(--muted); margin: 0 0 1rem; min-height: 2.5em; }
.license-product-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.license-product-actions button { flex: 1; min-width: 7rem; font-size: 0.83rem; padding: 0.55rem 0.6rem; }
.btn-trial { background: rgba(52, 211, 153, 0.13); color: var(--ok); border: 1px solid rgba(52, 211, 153, 0.35); box-shadow: none; }
.btn-trial:hover:not(:disabled) { background: rgba(52, 211, 153, 0.24); box-shadow: none; }
.btn-buy { background: var(--grad); }
.license-trial-used { font-size: 0.75rem; color: var(--muted); margin: 0.6rem 0 0; }

.license-list-title { margin: 1.6rem 0 0.6rem; font-size: 0.8rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

#license-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.license-item {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-2);
}
.license-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.license-head strong { font-size: 0.95rem; letter-spacing: -0.01em; }
.license-key {
  display: block;
  word-break: break-all;
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 0.6rem 0.8rem;
  background: var(--bg-soft);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  margin: 0.45rem 0;
  color: var(--violet);
}
.license-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
}
.license-badge.ok { color: var(--ok); border-color: rgba(52, 211, 153, 0.45); background: rgba(52, 211, 153, 0.08); }
.license-badge.revoked { color: var(--error); border-color: rgba(248, 113, 113, 0.45); background: rgba(248, 113, 113, 0.08); }
.license-badge.expired { color: var(--warn); border-color: rgba(251, 191, 36, 0.45); background: rgba(251, 191, 36, 0.08); }
.license-expired-note { color: var(--warn); margin-top: 0.3rem; }

.activation-list {
  list-style: none;
  padding: 0.7rem 0 0 1rem;
  margin: 0.6rem 0 0;
  border-left: 2px solid var(--border-strong);
}
.activation-item { margin-bottom: 0.7rem; font-size: 0.88rem; }
.activation-item .hint { font-family: var(--mono); font-size: 0.74rem; }

/* ── Canales ───────────────────────────────────────────── */
.inline-form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: stretch; margin-top: 1rem; }
.inline-form input { flex: 1; min-width: 160px; margin: 0; }
.inline-form button { white-space: nowrap; }

#channel-list { list-style: none; padding: 0; margin: 1.1rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.8rem; }
.channel-item {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-2);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.channel-item:hover { transform: translateY(-2px); border-color: rgba(34, 211, 238, 0.5); }
.channel-item strong { font-size: 0.95rem; letter-spacing: -0.01em; }
#channel-list .ch-id {
  font-family: var(--mono);
  color: var(--accent-2);
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 0.15rem;
}
.channel-item .channel-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
.channel-actions button { font-size: 0.8rem; padding: 0.45rem 0.8rem; }
.channel-item .btn-log-live { background: rgba(34, 211, 238, 0.13); color: var(--accent-2); border: 1px solid rgba(34, 211, 238, 0.4); box-shadow: none; }
.channel-item .btn-log-live:hover { background: rgba(34, 211, 238, 0.24); box-shadow: none; }

/* ══════════ LOG EN VIVO ══════════ */
#channel-log-panel .page { max-width: 1300px; }

.log-header { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; justify-content: space-between; margin-bottom: 1rem; }
.log-title-wrap h2 { margin: 0; font-size: 1.15rem; }
.log-title-wrap .hint { margin: 0.1rem 0 0; font-family: var(--mono); font-size: 0.78rem; }
.log-status {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  color: var(--muted);
}
.log-status.live { color: var(--ok); border-color: rgba(52, 211, 153, 0.5); }
.log-status.live::before { content: "●"; margin-right: 0.4rem; animation: pulse 1.6s infinite; }
.log-status.paused { color: var(--warn); border-color: rgba(251, 191, 36, 0.5); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.log-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 0.9rem 1.5rem; margin-bottom: 1rem; }
.inline-check { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 0.85rem; }
.inline-check input { width: auto; margin: 0; accent-color: var(--accent); }

.log-console-wrap { padding: 0; overflow: hidden; }
.console-chrome {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  background: var(--card-2);
  border-bottom: 1px solid var(--border);
}
.console-chrome span { width: 0.72rem; height: 0.72rem; border-radius: 50%; background: var(--border-strong); }
.console-chrome span:nth-child(1) { background: #f87171; }
.console-chrome span:nth-child(2) { background: #fbbf24; }
.console-chrome span:nth-child(3) { background: #34d399; }
.console-chrome em { margin-left: 0.6rem; font-style: normal; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }

.log-console {
  margin: 0;
  padding: 1.1rem 1.2rem;
  min-height: 460px;
  max-height: 70vh;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  background: #07090f;
  color: #c9d1d9;
  white-space: pre-wrap;
  word-break: break-word;
}
.log-line-master { color: #79c0ff; }
.log-line-slave { color: #7ee787; }
.log-line-server { color: #d2a8ff; }
.log-line-system { color: #8b949e; }
.log-line-error { color: #ff7b72; }
.log-line-relay { color: #ffa657; }

/* ── Precios de producto ───────────────────────────────── */
.product-price { display: flex; align-items: baseline; gap: 0.5rem; margin: 0 0 1rem; flex-wrap: wrap; }
.price-now { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: 0.95rem; }
.price-period { color: var(--muted); font-size: 0.78rem; }
.offer-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
}
.product-included { font-size: 0.76rem; color: var(--muted); margin: -0.4rem 0 1rem; }
.btn-renew-lic { background: rgba(52, 211, 153, 0.13); color: var(--ok); border: 1px solid rgba(52, 211, 153, 0.35); box-shadow: none; }
.btn-renew-lic:hover { background: rgba(52, 211, 153, 0.24); box-shadow: none; }
.btn-manage-sub { background: rgba(var(--accent-rgb), 0.12); color: #7dd3fc; border: 1px solid rgba(var(--accent-rgb), 0.4); box-shadow: none; }
.btn-manage-sub:hover { background: rgba(var(--accent-rgb), 0.22); box-shadow: none; }

/* ── Administración ────────────────────────────────────── */
.admin-tabs { margin: 1rem 0 1.2rem; max-width: 640px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; min-width: 720px; }
.admin-table th {
  text-align: left;
  padding: 0.7rem 0.9rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  background: var(--card-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td { padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table code { font-family: var(--mono); font-size: 0.76rem; color: var(--accent-2); }

/* ── Tabla comparativa (landing) ── */
.comparison-table-wrap { max-width: 920px; margin: 2rem auto 0; }
.comparison-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; text-align: center; }
.comparison-table thead th { background: var(--card-bg); padding: 1rem 0.7rem; border-bottom: 2px solid var(--border); font-weight: 700; }
.comparison-table thead th:first-child { text-align: left; padding-left: 1rem; }
.comparison-table .comp-prod { color: var(--accent-2); }
.comparison-table .comp-highlight { background: rgba(var(--accent-rgb), 0.08); }
.comparison-table thead .comp-highlight { border-radius: var(--radius-sm) var(--radius-sm) 0 0; color: var(--accent-2); }
.comparison-table tbody td { padding: 0.7rem 0.7rem; border-bottom: 1px solid var(--border); }
.comparison-table tbody td:first-child { text-align: left; padding-left: 1rem; font-weight: 500; color: var(--muted); }
.comparison-table tbody tr:last-child td { border-bottom: none; }
.comparison-table .product-icon { font-size: 1.2rem; display: block; margin-bottom: 3px; }
.row-blocked td { opacity: 0.55; }
.admin-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.btn-xs { font-size: 0.72rem; padding: 0.32rem 0.6rem; }
.input-xs {
  width: 6.5rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  margin: 0;
  display: inline-block;
}
.admin-lics-row td { background: var(--bg-soft); }
.admin-lic-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--border);
}
.admin-lic-info { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.admin-lic-info code { font-family: var(--mono); font-size: 0.72rem; color: var(--violet); word-break: break-all; }
.admin-lic-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.admin-add-lic { margin-top: 0.9rem; }
.admin-add-lic select,
#offer-form select {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
}
.admin-tab > .inline-form { margin-bottom: 0.9rem; }

/* ── Topbar acciones ───────────────────────────────────── */
.topbar-actions { display: flex; gap: 0.6rem; align-items: center; }

/* ── Landing pública ───────────────────────────────────── */
.landing { max-width: 1200px; margin: 0 auto; padding: 0 2rem 4rem; }
.landing-section { margin-top: 5rem; }
.landing-title {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
  margin: 0 0 0.45rem;
}
.landing-sub { color: var(--muted); text-align: center; margin: 0 auto 2.1rem; max-width: 38rem; }

.landing-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.landing-step {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 50%), var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: border-color 0.2s, transform 0.2s;
}
.landing-step:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  transform: translateY(-2px);
}
.landing-step h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0.8rem 0 0.35rem;
  letter-spacing: -0.02em;
}
.landing-step p { color: var(--muted); font-size: 0.83rem; margin: 0; line-height: 1.5; }

.landing-pricing { margin-top: 0; }
.plan-perks { list-style: none; padding: 0; margin: 0 0 1rem; }
.plan-perks li { font-size: 0.8rem; color: var(--muted); padding: 0.22rem 0; }
.landing-note { text-align: center; margin-top: 1.4rem; max-width: 46rem; margin-left: auto; margin-right: auto; }

.landing-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.landing-feat {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 45%), var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  transition: border-color 0.2s, transform 0.2s;
}
.landing-feat:hover {
  border-color: rgba(var(--accent2-rgb), 0.35);
  transform: translateY(-2px);
}
.landing-feat .feat-mark {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.15rem;
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
}
.landing-feat h3 {
  font-family: var(--font-display);
  font-size: 0.98rem;
  margin: 0.75rem 0 0.3rem;
  letter-spacing: -0.02em;
}
.landing-feat p { color: var(--muted); font-size: 0.82rem; margin: 0; line-height: 1.5; }

.landing-faq { max-width: 720px; margin-left: auto; margin-right: auto; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin-bottom: 0.65rem;
  background: rgba(14, 21, 32, 0.55);
}
.faq-item h3 { font-size: 0.95rem; margin: 0 0 0.35rem; }
.faq-item p { color: var(--muted); font-size: 0.86rem; margin: 0; }

.landing-cta {
  margin-top: 5rem;
  text-align: center;
  padding: 3rem 1.5rem;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  background:
    radial-gradient(600px 200px at 50% 0%, rgba(var(--accent-rgb), 0.18), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 60%),
    var(--card);
}
.landing-cta .landing-eyebrow { margin-bottom: 0.6rem; }
.landing-cta h2 {
  font-family: var(--font-display);
  margin: 0 0 0.35rem;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  letter-spacing: -0.03em;
}
.landing-cta button { margin-top: 1.35rem; padding: 0.9rem 2.4rem; font-size: 1rem; }

/* ── Canales públicos ──────────────────────────────────── */
#public-channel-list { list-style: none; padding: 0; margin: 1.1rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.8rem; }
.public-channel { cursor: default; }
.public-channel:hover { transform: none; border-color: var(--border); }

/* ── Footer ────────────────────────────────────────────── */
.footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 2rem 1rem 1.6rem;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}

/* ── Scrollbars ────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.45); }

/* ── Suscripciones / historial de pagos ─────────────────── */
.subscription-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  transition: border-color 0.2s;
}
.subscription-row:hover { border-color: var(--accent); }
.sub-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}
.sub-icon { font-size: 1.5rem; flex-shrink: 0; }
.sub-info strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.sub-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
  word-break: break-word;
}
.sub-meta code {
  font-family: var(--mono);
  font-size: 0.72rem;
  background: var(--card);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.subscription-row .btn-manage-sub {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Tabla historial de pagos ───────────────────────────── */
.payments-table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.payments-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  min-width: 860px;
}
.payments-table th,
.payments-table td {
  padding: 0.7rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.payments-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  background: var(--card-2);
  white-space: nowrap;
}
.payments-table tbody tr:last-child td { border-bottom: none; }
.payments-table tbody tr:hover td { background: rgba(var(--accent-rgb), 0.04); }
.payments-table .pay-id {
  font-size: 0.72rem;
  font-family: var(--mono);
  word-break: break-all;
}
.pay-chip {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  white-space: nowrap;
}
.pay-kind-sub { background: rgba(14, 165, 233, 0.14); color: #38bdf8; }
.pay-kind-pay { background: rgba(20, 184, 166, 0.14); color: #2dd4bf; }
.pay-st-active { background: rgba(52, 211, 153, 0.14); color: var(--ok); }
.pay-st-expired { background: rgba(148, 163, 184, 0.14); color: var(--muted); }
.pay-st-pending { background: rgba(251, 191, 36, 0.16); color: #fbbf24; }
.pay-st-failed { background: rgba(248, 113, 113, 0.14); color: var(--error); }
.pay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.pay-actions .btn-secondary,
.pay-actions .btn-danger {
  font-size: 0.75rem;
  padding: 0.35rem 0.55rem;
}

.notify-admin-grid {
  display: grid;
  gap: 1.25rem;
}
.notify-admin-block {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-2);
}
.notify-admin-block h3 { margin: 0 0 0.75rem; font-size: 1rem; }
.notify-admin-block label { display: block; margin-bottom: 0.55rem; font-size: 0.85rem; }
.notify-admin-block input[type="text"],
.notify-admin-block input[type="email"],
.notify-admin-block input[type="password"],
.notify-admin-block input[type="number"],
.notify-admin-block textarea {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.notify-prefs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.notify-sub { margin: 0 0 0.5rem; font-size: 0.9rem; }
@media (max-width: 720px) {
  .form-grid-2, .notify-prefs-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .payments-table { min-width: 0; }
  .payments-table thead { display: none; }
  .payments-table,
  .payments-table tbody,
  .payments-table tr,
  .payments-table td { display: block; width: 100%; }
  .payments-table tr {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
  }
  .payments-table td {
    border: none;
    padding: 0.25rem 0;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .payments-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    flex-shrink: 0;
  }
  .pay-actions { justify-content: flex-end; }
}

/* ── Productos: lista + página de configuración (admin) ── */
.admin-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.admin-toolbar h3 { margin: 0 0 0.15rem; font-size: 1.05rem; font-weight: 700; }
.admin-toolbar .hint { margin: 0; }
.admin-toolbar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.prod-list { display: flex; flex-direction: column; gap: 0.6rem; }
.prod-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-2);
  transition: border-color 0.15s, background 0.15s;
}
.prod-row:hover { border-color: rgba(var(--accent-rgb), 0.4); }
.prod-row.is-disabled { opacity: 0.6; }
.prod-main { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.prod-icon {
  width: 2.4rem; height: 2.4rem; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.15rem;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px;
}
.prod-info { min-width: 0; }
.prod-name { font-weight: 700; font-size: 0.92rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.prod-meta { font-size: 0.74rem; color: var(--muted); margin-top: 0.15rem; }
.prod-meta code { font-size: 0.72rem; }
.prod-price { font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.prod-price .prod-per { font-weight: 400; font-size: 0.72rem; color: var(--muted); }
.prod-status { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15); }
.status-dot.off { background: #6b7280; }
.prod-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
.tag {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.12rem 0.42rem; border-radius: 999px;
}
.tag-core { background: rgba(148, 163, 184, 0.18); color: var(--muted); }
.tag-offer { background: rgba(52, 211, 153, 0.16); color: var(--ok); }

/* Página de configuración */
.cfg-card { padding: 0; overflow: hidden; }
.cfg-section { padding: 1.2rem 1.3rem; border-bottom: 1px solid var(--border); }
.cfg-section:last-of-type { border-bottom: none; }
.cfg-section h3 { margin: 0 0 0.9rem; font-size: 0.9rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.cfg-actions {
  display: flex; justify-content: flex-end; gap: 0.6rem;
  padding: 1rem 1.3rem; background: var(--bg-soft); border-top: 1px solid var(--border);
}
.cfg-label { display: block; font-size: 0.76rem; color: var(--muted); font-weight: 600; margin-bottom: 0.4rem; }
.pe-check-group { display: flex; flex-direction: column; }
.pe-check-group .pe-check { display: inline-flex; margin-right: 1rem; }

.admin-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-2);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
}
.admin-block h3 { margin: 0 0 0.4rem; font-size: 0.98rem; font-weight: 700; }
.field-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}
.field-grid label {
  display: flex; flex-direction: column; gap: 0.28rem;
  font-size: 0.76rem; color: var(--muted); font-weight: 600;
}
.field-grid label.col-2 { grid-column: span 2; }
.field-grid label.col-3 { grid-column: 1 / -1; }
.field-grid label.pe-check {
  flex-direction: row; align-items: center; gap: 0.4rem;
  align-self: end; padding: 0.4rem 0;
}
.field-grid label.pe-check input { width: auto; }
.field-grid input,
.field-grid textarea {
  width: 100%;
  font-size: 0.85rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  resize: vertical;
}
.field-grid input:focus,
.field-grid textarea:focus { outline: none; border-color: rgba(var(--accent-rgb), 0.6); }

/* ── Responsive ────────────────────────────────────────── */

/* Tablet — ≤960px */
@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; gap: 2.5rem; padding: 2.5rem 1.25rem; }
  .hero-title { max-width: none; }
  .hero-terminal { max-width: 100%; }
  .landing { padding: 0 1.25rem 2.5rem; }
  .landing-steps { grid-template-columns: 1fr 1fr; }
  .landing-features { grid-template-columns: 1fr 1fr; }
  .auth-hero { text-align: left; }
  .span-7, .span-5 { grid-column: span 12; }
  .steps-strip { grid-template-columns: 1fr; }
  .dash-tabs { top: 56px; }
  .dash-tabs button { font-size: 0.82rem; padding: 0.55rem 0.75rem; }
  .page { padding: 1.25rem; }
  .topbar { padding: 0.7rem 1.25rem; }
  .topbar .brand-name { font-size: 1rem; }
  .topbar-actions { gap: 0.35rem; }
  .topbar-actions button { font-size: 0.8rem; padding: 0.45rem 0.7rem; }
}

/* Teléfono grande — ≤720px */
@media (max-width: 720px) {
  .topbar { padding: 0.6rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  .topbar .brand { gap: 0.4rem; }
  .topbar .brand-name { font-size: 0.95rem; }
  .topbar .brand-mark svg { width: 24px; height: 24px; }
  .topbar-actions { gap: 0.3rem; }
  .topbar-actions button { font-size: 0.76rem; padding: 0.4rem 0.6rem; border-radius: 8px; }
  .license-store { grid-template-columns: 1fr 1fr; }
  #channel-list { grid-template-columns: 1fr; }
  #public-channel-list { grid-template-columns: 1fr; }
  #license-list { grid-template-columns: 1fr; }
  .page { padding: 1rem; }
  .page-head h1 { font-size: 1.35rem; }
  .dash-grid { gap: 0.8rem; }
  .steps-strip li { padding: 0.7rem 0.9rem; }
  .steps-strip strong { font-size: 0.82rem; }
  .steps-strip .step-n { width: 30px; height: 30px; font-size: 0.8rem; }
  .inline-form { flex-direction: column; }
  .inline-form input { flex: none; min-width: 0; }
  .inline-form button { width: 100%; }
  .subscription-row { flex-direction: column; align-items: flex-start; }
  .subscription-row .btn-manage-sub { align-self: flex-end; }
  .channel-item .channel-actions { flex-direction: column; }
  .channel-item .channel-actions button { width: 100%; }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .field-grid label.col-2 { grid-column: 1 / -1; }
  /* Lista de productos: apilar en móvil */
  .prod-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "main price" "status status" "actions actions";
    row-gap: 0.6rem;
  }
  .prod-main { grid-area: main; }
  .prod-price { grid-area: price; text-align: right; }
  .prod-status { grid-area: status; }
  .prod-actions { grid-area: actions; justify-content: flex-start; }
  .prod-actions button { flex: 1; }
  .admin-toolbar { flex-direction: column; align-items: stretch; }
  .admin-toolbar-actions button { flex: 1; }
  .cfg-actions { flex-direction: column-reverse; }
  .cfg-actions button { width: 100%; }
}

/* Teléfono pequeño — ≤480px */
@media (max-width: 480px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 0.8rem;
    gap: 0.5rem;
  }
  .topbar .brand {
    justify-content: center;
  }
  .topbar .brand-name { font-size: 0.85rem; }
  .topbar .brand-mark svg { width: 22px; height: 22px; }
  .topbar-actions {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .topbar-actions button {
    font-size: 0.72rem;
    padding: 0.4rem 0.55rem;
    flex: 0 1 auto;
  }
  .dash-tabs {
    top: auto;
    position: relative;
    gap: 0.25rem;
    padding: 0.25rem;
  }
  .dash-tabs button {
    flex: 1 1 calc(50% - 0.25rem);
    font-size: 0.78rem;
    padding: 0.5rem 0.4rem;
  }
  .hero-title { font-size: 1.5rem; }
  .hero-sub { font-size: 0.9rem; }
  .hero-trust { gap: 0.4rem; }
  .hero-terminal { max-width: 100%; }
  .license-store { grid-template-columns: 1fr; }
  .license-product-card { padding: 1rem; }
  .license-product-card h4 { font-size: 0.95rem; }
  .landing-steps { grid-template-columns: 1fr; }
  .landing-features { grid-template-columns: 1fr; }
  .landing-title { font-size: 1.25rem; }
  .card { padding: 1rem; }
  .card-head h2 { font-size: 0.95rem; }
  .log-header { flex-direction: column; align-items: flex-start; }
  .log-header > * { width: 100%; }
  .log-title-wrap h2 { font-size: 1rem; }
  .auth-card { padding: 1.25rem; }
  .auth-card h2 { font-size: 1.1rem; }
  .tabs button { font-size: 0.8rem; padding: 0.5rem 0.8rem; }
  .admin-tabs { gap: 0.3rem; }
  .admin-tabs button { font-size: 0.72rem; padding: 0.45rem 0.6rem; }
  .admin-table { font-size: 0.75rem; }
  .subscription-row { padding: 0.7rem 0.8rem; }
  .sub-info strong { font-size: 0.85rem; }
  .sub-meta { font-size: 0.72rem; }
  .btn-block { font-size: 0.85rem; padding: 0.65rem; }
  #api-key-display { font-size: 0.72rem; padding: 0.5rem 0.7rem; }
  .ws-hint { font-size: 0.68rem; padding: 0.5rem 0.7rem; }
  .pill { font-size: 0.68rem; padding: 0.2rem 0.5rem; }
  .publish-pricing-grid { grid-template-columns: 1fr; }
  .finance-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Publicar canal (copy trading) ─────────────────────── */
.publish-form { max-width: 720px; }
.publish-section {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.publish-section:last-of-type { border-bottom: none; margin-bottom: 1rem; }
.publish-section h3 {
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
}
.publish-form label { margin-bottom: 1rem; }
.publish-form textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}
.publish-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.22);
}
.publish-id-row { margin-top: 0.35rem; }
.publish-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-top: 0.75rem;
}
.publish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}
.publish-id-ok { color: var(--ok) !important; }
.publish-id-bad { color: var(--error) !important; }
.channel-pricing-summary {
  color: var(--accent-2) !important;
  font-weight: 600;
}

/* ── Finanzas admin ────────────────────────────────────── */
.finance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}
.finance-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.finance-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.finance-value {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

@media (max-width: 720px) {
  .finance-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   Directorio de canales públicos (copy trading)
   ═══════════════════════════════════════════════════════════ */

.pnl-up { color: var(--ok); }
.pnl-down { color: var(--error); }

.pub-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin: 1rem 0 0.4rem;
}
.pub-search {
  flex: 1;
  min-width: 200px;
  margin: 0;
  padding: 0.6rem 0.85rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
}
.pub-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2); }
.pub-filter-group { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.pub-filter-group button {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
}
.pub-filter-group button.active { background: var(--grad); color: #04121b; }
.pub-sort-label { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--muted); }
.pub-sort-label select {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem;
  font-family: var(--font);
  font-size: 0.85rem;
}

.pub-grid {
  list-style: none;
  padding: 0;
  margin: 1.1rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.pub-card {
  background: linear-gradient(168deg, rgba(var(--accent-rgb), 0.05), transparent 46%), var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1rem;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.pub-card:hover { transform: translateY(-3px); border-color: rgba(var(--accent-rgb), 0.5); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); }
.pub-card-top { display: flex; align-items: center; gap: 0.7rem; }
.pub-avatar {
  width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.95rem; letter-spacing: -0.02em;
  color: #04121b;
  background: var(--grad);
}
.pub-avatar.lg { width: 56px; height: 56px; flex-basis: 56px; font-size: 1.2rem; border-radius: 16px; }
.pub-id-wrap { flex: 1; min-width: 0; }
.pub-name { margin: 0; font-size: 1.02rem; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-owner { font-size: 0.78rem; color: var(--muted); }
.pub-live {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  padding: 0.2rem 0.55rem; border-radius: 999px;
  white-space: nowrap;
}
.pub-live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pub-live.on { color: var(--ok); border-color: rgba(52, 211, 153, 0.5); background: rgba(52, 211, 153, 0.08); }
.pub-live.on .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25); animation: livePulse 1.8s infinite; }
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.pub-card-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.6rem; }
.pub-roi { display: flex; flex-direction: column; }
.pub-roi-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.pub-roi-value { font-size: 1.85rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.pub-spark { width: 132px; height: 40px; }
.spark { display: block; overflow: visible; }

.pub-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 0.6rem 0; }
.pub-stat { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.pub-stat span { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
.pub-stat strong { font-size: 0.92rem; font-weight: 700; letter-spacing: -0.01em; }

.pub-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.pub-chips-empty { color: var(--muted); font-size: 0.78rem; }
.instr-chip {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  color: var(--accent-2);
  background: rgba(var(--accent2-rgb), 0.1);
  border: 1px solid rgba(var(--accent2-rgb), 0.28);
  padding: 0.14rem 0.5rem; border-radius: 6px;
}
.pub-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: auto; }
.pub-followers { font-size: 0.76rem; color: var(--muted); }
.pub-followers-n { color: var(--text); font-weight: 700; }
.pub-card-foot button { font-size: 0.8rem; padding: 0.5rem 0.9rem; white-space: nowrap; }
.btn-copy-card { background: rgba(52, 211, 153, 0.13); color: var(--ok); border: 1px solid rgba(52, 211, 153, 0.4); box-shadow: none; }
.btn-copy-card:hover { background: rgba(52, 211, 153, 0.22); box-shadow: none; }

/* ── Ficha del canal ─────────────────────────────────────── */
#channel-profile-page .page { max-width: 1200px; }
.profile-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 1rem; }
.profile-summary { grid-column: 1 / -1; }
.profile-summary-head { display: flex; align-items: center; gap: 0.9rem; }
.profile-summary-head h2 { margin: 0; font-size: 1.3rem; letter-spacing: -0.02em; }
.profile-desc { margin: 0.6rem 0 0; }
.profile-window-tabs { display: inline-flex; gap: 2px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; padding: 3px; margin: 0.9rem 0; }
.profile-window-tabs button { border: none; background: transparent; color: var(--muted); font-weight: 700; font-size: 0.8rem; padding: 0.35rem 0.95rem; border-radius: 999px; cursor: pointer; box-shadow: none; }
.profile-window-tabs button.active { background: var(--grad); color: #04121b; }
.profile-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.7rem; }
.kpi { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.7rem 0.85rem; display: flex; flex-direction: column; gap: 0.15rem; }
.kpi span { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
.kpi strong { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; }
.kpi.big { grid-column: span 2; }
.kpi.big strong { font-size: 1.6rem; }
.profile-allnote { margin-top: 0.75rem; }
.profile-banner { margin-top: 0.85rem; padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); font-size: 0.85rem; background: var(--bg-soft); border: 1px solid var(--border); color: var(--muted); }
.profile-banner.ok { color: var(--ok); border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.07); }
.profile-banner.owner { color: var(--accent-2); border-color: rgba(var(--accent2-rgb), 0.4); background: rgba(var(--accent2-rgb), 0.07); }
.profile-cta-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.9rem; }
.profile-cta-row button { font-size: 0.85rem; }

.curve { display: block; width: 100%; }
.profile-curve-card, .profile-journal-card { grid-column: 1 / -1; }

.donut-wrap { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.donut { flex: 0 0 auto; }
.donut-center-n { fill: var(--text); font-size: 1.3rem; font-weight: 800; font-family: var(--font); }
.donut-center-l { fill: var(--muted); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 0.4rem; }
.donut-legend li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; }
.donut-legend .dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.donut-legend .instr-name { font-family: var(--mono); font-weight: 600; color: var(--text); }
.donut-legend .instr-meta { color: var(--muted); font-size: 0.76rem; margin-left: auto; }

.journal-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.journal-table th { text-align: left; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); font-weight: 700; }
.journal-table td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--border); }
.journal-table tr:hover td { background: rgba(var(--accent-rgb), 0.04); }
.journal-table .jr-date { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.journal-note { margin-top: 0.6rem; }
.dir-tag { font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.12rem 0.4rem; border-radius: 5px; }
.dir-long { color: var(--ok); background: rgba(52, 211, 153, 0.12); }
.dir-short { color: var(--error); background: rgba(248, 113, 113, 0.12); }

.live-locked { text-align: center; padding: 1.4rem 1rem; color: var(--muted); }
.live-locked .lock-ico { font-size: 1.6rem; display: block; margin-bottom: 0.4rem; }
.live-pos { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.live-pos:last-child { border-bottom: none; }
.live-pos-main { display: flex; align-items: center; gap: 0.5rem; }
.live-pos-main strong { font-family: var(--mono); font-size: 0.9rem; }
.live-qty { color: var(--muted); font-size: 0.82rem; }
.live-pos-prices { display: flex; gap: 0.9rem; font-size: 0.8rem; color: var(--muted); flex-wrap: wrap; }
.live-pos-prices b { color: var(--text); font-family: var(--mono); }
.live-pos-prices .sl b { color: var(--error); }
.live-pos-prices .tp b { color: var(--ok); }

/* ── Modal método de pago + página crypto ── */
.pay-modal {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.pay-modal.hidden { display: none; }
.pay-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(8, 12, 20, 0.55);
  backdrop-filter: blur(4px);
}
.pay-modal-panel {
  position: relative; z-index: 1;
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.35rem 1.4rem 1.1rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}
.pay-modal-panel h3 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.pay-method-grid { display: flex; flex-direction: column; gap: 0.55rem; margin: 1rem 0 0.75rem; }
.pay-method-btn {
  display: flex; align-items: flex-start; gap: 0.75rem;
  text-align: left; width: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.pay-method-btn:hover { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.06); }
.pay-method-btn .pm-ico { font-size: 1.35rem; line-height: 1; }
.pay-method-btn strong { display: block; font-size: 0.95rem; }
.pay-method-btn span { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }
.pay-token-row { display: flex; gap: 0.5rem; margin-top: 0.55rem; }
.pay-token-row button {
  flex: 1; padding: 0.55rem;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); cursor: pointer; font-weight: 600;
}
.pay-token-row button:hover { border-color: var(--accent); }
.pay-modal-cancel { width: 100%; margin-top: 0.25rem; }

.crypto-pay-body-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}
.crypto-pay-card {
  width: 100%;
  max-width: 480px;
  text-align: center;
}
.crypto-pay-amount {
  font-size: 1.75rem; font-weight: 800; font-family: var(--mono);
  margin: 0.4rem 0 0.15rem;
}
.crypto-pay-network { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }
.crypto-qr-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
  margin: 1rem 0;
}
.crypto-qr-wrap img {
  width: 200px; height: 200px; border-radius: 10px;
  background: #fff; padding: 8px; border: 1px solid var(--border);
}
.crypto-wallet {
  width: 100%; font-family: var(--mono); font-size: 0.78rem;
  word-break: break-all; padding: 0.65rem 0.75rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  text-align: center;
}
.crypto-pay-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; justify-content: center; }
.crypto-countdown { font-size: 0.85rem; color: var(--muted); margin-top: 0.85rem; }
.crypto-poll-hint { font-size: 0.8rem; color: var(--muted); margin-top: 0.35rem; }
.crypto-paid-banner {
  padding: 0.85rem 1rem; border-radius: 10px;
  background: rgba(52, 211, 153, 0.12); color: var(--ok);
  font-weight: 600; margin-bottom: 0.75rem;
}

@media (max-width: 860px) {
  .profile-grid { grid-template-columns: 1fr; }
  .kpi.big { grid-column: span 2; }
}
@media (max-width: 520px) {
  .pub-grid { grid-template-columns: 1fr; }
  .pub-stats-row { grid-template-columns: repeat(2, 1fr); row-gap: 0.7rem; }
  .pub-toolbar { flex-direction: column; align-items: stretch; }
}
