:root {
  --bg: #0b0d12;
  --surface: #141821;
  --surface-2: #1b2130;
  --border: #262d3d;
  --text: #e9ecf3;
  --muted: #8b93a7;
  --accent: #7c5cff;
  --accent-2: #00d4a6;
  --danger: #ff5c7a;
  --warn: #ffb547;
  --ok: #2fd27a;
  --radius: 14px;
  --border-strong: var(--border-strong);
  --topbar-bg: rgba(11, 13, 18, 0.85);
  --body-glow: radial-gradient(1200px 600px at 80% -10%, rgba(124, 92, 255, 0.18), transparent 60%);
  --shadow: rgba(0, 0, 0, .45);
  --on-accent: #fff;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--body-glow), var(--bg);
  transition: background-color .4s, color .4s;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.brand { font-weight: 800; font-size: 1.25rem; color: var(--text); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; margin-right: 6px;
}
.nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav a {
  color: var(--muted); padding: 7px 12px; border-radius: 10px; font-weight: 500; font-size: 0.95rem;
}
.nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav a.active { color: var(--text); background: var(--surface-2); }
.nav .user-chip { color: var(--muted); font-size: 0.85rem; padding: 0 8px; }
.badge-count {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; margin-left: 4px;
  background: var(--danger); color: #fff; font-size: 0.72rem; font-weight: 700; text-align: center;
}

/* ---------- Layout ---------- */
.container { max-width: 1100px; width: 100%; margin: 0 auto; padding: 28px 16px 48px; flex: 1; }
.footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.8rem; text-align: center; padding: 18px 16px; }
h1 { font-size: 1.9rem; letter-spacing: -0.03em; margin: 0 0 6px; }
h2 { font-size: 1.25rem; margin: 0 0 12px; }
h3 { font-size: 1.05rem; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 24px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub { margin: 0; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.two-col { display: grid; gap: 20px; grid-template-columns: 1.4fr 1fr; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
}
.card + .card { margin-top: 16px; }
.project-card { display: flex; flex-direction: column; gap: 12px; transition: transform .15s, border-color .15s; }
.project-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.project-card h3 { margin: 0; }
.project-card .owner { color: var(--muted); font-size: 0.85rem; }
.project-card .desc { color: var(--muted); font-size: 0.9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }

.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; min-width: 110px; }
.stat .label { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-weight: 700; font-size: 1.05rem; }
.stat.big { flex: 1 0 150px; padding: 14px 16px; }
.stat.big .value { font-size: 1.5rem; }
.money { color: var(--accent-2); }

.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 0.75rem; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

.status { font-size: 0.78rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; white-space: nowrap; align-self: flex-start; flex-shrink: 0; }
.status.pending { background: rgba(255,181,71,.15); color: var(--warn); }
.status.approved { background: rgba(47,210,122,.15); color: var(--ok); }
.status.rejected { background: rgba(255,92,122,.15); color: var(--danger); }
.status.paused { background: var(--surface-2); color: var(--muted); }

.instructions { white-space: pre-line; background: var(--surface-2); border-radius: 10px; padding: 14px 16px; }

/* ---------- Forms ---------- */
form .field { margin-bottom: 16px; }
label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }
input, textarea, select {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit; outline: none;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.2); }
textarea { min-height: 130px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
.checks { display: flex; gap: 8px; flex-wrap: wrap; }
.checks label { display: flex; align-items: center; gap: 6px; font-weight: 500; background: var(--surface-2); padding: 7px 12px; border-radius: 10px; cursor: pointer; margin: 0; }
.checks input { width: auto; }
.inline-input { display: flex; gap: 8px; }
.inline-input input { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 0.92rem; background: var(--surface-2); color: var(--text);
  transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.15); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #9b7dff); color: #fff; }
.btn.success { background: rgba(47,210,122,.15); color: var(--ok); border-color: rgba(47,210,122,.35); }
.btn.danger { background: rgba(255,92,122,.12); color: var(--danger); border-color: rgba(255,92,122,.35); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.sm { padding: 6px 11px; font-size: 0.82rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.alert { padding: 12px 14px; border-radius: 10px; font-size: 0.9rem; margin-bottom: 16px; }
.alert.info { background: rgba(124,92,255,.12); border: 1px solid rgba(124,92,255,.3); }
.alert.ok { background: rgba(47,210,122,.1); border: 1px solid rgba(47,210,122,.3); }
.alert.warn { background: rgba(255,181,71,.1); border: 1px solid rgba(255,181,71,.3); }

/* ---------- Clip list ---------- */
.clip { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.clip:first-child { border-top: 0; padding-top: 0; }
.clip .url { word-break: break-all; font-weight: 500; }
.clip .meta { color: var(--muted); font-size: 0.8rem; display: flex; gap: 12px; flex-wrap: wrap; }
.clip .actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.clip .reason { grid-column: 1 / -1; font-size: 0.85rem; color: var(--danger); }
.countdown { color: var(--warn); font-size: 0.8rem; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: 6px 12px; border-radius: 99px; cursor: pointer; font: inherit; font-size: 0.85rem; }
.tabs button.active { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; padding: 30px 0; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.05; }
.hero h1 span { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 1.1rem; }
.steps { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 40px; }
.step-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); font-weight: 700; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 0.9rem; margin: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface-2); border: 1px solid var(--border); padding: 12px 18px; border-radius: 12px;
  opacity: 0; pointer-events: none; transition: all .25s; max-width: calc(100% - 32px); z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--danger); color: #ffd1da; }
.toast.ok { border-color: var(--ok); }

/* ---------- Tarjetas de campaña (Explorar) ---------- */
.camp-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.camp-card {
  display: flex; flex-direction: column; overflow: hidden; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.camp-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: 0 12px 30px var(--shadow); text-decoration: none; }
.camp-banner {
  position: relative; aspect-ratio: 1.9 / 1; background-size: cover; background-position: center;
}
.camp-banner.fallback { display: grid; place-items: center; padding: 16px; text-align: center; }
.camp-banner.fallback > span {
  font-weight: 800; font-size: 1.35rem; line-height: 1.1; letter-spacing: -0.02em; color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.35); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.camp-badge {
  position: absolute; top: 10px; left: 10px; font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 99px;
  background: rgba(11,13,18,.75); color: #fff; backdrop-filter: blur(6px);
}
.camp-badge.ok { background: rgba(47,210,122,.9); color: #062b17; }
.camp-badge.off { background: rgba(255,92,122,.9); }
.camp-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.camp-owner { display: flex; align-items: center; gap: 6px; font-size: .85rem; min-width: 0; }
.camp-owner .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camp-owner .dot, .camp-owner .when { color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.camp-owner .name { min-width: 3.5em; }
.camp-platforms { margin-left: auto; display: flex; gap: 3px; flex-shrink: 0; }
.camp-platforms .pf-icon { width: 21px; height: 21px; }
.camp-platforms .pf-icon svg { width: 13px; height: 13px; }
.pf-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--text); }
.avatar {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0;
  color: #fff; font-size: .68rem; font-weight: 800;
}
.camp-title { margin: 0; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.camp-budget { color: var(--muted); font-size: .92rem; }
.camp-budget b { color: var(--text); }
.camp-budget small { font-size: .7rem; }
.camp-pills { display: flex; gap: 6px; }
.pill { font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); }
.pill.rate { background: rgba(0,212,166,.15); color: var(--accent-2); }
.camp-progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.camp-progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ff7a1a, #ffb547); }
.camp-available { font-size: .8rem; color: var(--muted); }
.camp-available b { color: var(--accent-2); }

/* Detalle de campaña */
.detail-banner { margin-bottom: 18px; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); }
.detail-banner .camp-banner { aspect-ratio: 3.2 / 1; }
.budget-box { margin-bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.budget-line { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.budget-line b { color: var(--text); }
.budget-line.small { font-size: .8rem; margin-bottom: 6px; }
.pf-tag { display: inline-flex; align-items: center; gap: 6px; padding-left: 4px; }
.pf-tag .pf-icon { width: 20px; height: 20px; }

/* Selector de banner */
.banner-pick {
  aspect-ratio: 1.9 / 1; border: 2px dashed var(--border); border-radius: 14px; cursor: pointer;
  display: grid; place-items: center; color: var(--muted); background-size: cover; background-position: center;
}
.banner-pick:hover { border-color: var(--accent); }
.banner-pick.has-image { border-style: solid; }
.banner-pick.has-image span { display: none; }

/* Inicio: hero centrado en una sola columna */
.hero.solo { grid-template-columns: 1fr; text-align: center; max-width: 760px; margin: 0 auto; padding: 70px 0 40px; }
.hero.solo .hero-actions { justify-content: center; }

/* Ingreso / registro */
.auth-switch { text-align: center; color: var(--muted); font-size: .9rem; margin: 16px 0 0; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .role-pick { grid-template-columns: 1fr; } }
.role-pick label { margin: 0; cursor: pointer; font-weight: 400; }
.role-pick input { position: absolute; opacity: 0; pointer-events: none; }
.role-card {
  display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--bg); transition: border-color .15s, background .15s;
}
.role-card small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.role-pick input:checked + .role-card { border-color: var(--accent); background: rgba(124,92,255,.1); }
.role-pick input:focus-visible + .role-card { box-shadow: 0 0 0 3px rgba(124,92,255,.3); }

/* Selector "ver como" del administrador */
.view-as { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.view-as-label { color: var(--warn); font-size: .75rem; font-weight: 600; padding: 0 8px; }
.view-as button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .82rem; font-weight: 600; padding: 5px 10px; border-radius: 7px; cursor: pointer; }
.view-as button.active { background: var(--accent); color: #fff; }

/* Mostrar / ocultar contraseña */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 84px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: var(--surface-2); color: var(--muted); font: inherit; font-size: .78rem; font-weight: 600;
  padding: 5px 10px; border-radius: 7px; cursor: pointer;
}
.pw-toggle:hover { color: var(--text); }

/* Recursos (varios links) */
.resource-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.resource-row { display: flex; gap: 8px; }
.resource-row input { flex: 1; }
.resource-links { display: flex; flex-direction: column; gap: 8px; }
.resource-link {
  display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text); min-width: 0;
}
.resource-link:hover { text-decoration: none; filter: brightness(1.15); }
.resource-link .r-host { font-weight: 600; }
.resource-link .r-url { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* Mis redes / verificaciones */
.social-row { padding: 16px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.social-row:first-of-type { border-top: 0; padding-top: 4px; }
.social-head { display: flex; align-items: center; gap: 10px; }
.social-head .pf-icon { width: 34px; height: 34px; }
.social-head .pf-icon svg { width: 18px; height: 18px; }
.social-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.social-name a { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.social-name span { color: var(--muted); font-size: .8rem; }
.social-meta { color: var(--muted); font-size: .85rem; }
.social-steps ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: .88rem; display: flex; flex-direction: column; gap: 8px; }
.social-steps b { color: var(--text); }
.social-steps .reason { color: var(--danger); font-size: .85rem; margin-bottom: 8px; }
.social-row .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.code-box { display: inline-flex; align-items: center; gap: 8px; margin-left: 6px; vertical-align: middle; }
.code-box code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95rem; font-weight: 700; letter-spacing: .06em;
  background: var(--bg); border: 1px dashed var(--accent); color: var(--text); padding: 4px 10px; border-radius: 8px;
}
.checks label .pf-icon { width: 20px; height: 20px; }
.checks label .pf-icon svg { width: 12px; height: 12px; }
select { appearance: auto; }

/* Menú de configuración (esquina superior) */
.settings-menu { position: relative; }
.settings-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 5px 8px 5px 12px; border-radius: 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font: inherit;
}
.settings-btn:hover, .settings-btn[aria-expanded="true"] { border-color: var(--border-strong); background: var(--surface-2); }
.settings-user { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; font-size: .85rem; font-weight: 600; }
.settings-user small { color: var(--muted); font-size: .7rem; font-weight: 500; }
.gear { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); font-size: 1.05rem; }
.settings-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; z-index: 30; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 34px var(--shadow);
}
.settings-dropdown[hidden] { display: none; }
.nav .settings-dropdown a { display: block; color: var(--text); padding: 9px 12px; border-radius: 8px; font-size: .9rem; }
.nav .settings-dropdown a:hover { background: var(--surface-2); }

