/* ==========================================================================
   LeadHunter — Sistema de diseño propio (oscuro, glass, profundidad)
   ========================================================================== */
:root {
  --bg: #070b14;
  --bg-2: #0b1120;
  --bg-3: #111a2e;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.07);
  --surface-solid: #0f172a;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8edff;
  --text-2: #c3cbe6;
  --muted: #9aa6c7;
  --primary: #7c5cff;
  --primary-600: #6a47f5;
  --primary-soft: rgba(124, 92, 255, 0.16);
  --accent: #22d3ee;
  --accent-soft: rgba(34, 211, 238, 0.14);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.14);
  --grad: linear-gradient(135deg, #7c5cff 0%, #5b8cff 50%, #22d3ee 100%);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
  --ring: 0 0 0 3px rgba(124, 92, 255, 0.45);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sidebar-w: 256px;
  --topbar-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text);
  background: var(--bg); min-height: 100vh; overflow-x: hidden;
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(124, 92, 255, 0.14), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(34, 211, 238, 0.08), transparent 60%);
  background-attachment: fixed;
}
img, svg { max-width: 100%; }
a { color: #a996ff; text-decoration: none; }
a:hover { color: #c7baff; text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.3rem; }
h3, .h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); font-size: .88em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break { overflow-wrap: anywhere; word-break: break-word; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--primary); color: #fff; padding: 10px 14px; border-radius: 8px; transition: top .2s; }
.skip-link:focus { top: 12px; color: #fff; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; vertical-align: middle; }
[hidden] { display: none !important; }
::selection { background: rgba(124, 92, 255, .4); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- Superficies ---------- */
.glass, .card {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.025));
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.card { padding: 20px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-head { padding: 16px 20px 0; }
.card-sub { color: var(--muted); font-size: .88rem; margin: -6px 0 14px; }

/* ---------- Botones ---------- */
.btn {
  --b: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--b);
  color: var(--text); font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s, opacity .2s; white-space: nowrap;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; color: var(--text); background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.24); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 24px -10px rgba(124, 92, 255, .9); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.08); color: #fff; box-shadow: 0 10px 30px -10px rgba(124, 92, 255, 1); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger-soft); border-color: rgba(248,113,113,.35); color: #fecaca; }
.btn-danger:hover { background: rgba(248,113,113,.25); color: #fff; border-color: rgba(248,113,113,.6); }
.btn-success { background: var(--success-soft); border-color: rgba(52,211,153,.35); color: #bbf7d0; }
.btn-success:hover { background: rgba(52,211,153,.25); color: #fff; }
.btn-warning { background: var(--warning-soft); border-color: rgba(251,191,36,.35); color: #fde68a; }
.btn-warning:hover { background: rgba(251,191,36,.25); color: #fff; }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: .84rem; border-radius: 8px; }
.btn-lg { min-height: 50px; padding: 12px 22px; font-size: 1rem; border-radius: 12px; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }
.btn .spinner { width: 16px; height: 16px; }
.btn.is-loading { pointer-events: none; opacity: .85; }
.btn.is-loading > .icon { display: none; }

.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Formularios ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: .84rem; font-weight: 600; color: var(--text-2); }
.field .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: rgba(3, 7, 18, 0.55); color: var(--text); font: inherit; font-size: .94rem; transition: border-color .2s, box-shadow .2s, background .2s;
}
.input::placeholder, .textarea::placeholder { color: #6f7ba0; }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(255,255,255,.26); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); background: rgba(3, 7, 18, 0.75); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.input:disabled, .select:disabled, .textarea:disabled { opacity: .55; cursor: not-allowed; }
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa6c7' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.select option { background: #0f172a; color: var(--text); }
.select-sm, .input-sm { min-height: 34px; padding: 5px 10px; font-size: .86rem; }
.select-sm { padding-right: 30px; }
.hint { font-size: .8rem; color: var(--muted); margin: 0; }
.field-error { font-size: .8rem; color: #fca5a5; margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.form-actions.start { justify-content: flex-start; }
.inline-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .92rem; color: var(--text-2); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex: 0 0 auto; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0; min-width: 0; }
legend { padding: 0 8px; font-weight: 700; font-size: .9rem; color: var(--text-2); }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }

/* Interruptor */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 46px; height: 26px; border-radius: 99px; background: rgba(255,255,255,.14); border: 1px solid var(--border-strong); position: relative; transition: background .25s; flex: 0 0 auto; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.switch input:checked + .track { background: var(--success); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

/* ---------- Alertas / badges ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 14px; font-size: .92rem; }
.alert-error { background: var(--danger-soft); border-color: rgba(248,113,113,.35); color: #fecaca; }
.alert-success { background: var(--success-soft); border-color: rgba(52,211,153,.35); color: #bbf7d0; }
.alert-info { background: var(--info-soft); border-color: rgba(96,165,250,.35); color: #bfdbfe; }
.alert-warning { background: var(--warning-soft); border-color: rgba(251,191,36,.35); color: #fde68a; }
.alert .icon { margin-top: 2px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .76rem; font-weight: 700; letter-spacing: .01em; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-soft); color: #86efac; border-color: rgba(52,211,153,.3); }
.badge-warning { background: var(--warning-soft); color: #fcd34d; border-color: rgba(251,191,36,.3); }
.badge-danger { background: var(--danger-soft); color: #fca5a5; border-color: rgba(248,113,113,.3); }
.badge-info { background: var(--info-soft); color: #93c5fd; border-color: rgba(96,165,250,.3); }
.badge-primary { background: var(--primary-soft); color: #c4b5fd; border-color: rgba(124,92,255,.35); }
.badge-accent { background: var(--accent-soft); color: #67e8f9; border-color: rgba(34,211,238,.3); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: .75rem; font-weight: 600; border: 1px solid; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.score { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-weight: 800; font-size: .82rem; background: conic-gradient(var(--c, var(--primary)) calc(var(--v) * 1%), rgba(255,255,255,.08) 0); position: relative; }
.score::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--bg-2); }
.score span { position: relative; }

/* ---------- Layout público ---------- */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.bg-orbs span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; animation: float 18s ease-in-out infinite; }
.bg-orbs span:nth-child(1) { width: 420px; height: 420px; background: #5b3cff; top: -120px; left: -80px; }
.bg-orbs span:nth-child(2) { width: 360px; height: 360px; background: #0891b2; bottom: -120px; right: -60px; animation-delay: -6s; }
.bg-orbs span:nth-child(3) { width: 260px; height: 260px; background: #9333ea; top: 40%; left: 55%; opacity: .25; animation-delay: -12s; }
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(30px, -30px); } }

.auth-wrap, .install-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; gap: 22px; }
.auth-card { width: 100%; max-width: 440px; padding: 28px; }
.install-card { width: 100%; max-width: 760px; padding: 28px; }
.install-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.install-head h1 { margin: 0; }
.auth-brand img { height: 40px; width: auto; }
.auth-card h1 { font-size: 1.45rem; }
.auth-foot { text-align: center; font-size: .9rem; color: var(--muted); margin-top: 16px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .88rem; }

.stepper { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 20px; flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-size: .82rem; color: var(--muted); }
.stepper li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); font-weight: 700; font-size: .78rem; }
.stepper li em { font-style: normal; }
.stepper li.current { border-color: rgba(124,92,255,.5); color: var(--text); background: var(--primary-soft); }
.stepper li.current span { background: var(--grad); color: #fff; }
.stepper li.done span { background: var(--success); color: #052e16; }
.check-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; }
.check-list li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-size: .9rem; }
.check-list li span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.check-list .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.check-list .ok .dot { background: var(--success); }
.check-list .fail .dot { background: var(--danger); }
.check-list .warn .dot { background: var(--warning); }
.code-block { background: rgba(0,0,0,.4); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; color: #c7d2fe; margin: 0 0 12px; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 60; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(11,17,32,.92), rgba(7,11,20,.96)); border-right: 1px solid var(--border);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); transition: transform .3s var(--ease);
}
.sidebar-brand { height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.sidebar-brand img { height: 30px; width: auto; }
.sidebar-close { display: none; }
.side-nav { flex: 1; overflow-y: auto; padding: 14px 12px 20px; }
.nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: #6f7ba0; font-weight: 700; margin: 16px 10px 6px; }
.nav-section:first-child { margin-top: 2px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: var(--text-2); font-weight: 550; font-size: .92rem; transition: background .2s, color .2s; position: relative; }
.nav-link:hover { background: rgba(255,255,255,.06); color: var(--text); text-decoration: none; }
.nav-link.active { background: linear-gradient(90deg, rgba(124,92,255,.22), rgba(124,92,255,.04)); color: #fff; }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.nav-link .icon { opacity: .9; }
.nav-link .count { margin-left: auto; font-size: .72rem; background: var(--primary-soft); color: #c4b5fd; padding: 1px 8px; border-radius: 99px; font-weight: 700; }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); flex: 0 0 auto; }
.ap-mini { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: .82rem; color: var(--text-2); }
.ap-mini:hover { text-decoration: none; color: var(--text); border-color: var(--border-strong); }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); position: relative; flex: 0 0 auto; }
.pulse.on { background: var(--success); }
.pulse.on::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--success); animation: ping 1.8s var(--ease) infinite; }
.pulse.warn { background: var(--warning); }
@keyframes ping { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }

.main-col { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 22px;
  background: rgba(7, 11, 20, .72); border-bottom: 1px solid var(--border); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.menu-toggle { display: none; }
.global-search { position: relative; flex: 1; max-width: 520px; min-width: 0; }
.global-search .input { padding-left: 38px; min-height: 40px; background: rgba(255,255,255,.05); }
.global-search > .icon { position: absolute; left: 12px; top: 11px; color: var(--muted); pointer-events: none; }
.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; max-height: 70vh; overflow-y: auto; padding: 8px; z-index: 70; }
.search-group { padding: 6px 4px; }
.search-group h4 { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 4px 8px 6px; }
.search-item { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.search-item:hover, .search-item:focus { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.search-item small { color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 6px; z-index: 80; animation: pop .16s var(--ease); }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border-radius: 8px; color: var(--text-2); background: none; border: 0; font: inherit; font-size: .9rem; text-align: left; cursor: pointer; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.dropdown-menu .sep { height: 1px; background: var(--border); margin: 6px 4px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.notif-btn { position: relative; }
.notif-count { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .66rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.notif-panel { width: min(380px, calc(100vw - 24px)); padding: 0; }
.notif-panel header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-list { max-height: 60vh; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); font-size: .88rem; }
.notif-item:hover { background: rgba(255,255,255,.04); text-decoration: none; color: var(--text); }
.notif-item.unread { background: rgba(124,92,255,.07); }
.notif-item.unread .ndot { background: var(--primary); }
.ndot { width: 8px; height: 8px; border-radius: 50%; background: transparent; margin-top: 6px; flex: 0 0 auto; }
.notif-item strong { display: block; color: var(--text); font-weight: 650; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 800; font-size: .85rem; flex: 0 0 auto; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border-radius: 99px; background: transparent; border: 1px solid transparent; color: var(--text); cursor: pointer; font: inherit; }
.user-btn:hover { border-color: var(--border); background: var(--surface); }
.user-btn .name { max-width: 140px; font-weight: 600; font-size: .9rem; }

.content { padding: 26px 26px 60px; width: 100%; max-width: 1480px; margin: 0 auto; flex: 1; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }
.sidebar-backdrop { display: none; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }

/* ---------- KPIs ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; position: relative; overflow: hidden; transition: transform .25s var(--ease), border-color .25s; }
.kpi:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: var(--kc, var(--primary)); opacity: .12; filter: blur(10px); }
.kpi-label { font-size: .8rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kpi-label .icon { color: var(--kc, var(--primary)); }
.kpi-value { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.1; }
.kpi-foot { font-size: .78rem; color: var(--muted); margin-top: 4px; }

/* ---------- Tablas (responsive) ---------- */
.table-wrap { position: relative; width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: rgba(255,255,255,.02); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(255,255,255,.03); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions > * { margin-left: 4px; }
.cell-main { font-weight: 650; color: var(--text); display: block; }
.cell-sub { font-size: .8rem; color: var(--muted); display: block; }
.table input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--primary); }

/* ---------- Filtros ---------- */
.filters { margin-bottom: 16px; }
.filters-toggle { display: none; }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.filters-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 20px; background: var(--primary-soft); border-bottom: 1px solid rgba(124,92,255,.3); }
.segmented { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); flex-wrap: wrap; }
.segmented a, .segmented button { padding: 6px 12px; border-radius: 9px; color: var(--text-2); font-size: .85rem; font-weight: 600; border: 0; background: none; cursor: pointer; font-family: inherit; }
.segmented a:hover, .segmented button:hover { color: #fff; text-decoration: none; }
.segmented .active { background: var(--primary-soft); color: #fff; box-shadow: inset 0 0 0 1px rgba(124,92,255,.4); }

/* ---------- Paginación ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; font-size: .86rem; color: var(--muted); }
.pagination nav { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Estados vacíos / carga ---------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .icon-wrap { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--primary-soft); color: #c4b5fd; }
.empty-state .icon-wrap .icon { width: 26px; height: 26px; }
.empty-state h2, .empty-state h3 { color: var(--text); margin-bottom: 6px; }
.empty-state p { max-width: 460px; margin: 0 auto 16px; }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 30px; color: var(--muted); }
.skeleton { background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Modales (dialog) ---------- */
dialog.modal { padding: 0; border: 0; background: transparent; color: var(--text); max-width: min(680px, calc(100vw - 24px)); width: 100%; max-height: calc(100dvh - 24px); overflow: visible; }
dialog.modal.modal-lg { max-width: min(920px, calc(100vw - 24px)); }
dialog.modal.modal-sm { max-width: min(440px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(2, 6, 16, .7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog.modal[open] { animation: modalIn .22s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-box { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); background: linear-gradient(180deg, #121a30, #0c1324); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.modal-head h2 { margin: 0; font-size: 1.12rem; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); flex: 0 0 auto; flex-wrap: wrap; background: rgba(0,0,0,.15); }
.modal-status { margin-bottom: 12px; }
.modal-loading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(12,19,36,.7); border-radius: var(--radius-lg); z-index: 3; }

/* ---------- Toasts ---------- */
#toast-root { position: fixed; right: 16px; bottom: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: #131c33; border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: .9rem; animation: toastIn .28s var(--ease); }
.toast.success { border-color: rgba(52,211,153,.45); } .toast.success .icon { color: var(--success); }
.toast.error { border-color: rgba(248,113,113,.45); } .toast.error .icon { color: var(--danger); }
.toast.info .icon { color: var(--info); }
.toast.warning { border-color: rgba(251,191,36,.45); } .toast.warning .icon { color: var(--warning); }
.toast button { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 2px; }
.toast.leaving { opacity: 0; transform: translateX(20px); transition: all .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: .9rem; border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; font-family: inherit; }
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs .active, .tabs [aria-selected="true"] { color: #fff; border-bottom-color: var(--primary); }

/* ---------- Detalle / listas de datos ---------- */
.dl { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 10px 14px; margin: 0; font-size: .9rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.na { color: #6f7ba0; font-style: italic; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 18px 44px; }
.timeline .t-icon { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-3); border: 1px solid var(--border-strong); color: var(--text-2); }
.timeline .t-icon .icon { width: 15px; height: 15px; }
.timeline .t-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.timeline .t-title { font-weight: 600; font-size: .92rem; }
.timeline .t-time { font-size: .78rem; color: var(--muted); }
.timeline .t-body { font-size: .88rem; color: var(--text-2); margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.signal-list { display: flex; flex-wrap: wrap; gap: 6px; }
.progress { height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-plain li:last-child { border-bottom: 0; }

/* ---------- Kanban ---------- */
.kanban { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kanban-col { background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 220px); min-height: 200px; }
.kanban-col header { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kanban-col header h2 { font-size: .9rem; margin: 0; display: flex; align-items: center; gap: 8px; }
.kanban-col header .sum { font-size: .76rem; color: var(--muted); }
.kanban-list { padding: 10px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; flex: 1; min-height: 80px; transition: background .2s; border-radius: 0 0 var(--radius) var(--radius); }
.kanban-list.drag-over { background: rgba(124,92,255,.08); }
.kanban-card { padding: 12px; border-radius: 12px; background: #111a2e; border: 1px solid var(--border); cursor: grab; transition: transform .15s, box-shadow .2s, border-color .2s; }
.kanban-card:hover { border-color: var(--border-strong); box-shadow: 0 8px 20px -10px rgba(0,0,0,.6); }
.kanban-card.dragging { opacity: .5; transform: rotate(1.5deg); }
.kanban-card a.title { font-weight: 650; color: var(--text); display: block; margin-bottom: 4px; overflow-wrap: anywhere; }
.kanban-card .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.kanban-card .select { margin-top: 8px; }
.stage-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sc, var(--primary)); }

/* ---------- Gráficos ---------- */
.chart { width: 100%; min-height: 220px; position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { transition: opacity .2s; }
.chart .bar:hover { opacity: .8; }
.chart .axis { stroke: rgba(255,255,255,.08); }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 48px; align-items: center; gap: 10px; font-size: .86rem; }
.funnel-row .bar-wrap { height: 22px; border-radius: 8px; background: rgba(255,255,255,.05); overflow: hidden; }
.funnel-row .bar-fill { height: 100%; border-radius: 8px; background: var(--grad); min-width: 2px; transition: width .8s var(--ease); }
.funnel-row strong { text-align: right; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: .8rem; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-wrap svg { width: 140px; height: 140px; flex: 0 0 auto; }

/* ---------- Autopilot ---------- */
.ap-hero { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px; position: relative; overflow: hidden; }
.ap-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 200px at 0% 0%, rgba(52,211,153,.12), transparent 60%); pointer-events: none; }
.ap-hero.paused::before { background: radial-gradient(600px 200px at 0% 0%, rgba(251,191,36,.12), transparent 60%); }
.ap-status { display: flex; align-items: center; gap: 14px; position: relative; }
.ap-status .big { font-size: 1.35rem; font-weight: 800; letter-spacing: .02em; }
.ap-orb { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, #6ee7b7, #059669); box-shadow: 0 0 30px rgba(52,211,153,.5); color: #022c22; }
.ap-orb.off { background: radial-gradient(circle at 30% 30%, #475569, #1e293b); box-shadow: none; color: #cbd5e1; }
.ap-orb.paused { background: radial-gradient(circle at 30% 30%, #fde68a, #d97706); box-shadow: 0 0 30px rgba(251,191,36,.4); color: #451a03; }
.ap-orb .icon { width: 24px; height: 24px; }
.ap-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.ap-metric { padding: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.ap-metric span { font-size: .76rem; color: var(--muted); display: block; }
.ap-metric strong { font-size: 1.35rem; font-weight: 800; display: block; margin-top: 2px; overflow-wrap: anywhere; }
.wizard-step { display: none; }
.wizard-step.active { display: block; animation: fadeIn .25s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.option-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.option-card { display: flex; gap: 12px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: border-color .2s, background .2s; }
.option-card:hover { border-color: var(--border-strong); }
.option-card input { width: 18px; height: 18px; accent-color: var(--primary); margin-top: 2px; flex: 0 0 auto; }
.option-card:has(input:checked) { border-color: rgba(124,92,255,.6); background: var(--primary-soft); }
.option-card.disabled { opacity: .5; cursor: not-allowed; }
.option-card strong { display: block; font-size: .92rem; }
.option-card small { color: var(--muted); display: block; font-size: .8rem; margin-top: 2px; }
.interpretation { padding: 14px; border-radius: 12px; border: 1px dashed rgba(124,92,255,.45); background: rgba(124,92,255,.06); font-size: .9rem; }
.interpretation dl { margin: 8px 0 0; }
.log-status-ok { color: var(--success); } .log-status-error { color: var(--danger); } .log-status-warn { color: var(--warning); } .log-status-skip { color: var(--muted); }
.disclaimer { font-size: .8rem; color: var(--muted); padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.03); border: 1px solid var(--border); }

/* ---------- Form builder ---------- */
.builder-list { display: flex; flex-direction: column; gap: 10px; }
.builder-item { display: grid; grid-template-columns: auto minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.builder-item .grip { color: var(--muted); cursor: grab; }
.builder-item .options-input { grid-column: 2 / -1; }
.embed-code { width: 100%; min-height: 90px; font-family: var(--mono); font-size: .8rem; }

/* ---------- Página de error ---------- */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.error-code { font-size: clamp(4rem, 18vw, 8rem); font-weight: 900; line-height: 1; margin: 0; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: -0.04em; }
.error-page h1 { font-size: 1.5rem; margin-top: 10px; }
.error-page p { color: var(--muted); max-width: 460px; margin: 0 auto 22px; }

/* ==========================================================================
   Landing principal
   ========================================================================== */
.lh-public .site-nav { position: fixed; inset: 0 0 auto 0; z-index: 100; height: 70px; display: flex; align-items: center; transition: background .3s, border-color .3s; border-bottom: 1px solid transparent; }
.lh-public .site-nav.scrolled { background: rgba(7,11,20,.78); border-bottom-color: var(--border); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-inner .brand img { height: 32px; width: auto; display: block; }
.nav-menu { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-menu a { color: var(--text-2); font-weight: 550; font-size: .93rem; padding: 8px 12px; border-radius: 8px; }
.nav-menu a:hover { color: #fff; background: rgba(255,255,255,.06); text-decoration: none; }
.nav-cta { display: flex; align-items: center; gap: 8px; }
.nav-burger { display: none; }
.hero { padding: 140px 0 80px; position: relative; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 40px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: var(--primary-soft); border: 1px solid rgba(124,92,255,.35); color: #d4c9ff; font-size: .82rem; font-weight: 600; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.2rem, 5.4vw, 4rem); line-height: 1.05; letter-spacing: -0.035em; margin-bottom: 18px; }
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 1.12rem; color: var(--text-2); max-width: 560px; margin-bottom: 28px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { margin-top: 18px; font-size: .84rem; color: var(--muted); }

/* Visual 3D propio */
.scene { position: relative; height: 460px; perspective: 1200px; }
.scene-inner { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(14deg) rotateY(-18deg); transition: transform .4s var(--ease); }
.orb3d { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #b7a6ff 0%, #7c5cff 30%, #2b1a8a 65%, #0b0b2a 100%); box-shadow: 0 0 80px rgba(124,92,255,.55), inset -20px -30px 60px rgba(0,0,0,.5); transform: translateZ(40px); animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: translateZ(40px) scale(1); } 50% { transform: translateZ(40px) scale(1.04); } }
.ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; border: 1px solid rgba(34,211,238,.35); transform-style: preserve-3d; }
.ring.r1 { width: 360px; height: 360px; margin: -180px 0 0 -180px; transform: rotateX(72deg); animation: spinRing 22s linear infinite; }
.ring.r2 { width: 440px; height: 440px; margin: -220px 0 0 -220px; transform: rotateX(72deg) rotateY(18deg); border-color: rgba(124,92,255,.3); animation: spinRing 34s linear infinite reverse; }
.ring::after { content: ""; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; border-radius: 50%; background: #22d3ee; box-shadow: 0 0 14px #22d3ee; }
.ring.r2::after { background: #a78bfa; box-shadow: 0 0 14px #a78bfa; }
@keyframes spinRing { to { transform: rotateX(72deg) rotateZ(360deg); } }
.float-card { position: absolute; padding: 12px 14px; border-radius: 14px; min-width: 170px; background: rgba(17,26,46,.78); border: 1px solid var(--border-strong); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow-lg); font-size: .82rem; animation: bob 7s ease-in-out infinite; }
.float-card b { display: block; font-size: 1.05rem; color: #fff; }
.float-card small { color: var(--muted); }
.float-card.c1 { top: 30px; left: 0; transform: translateZ(90px); }
.float-card.c2 { top: 150px; right: 0; transform: translateZ(130px); animation-delay: -2s; }
.float-card.c3 { bottom: 30px; left: 40px; transform: translateZ(70px); animation-delay: -4s; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.fc-row { display: flex; align-items: center; gap: 8px; }
.fc-row .pulse { width: 8px; height: 8px; }

.section { padding: 90px 0; position: relative; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); letter-spacing: -0.02em; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: s; }
.step-card { padding: 22px; position: relative; }
.step-card::before { counter-increment: s; content: counter(s, decimal-leading-zero); font-size: .8rem; font-weight: 800; color: #a996ff; letter-spacing: .1em; }
.step-card h3 { margin: 10px 0 8px; }
.step-card p { color: var(--muted); font-size: .92rem; margin: 0; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { padding: 24px; transition: transform .3s var(--ease), border-color .3s; }
.feature:hover { transform: translateY(-4px); border-color: rgba(124,92,255,.4); }
.feature .f-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--primary-soft); color: #c4b5fd; margin-bottom: 14px; }
.feature .f-icon .icon { width: 22px; height: 22px; }
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: .93rem; margin: 0; }
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 320px)); gap: 16px; justify-content: center; }
.price-card { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.price-card.featured { border-color: rgba(124,92,255,.55); box-shadow: 0 20px 60px -20px rgba(124,92,255,.5); }
.price { font-size: 2.2rem; font-weight: 850; letter-spacing: -0.03em; }
.price small { font-size: .95rem; color: var(--muted); font-weight: 500; }
.price-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .92rem; color: var(--text-2); }
.price-card li { display: flex; gap: 8px; align-items: flex-start; }
.price-card li .icon { color: var(--success); margin-top: 2px; }
.price-card .btn { margin-top: auto; }
.resources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.resource { padding: 22px; }
.resource p { color: var(--muted); font-size: .92rem; }
.contact-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
.site-footer { border-top: 1px solid var(--border); padding: 36px 0; color: var(--muted); font-size: .88rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Formulario / landing pública del cliente ---------- */
.public-form-body { background: transparent; }
.public-form { max-width: 560px; margin: 0 auto; padding: 22px; }
.public-form.embedded { background: transparent; border: 0; box-shadow: none; padding: 6px; }
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.lp { --lp: #7c5cff; }
.lp-hero { padding: 60px 0 40px; }
.lp-logo { height: 44px; width: auto; margin-bottom: 26px; }
.lp-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 32px; align-items: start; }
.lp h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); letter-spacing: -0.03em; }
.lp .lp-sub { font-size: 1.1rem; color: var(--text-2); }
.lp-image { border-radius: var(--radius-lg); border: 1px solid var(--border); margin: 18px 0; width: 100%; height: auto; }
.lp-benefits { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 10px; }
.lp-benefits li { display: flex; gap: 10px; align-items: flex-start; }
.lp-benefits .icon { color: var(--lp); margin-top: 2px; }
.lp .btn-primary { background: var(--lp); box-shadow: none; }
.lp-footer { padding: 30px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: .88rem; text-align: center; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .kanban { grid-auto-columns: minmax(240px, 280px); }
  .hero-grid { grid-template-columns: 1fr; }
  .scene { height: 400px; max-width: 560px; margin: 0 auto; width: 100%; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  :root { --sidebar-w: 272px; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.drawer-open .sidebar { transform: none; }
  body.drawer-open { overflow: hidden; }
  .sidebar-close { display: inline-flex; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(2,6,16,.6); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .3s; }
  body.drawer-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .main-col { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .grid-main { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features, .resources { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-grid, .lp-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .nav-menu, .nav-cta .btn-ghost { display: none; }
  .nav-burger { display: inline-flex; }
  .site-nav.open .nav-menu { display: flex; flex-direction: column; align-items: stretch; position: absolute; top: 70px; left: 12px; right: 12px; padding: 10px; background: rgba(12,19,36,.97); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-lg); }
  .site-nav.open .nav-menu a { display: block; padding: 12px 14px; }
  .site-nav.open { background: rgba(7,11,20,.92); }
  .user-btn .name { display: none; }
  .builder-item { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); }
  .builder-item .b-type, .builder-item .b-req { grid-column: auto; }
}
@media (max-width: 768px) {
  body { font-size: 14.5px; }
  .content { padding: 18px 14px 50px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .grid-2, .grid-3, .grid-4, .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .page-head { align-items: flex-start; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .card { padding: 16px; }
  .filters-toggle { display: inline-flex; }
  .filters-body { display: none; }
  .filters.open .filters-body { display: block; }
  .filters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 1.45rem; }
  /* Tablas -> tarjetas */
  .table-responsive thead { display: none; }
  .table-responsive, .table-responsive tbody, .table-responsive tr, .table-responsive td { display: block; width: 100%; }
  .table-responsive tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .table-responsive td { padding: 4px 0; border: 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table-responsive td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; font-weight: 600; text-align: left; flex: 0 0 38%; }
  .table-responsive td.td-main { display: block; text-align: left; padding-bottom: 6px; }
  .table-responsive td.td-main::before { display: none; }
  .table-responsive td.actions { justify-content: flex-end; padding-top: 8px; }
  .table-responsive td.actions::before { display: none; }
  .table-responsive td.td-check { display: none; }
  .table-responsive td > * { min-width: 0; }
  .toolbar, .bulk-bar, .pagination { padding-left: 14px; padding-right: 14px; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 10px; }
  .hero { padding: 110px 0 50px; }
  .section { padding: 60px 0; }
  .features, .resources, .steps { grid-template-columns: 1fr; }
  .modal-body { padding: 16px; }
  .modal-head, .modal-foot { padding: 14px 16px; }
  .modal-foot .btn { flex: 1 1 auto; }
  .funnel-row { grid-template-columns: 90px minmax(0, 1fr) 40px; }
  .global-search { max-width: none; }
}
@media (max-width: 600px) {
  .scene { height: 340px; }
  .orb3d { width: 160px; height: 160px; margin: -80px 0 0 -80px; }
  .ring.r1 { width: 260px; height: 260px; margin: -130px 0 0 -130px; }
  .ring.r2 { width: 320px; height: 320px; margin: -160px 0 0 -160px; }
  .float-card { min-width: 140px; padding: 10px 12px; font-size: .76rem; }
  .float-card.c2 { top: 120px; }
  .auth-card, .install-card { padding: 20px; }
  .stepper li em { display: none; }
  .stepper li { padding: 4px; }
  .topbar-actions .lang-btn { display: none; }
  .kanban { grid-auto-columns: minmax(230px, 85vw); }
  .builder-item { grid-template-columns: auto minmax(0, 1fr); }
  .builder-item > .b-remove { justify-self: end; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .filters-grid { grid-template-columns: 1fr; }
  .hero-ctas .btn { width: 100%; }
  .btn-lg { min-height: 46px; }
  .ap-metrics { grid-template-columns: 1fr 1fr; }
  .nav-cta .btn-primary { padding: 8px 12px; font-size: .85rem; }
  .segmented { width: 100%; }
  .segmented a, .segmented button { flex: 1; text-align: center; }
  .float-card.c3 { left: 10px; }
}
@media (max-width: 400px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .ap-metrics { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
@media print {
  .sidebar, .topbar, .page-actions, .filters { display: none !important; }
  .main-col { margin: 0; }
  body { background: #fff; color: #000; }
}