/* Página de preferencias */
.pref-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
@media (max-width: 760px) { .pref-layout { grid-template-columns: 1fr; } }
.pref-menu { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; position: sticky; top: 76px; }
@media (max-width: 760px) { .pref-menu { flex-direction: row; overflow-x: auto; position: static; } }
.pref-menu a { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 10px 12px; border-radius: 10px; font-weight: 500; white-space: nowrap; }
.pref-menu a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.pref-menu a.active { color: var(--text); background: var(--surface-2); }
.pref-content { min-width: 0; }
.pref-content .card + .card { margin-top: 16px; }
.pref-content .two-col { grid-template-columns: 1fr; }
.pref-content .page-head h1 { font-size: 1.4rem; }
.pref-content .two-col > div > .card + .card { margin-top: 16px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: .92rem; }
.kv:first-of-type { border-top: 0; }
.kv span { color: var(--muted); }
.field[hidden] { display: none; }

/* Movimientos de saldo */
.tx-list { display: flex; flex-direction: column; }
.tx { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.tx:first-child { border-top: 0; }
.tx div { display: flex; flex-direction: column; min-width: 0; }
.tx div b { font-weight: 500; font-size: .92rem; }
.tx div span { color: var(--muted); font-size: .78rem; }
.tx-in { color: var(--ok); font-weight: 700; white-space: nowrap; }
.tx-out { color: var(--danger); font-weight: 700; white-space: nowrap; }

/* Saldo al crear campaña y en Mis proyectos */
.balance-check { margin-top: 8px; font-size: .85rem; }
.balance-check .ok { color: var(--ok); }
.balance-check .bad { color: var(--danger); }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.balance-chip { padding: 9px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: .85rem; font-weight: 600; }
.balance-chip:hover { text-decoration: none; border-color: var(--border-strong); }

/* Ganancias del clipeador */
.earn-total { flex: 2 0 220px !important; }
.earn-note { color: var(--muted); font-size: .75rem; margin-top: 4px; }
.earn-link { font-size: .78rem; display: inline-block; margin-top: 6px; }

/* Estados y rechazo de clips */
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.list-head h2 { margin: 0; }
.list-head .tabs { margin: 0; }
.tab-n { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 2px; border-radius: 9px; background: var(--surface-2); font-size: .72rem; text-align: center; }
.reject-box { grid-column: 1 / -1; background: rgba(255,92,122,.08); border: 1px solid rgba(255,92,122,.3); border-radius: 10px; padding: 10px 14px; font-size: .86rem; }
.reject-box b { color: var(--danger); }
.reject-box ul { margin: 6px 0 0; padding-left: 18px; }
.reject-box li { margin: 2px 0; }
.reject-comment { margin-top: 8px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(5,6,10,.7); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px; box-shadow: 0 24px 60px var(--shadow); }
.modal .url { display: block; word-break: break-all; font-size: .85rem; margin-bottom: 14px; }
.req-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.req { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid transparent; font-weight: 400; cursor: pointer; }
.req input { width: auto; margin-top: 3px; accent-color: var(--danger); }
.req:has(input:checked) { border-color: rgba(255,92,122,.5); background: rgba(255,92,122,.08); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* "Ver como" dentro del menú de configuración (solo admin) */
.dd-section { padding: 4px 0; }
.dd-label { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; padding: 6px 12px 4px; }
.dd-option {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent;
  color: var(--text); font: inherit; font-size: .9rem; padding: 8px 12px; border-radius: 8px; cursor: pointer;
}
.dd-option:hover { background: var(--surface-2); }
.dd-option.active { color: var(--accent); font-weight: 600; }
.dd-check { width: 14px; display: inline-block; color: var(--accent); }
.dd-sep { height: 1px; background: var(--border); margin: 4px 6px; }
.settings-dropdown { min-width: 210px; }

/* =====================================================================
   TEMA CLARO — app de empresas (creadores): claro, colorido y tranquilo.
   El tema oscuro (clipeadores) es el de :root.
   ===================================================================== */
body.theme-light {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #f1eefb;
  --border: #e6e2f0;
  --border-strong: #cfc8e6;
  --text: #1f1d2e;
  --muted: #6d6a82;
  --accent: #6b4ff0;
  --accent-2: #0d9e83;
  --danger: #e0475b;
  --warn: #b7700a;
  --ok: #1d9a55;
  --topbar-bg: rgba(255, 255, 255, 0.82);
  --shadow: rgba(60, 45, 120, .14);
  --body-glow:
    radial-gradient(700px 420px at 92% -8%, rgba(255, 196, 168, .55), transparent 60%),
    radial-gradient(640px 420px at -6% 12%, rgba(190, 236, 218, .6), transparent 60%),
    radial-gradient(800px 500px at 50% 110%, rgba(222, 214, 255, .55), transparent 60%);
}
body.theme-light .toast.error { color: var(--danger); }
body.theme-light .card,
body.theme-light .camp-card,
body.theme-light .pref-menu { box-shadow: 0 6px 22px var(--shadow); }
body.theme-light input, body.theme-light textarea, body.theme-light select { background: #fff; }
body.theme-light .code-box code { background: #faf9ff; }
body.theme-light .modal-backdrop { background: rgba(40, 32, 80, .35); }
body.theme-light .instructions, body.theme-light .stat { background: var(--surface-2); }

/* =====================================================================
   PORTADA: pantalla dividida CLIPEADOR | EMPRESA con puerta corrediza
   ===================================================================== */
body.door-closed { overflow: hidden; }
body.door-closed .topbar, body.door-closed .footer, body.door-closed #app { visibility: hidden; }

.door { position: fixed; inset: 0; z-index: 100; display: flex; overflow: hidden; }
.door-half {
  position: relative; flex: 1; border: 0; padding: 0; margin: 0; cursor: pointer; font: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; overflow: hidden;
  transition: transform 1.05s cubic-bezier(.77, 0, .18, 1), filter .25s;
}
.door-half.left { background: #3a0408; color: #fff; border-right: 4px solid #000; }   /* mitad de la línea negra */
.door-half.right { background: #fbf8f2; color: #111; border-left: 4px solid #000; }   /* la otra mitad */
.door-half:hover, .door-half:focus-visible { filter: brightness(1.06); outline: none; }
.door-half:focus-visible .door-word { text-decoration: underline; text-underline-offset: 10px; }
.door-word {
  font-family: "Anton", "Bebas Neue", Impact, "Arial Narrow", sans-serif; font-weight: 400;
  font-size: clamp(2.6rem, 8.5vw, 7.5rem); letter-spacing: .02em; line-height: .9; text-transform: uppercase;
}
.door-cta { font-weight: 700; font-size: .95rem; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.door-half .led { position: absolute; left: 0; right: 0; top: 14%; }
.door-brand {
  position: absolute; top: 22px; left: 50%; transform: translateX(-50%); z-index: 2; pointer-events: none;
  background: #000; color: #fff; font-weight: 800; padding: 8px 16px; border-radius: 999px; letter-spacing: .02em;
  transition: opacity .3s;
}
/* Se abre: cada mitad se desliza hacia su lado y sale de la pantalla. */
.door.open .door-half.left { transform: translateX(-101%); }
.door.open .door-half.right { transform: translateX(101%); }
.door.open .door-brand { opacity: 0; }
.door.open { pointer-events: none; }
@media (max-width: 640px) {
  .door-word { font-size: clamp(1.6rem, 9.5vw, 3.4rem); }
  .door-half { gap: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .door-half { transition: none; }
}

/* =====================================================================
   BANNER LED tipo pantalla 360 de estadio (loop infinito)
   ===================================================================== */
.led {
  position: relative; overflow: hidden; white-space: nowrap;
  border-top: 3px solid #000; border-bottom: 3px solid #000;
  padding: 10px 0;
}
.led.red { background: #c40000; color: #fff; }
.led.yellow { background: #ffc400; color: #000; }
.led-track { display: inline-flex; animation: led-scroll 18s linear infinite; will-change: transform; }
.led-track span {
  font-family: "Anton", "Bebas Neue", Impact, "Arial Narrow", sans-serif; text-transform: uppercase;
  font-size: clamp(1.1rem, 2.4vw, 1.7rem); letter-spacing: .06em; padding-right: 0;
}
@keyframes led-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .led-track { animation-duration: 60s; } }

/* =====================================================================
   PANTALLA DE ACCESO después de elegir lado
   ===================================================================== */
.access-band { width: 100vw; margin: -28px 0 28px calc(50% - 50vw); }
.access { max-width: 520px; margin: 30px auto 0; text-align: center; }
.access .side-tag {
  display: inline-block; font-family: "Anton", Impact, sans-serif; font-size: clamp(2.4rem, 7vw, 3.6rem);
  letter-spacing: .03em; line-height: 1; text-transform: uppercase; margin-bottom: 10px;
}
.access p { color: var(--muted); font-size: 1.05rem; margin: 0 0 26px; }
.access .access-actions { display: flex; flex-direction: column; gap: 10px; }
.access .btn { padding: 14px 18px; font-size: 1rem; }
.access .switch-side { display: inline-block; margin-top: 18px; color: var(--muted); font-size: .9rem; }
.side-clip { color: #ff3b30; }
body.theme-light .side-emp { color: #1f1d2e; background: linear-gradient(transparent 62%, #ffd200 62%); padding: 0 6px; }

/* Botón de Google y separador */
.google-btn { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; gap: 10px; margin-bottom: 4px; }
.google-btn:hover { filter: none; background: #f7f8fa; }
.or-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; margin: 14px 0; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* =====================================================================
   PORTADA — fondos difuminados (degradados de luz que se mueven lento)
   ===================================================================== */
.door-half > * { position: relative; z-index: 1; }
.door-half > .led { position: absolute; z-index: 2; }

/* Capa de luces: manchas de color muy difuminadas */
.door-half::before {
  content: ""; position: absolute; inset: -25%; z-index: 0; pointer-events: none;
  filter: blur(60px); will-change: transform;
  animation: door-drift 22s ease-in-out infinite alternate;
}
/* Capa de acabado: viñeta / brillo suave para dar profundidad */
.door-half::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; }

/* CLIPEADOR: rojo muy oscuro con brasas de carmesí */
.door-half.left {
  background: linear-gradient(160deg, #2b0306 0%, #3d0509 45%, #1c0204 100%);
}
.door-half.left::before {
  background:
    radial-gradient(38% 34% at 28% 30%, rgba(196, 18, 32, .55), transparent 70%),
    radial-gradient(30% 30% at 72% 62%, rgba(140, 8, 22, .6), transparent 70%),
    radial-gradient(26% 24% at 40% 82%, rgba(230, 60, 40, .28), transparent 70%),
    radial-gradient(22% 22% at 80% 18%, rgba(110, 6, 30, .55), transparent 70%);
}
.door-half.left::after {
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, .55) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, .04), transparent 40%);
}

/* EMPRESA: casi blanco, cálido, con luces pastel */
.door-half.right {
  background: linear-gradient(200deg, #fffdf8 0%, #fbf7ef 50%, #f6f1e7 100%);
}
.door-half.right::before {
  animation-direction: alternate-reverse;
  background:
    radial-gradient(36% 32% at 70% 28%, rgba(255, 210, 110, .75), transparent 70%),
    radial-gradient(32% 30% at 26% 66%, rgba(255, 180, 150, .62), transparent 70%),
    radial-gradient(28% 26% at 78% 80%, rgba(196, 184, 255, .58), transparent 70%),
    radial-gradient(24% 22% at 22% 18%, rgba(160, 228, 205, .58), transparent 70%);
}
.door-half.right::after {
  background: radial-gradient(120% 90% at 50% 45%, transparent 60%, rgba(120, 100, 60, .10) 100%);
}

/* Las palabras ganan presencia sobre el fondo */
.door-half.left .door-word { text-shadow: 0 8px 40px rgba(0, 0, 0, .45); }
.door-half.right .door-word { text-shadow: 0 8px 30px rgba(255, 255, 255, .8); }

@keyframes door-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  50%  { transform: translate3d(4%, -3%, 0) scale(1.08) rotate(4deg); }
  100% { transform: translate3d(-3%, 4%, 0) scale(1.04) rotate(-3deg); }
}
@media (prefers-reduced-motion: reduce) { .door-half::before { animation: none; } }

/* Registro: espacio entre la elección de tipo de cuenta y el botón de Google */
.role-field { margin-bottom: 24px; }
.google-btn[hidden], .or-sep[hidden] { display: none; }

/* =====================================================================
   PRUEBAS DE ANALÍTICAS (clipeador sube / empresa revisa en carpetas)
   ===================================================================== */
.modal.wide { width: min(720px, 100%); }
.proof-chip { font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.proof-chip.pending { background: rgba(255,181,71,.15); color: var(--warn); }
.proof-chip.approved { background: rgba(47,210,122,.15); color: var(--ok); }
.proof-chip.rejected { background: rgba(255,92,122,.12); color: var(--danger); }

.daily-code {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 16px; margin: 6px 0 14px; border-radius: 14px; border: 2px dashed var(--accent); background: rgba(124,92,255,.08);
}
.daily-code span { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.daily-code code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 800; letter-spacing: .08em; color: var(--text); }
.daily-code small { color: var(--muted); }
.proof-steps { color: var(--muted); font-size: .88rem; padding-left: 20px; margin: 0 0 16px; display: grid; gap: 6px; }
.proof-steps b { color: var(--text); }
.country-row { display: grid; grid-template-columns: 1fr 90px; gap: 8px; margin-bottom: 6px; }
.modal-actions .hint { margin-right: auto; align-self: center; }

.proof-item { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-top: 12px; display: grid; gap: 10px; }
.proof-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.proof-data { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.proof-data .stat.warn .value { color: var(--warn); }
.proof-data .stat.ok .value { color: var(--ok); }
.code-inline { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95rem !important; }
.country-bars { display: grid; gap: 6px; }
.country { display: grid; grid-template-columns: 130px 1fr 48px; align-items: center; gap: 8px; font-size: .85rem; }
.country .bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.country .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }
.country b { text-align: right; }
.proof-notes { color: var(--muted); font-style: italic; margin: 0; font-size: .88rem; }
.proof-video { width: 100%; max-height: 420px; border-radius: 10px; background: #000; }
.video-btn { justify-self: start; }

.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.folder {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; cursor: pointer;
  padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit;
  transition: transform .15s, border-color .15s;
}
.folder:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.folder-icon { font-size: 1.6rem; line-height: 1; margin-bottom: 4px; }
.folder small { color: var(--muted); font-size: .78rem; }
.folder .badge-count { position: absolute; top: 10px; right: 10px; }

/* =====================================================================
   ESTADÍSTICAS (admin)
   ===================================================================== */
.stat-section { margin: 22px 0 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.stat-section:first-child { margin-top: 4px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.stat-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.st-label { font-size: .75rem; color: var(--muted); }
.st-value { font-size: 1.45rem; font-weight: 800; line-height: 1.15; }
.st-value small { font-size: .8rem; font-weight: 600; color: var(--muted); }
.st-note { font-size: .74rem; color: var(--muted); }
.stat-tile.ok .st-value { color: var(--ok); }
.stat-tile.warn .st-value { color: var(--warn); }
.stat-tile.bad .st-value { color: var(--danger); }
.stat-tile.money .st-value { color: var(--accent-2); font-size: 1.2rem; }
.table-wrap { overflow-x: auto; }
.stat-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.stat-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.stat-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.stat-table td small { color: var(--muted); }
.stat-table td.money { color: var(--accent-2); font-weight: 600; }

/* =====================================================================
   LEDGER (saldos) Y RETIROS
   ===================================================================== */
.ledger-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
a.stat.earn-total { color: inherit; text-decoration: none; transition: border-color .15s; border: 1px solid transparent; }
a.stat.earn-total:hover { border-color: var(--border-strong); }
.wd-row { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-top: 12px; display: grid; gap: 10px; }
.wd-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wd-head .status { margin-left: auto; }
.wd-pay { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 14px; font-size: .88rem; }
.wd-pay span { display: flex; flex-direction: column; }
.wd-pay small { color: var(--muted); font-size: .72rem; }
.wd-row .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Hora de publicación detectada del link */
.pub-detect { margin-top: 6px; font-size: .82rem; color: var(--muted); }
.pub-detect.ok { color: var(--ok); }
.pub-detect.bad { color: var(--danger); }
.pub-detect.warn { color: var(--warn); }
.pub-pending { color: var(--warn); }

/* Conectar YouTube */
.connect-yt h2 { display: flex; align-items: center; gap: 8px; }
.connect-yt .pf-icon { width: 30px; height: 30px; }

/* ---------- Comisión al crear campaña ---------- */
.fee-box { margin-top: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; background: var(--surface-2); font-size: .9rem; }
.fee-box:empty { display: none; }
.fee-box > div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.fee-box > div span { color: var(--muted); }
.fee-box .fee-total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 7px; }
.fee-box .fee-total b { color: var(--accent-2); }
.fee-box .hint { margin: 6px 0 0; }

/* ---------- Apelaciones ---------- */
.appeal-box { grid-column: 1 / -1; border-radius: 10px; padding: 10px 14px; font-size: .86rem; border: 1px solid var(--border); background: var(--surface-2); margin-top: 8px; }
.appeal-box > div { margin-top: 4px; }
.appeal-box span { color: var(--muted); font-weight: 600; }
.appeal-box.pending { border-color: rgba(255,181,71,.4); background: rgba(255,181,71,.08); }
.appeal-box.pending b { color: var(--warn); }
.appeal-box.accepted { border-color: rgba(47,210,122,.4); background: rgba(47,210,122,.08); }
.appeal-box.accepted b { color: var(--ok); }
.appeal-box.denied b { color: var(--danger); }
.appeal-row { padding: 14px 0; border-top: 1px solid var(--border); }
.appeal-row:first-of-type { border-top: 0; }
.appeal-row .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: .84rem; margin: 4px 0 8px; }
.appeal-row .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- Analíticas de campaña ---------- */
.analytics h3 { font-size: .95rem; margin: 22px 0 8px; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.ch-grid { stroke: var(--border); stroke-width: 1; }
.ch-axis { fill: var(--muted); font-size: 11px; }
.ch-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-bar { fill: var(--accent); }
.ch-hit { fill: transparent; cursor: crosshair; }
.ch-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.ch-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.ch-tip { position: absolute; transform: translate(-50%, calc(-100% - 10px)); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 4px 9px; font-size: .8rem; white-space: nowrap; pointer-events: none; box-shadow: 0 4px 14px var(--shadow); }

/* ---------- Riesgo de bots ---------- */
.risk-box { grid-column: 1 / -1; border-radius: 10px; padding: 10px 14px; font-size: .86rem; border: 1px solid var(--border); background: var(--surface-2); margin-top: 8px; }
.risk-box ul { margin: 6px 0 0; padding-left: 18px; }
.risk-box span { color: var(--muted); font-weight: 600; }
.risk-box .risk-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.risk-box.held, .risk-box.high { border-color: rgba(255,92,122,.4); background: rgba(255,92,122,.07); }
.risk-box.held b, .risk-box.high b { color: var(--danger); }
.risk-box.mid { border-color: rgba(255,181,71,.4); background: rgba(255,181,71,.07); }
.risk-box.cleared { border-color: rgba(47,210,122,.35); }
.risk-box.cleared b { color: var(--ok); }
.risk-chip { font-size: .76rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px solid currentColor; }
.risk-box .risk-chip.low { color: var(--ok); }
.risk-box .risk-chip.mid { color: var(--warn); }
.risk-box .risk-chip.high { color: var(--danger); }

/* ---------- Páginas legales y consentimiento ---------- */
.legal { max-width: 820px; margin: 10px auto 30px; line-height: 1.65; }
.legal h1 { margin-bottom: 4px; }
.legal h2 { font-size: 1.1rem; margin: 26px 0 8px; }
.legal ul { padding-left: 20px; }
.legal li { margin: 6px 0; }
.legal hr { border: 0; border-top: 1px solid var(--border); margin: 26px 0 14px; }
.legal-back { display: inline-block; margin-bottom: 10px; }
.legal-note { font-size: .8rem; color: var(--muted); margin: 10px 0 14px; text-align: center; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; color: var(--muted); margin: 4px 0 16px; cursor: pointer; }
.consent input { margin-top: 3px; flex: none; width: auto; padding: 0; }
.consent span { flex: 1; }
.footer a { color: var(--muted); text-decoration: underline; }
.door-legal { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 5; font-size: .75rem; color: rgba(255,255,255,.8); background: rgba(0,0,0,.45); padding: 6px 14px; border-radius: 14px; backdrop-filter: blur(6px); text-align: center; width: max-content; max-width: calc(100% - 32px); }
.door-legal span { display: block; margin-bottom: 2px; }
.door-legal a { color: inherit; text-decoration: underline; }
.signup-closed-note { margin-top: 14px; font-size: .85rem; opacity: .85; max-width: 420px; }
[data-signup][hidden], [data-signup-closed][hidden] { display: none !important; }
