/* =============================================================
   PrestaControl — Sistema de diseño
   Sin frameworks: variables CSS + componentes reutilizables.
   ============================================================= */

@font-face {
  font-family: "Jakarta";
  src: url("../fonts/jakarta.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #f6f4f0;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --ink: #17140f;
  --ink-2: #4f4a43;
  --muted: #8b857c;
  --line: #e8e4dd;
  --line-2: #f0ede8;
  --accent: #ff5a36;
  --accent-hover: #f04a25;
  --accent-ink: #ffffff;
  --accent-soft: #fff0ea;
  --success: #15803d;
  --success-soft: #e9f7ee;
  --danger: #d92d20;
  --danger-soft: #fdeceb;
  --warn: #b45309;
  --warn-soft: #fdf3e2;
  --skel: #ebe7e1;
  --skel-shine: #f6f4f0;
  --shadow-sm: 0 1px 2px rgba(23, 20, 15, .06);
  --shadow: 0 1px 2px rgba(23, 20, 15, .05), 0 8px 24px -8px rgba(23, 20, 15, .12);
  --shadow-lg: 0 24px 64px -16px rgba(23, 20, 15, .28);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --font: "Jakarta", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage", "Jakarta", ui-sans-serif, system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

/* Modo noche: solo si el usuario lo elige (se guarda en su navegador). */
:root[data-theme="dark"] {
    --bg: #12100e;
    --surface: #1b1916;
    --surface-2: #211e1b;
    --ink: #f4f1ec;
    --ink-2: #c9c3b9;
    --muted: #8f887e;
    --line: #2f2b27;
    --line-2: #26231f;
    --accent-soft: #3a1d14;
    --success-soft: #11291a;
    --danger-soft: #3a1513;
    --warn-soft: #33240f;
    --skel: #26231f;
    --skel-shine: #322e29;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, .7);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
code { font-size: .9em; background: var(--line-2); padding: .1em .4em; border-radius: 6px; }
.muted { color: var(--muted); }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 24px; height: 24px; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.brand b { font-weight: 800; color: var(--accent); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); font-weight: 800; font-size: 18px;
  box-shadow: inset 0 -3px 0 var(--accent);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 650; font-size: 14.5px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease), background .15s, border-color .15s, box-shadow .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-dark:hover { opacity: .9; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn-outline { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13.5px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 10px; }
.btn.is-loading::after {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { font-size: 12.5px; color: var(--muted); }
.input, .field input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]), .field select, .field textarea, .select {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus, .select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 12.5px; font-weight: 500; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .prefix { position: absolute; left: 14px; color: var(--muted); font-size: 14px; pointer-events: none; }
.input-group .prefix + input { padding-left: 42px !important; }
.input-group .suffix-btn { position: absolute; right: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; font-weight: 550; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease); }
.switch input:checked { background: var(--success); }
.switch input:checked::after { transform: translateX(16px); }

.alert { padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--accent-soft); color: var(--ink); }
.alert-success { background: var(--success-soft); color: var(--success); }

/* ---------- Skeleton (carga por bloques estilo Facebook) ---------- */
.skel {
  position: relative; overflow: hidden; background: var(--skel); border-radius: 8px;
}
.skel::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--skel-shine), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-line { height: 12px; margin-top: 10px; }
.skel-line.w-40 { width: 40%; } .skel-line.w-60 { width: 60%; } .skel-line.w-80 { width: 80%; }
.skel-title { height: 22px; width: 50%; }
.skel-img { aspect-ratio: 1; border-radius: 0; }
.skel-circle { border-radius: 50%; }
.fade-in { animation: fadeIn .35s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-muted { background: var(--line-2); color: var(--muted); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-dark { background: var(--ink); color: var(--bg); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: all .15s;
}
.chip:hover { border-color: var(--ink-2); }
.chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .count { font-size: 11.5px; opacity: .6; }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { font-size: 17px; }

/* ---------- Modal (dialog nativo) ---------- */
dialog.modal {
  border: 0; padding: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink);
  width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
dialog.modal.modal-sm { width: min(420px, calc(100vw - 24px)); }
dialog.modal[open] { display: flex; flex-direction: column; animation: modalIn .25s var(--ease); }
dialog.modal::backdrop { background: rgba(18, 14, 10, .45); backdrop-filter: blur(3px); animation: fadeIn .2s; }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line-2); background: var(--surface-2); }
@media (max-width: 560px) {
  dialog.modal, dialog.modal.modal-sm { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 92dvh; }
  @keyframes modalIn { from { transform: translateY(40px); opacity: 0; } }
}

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 1000; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 550;
  animation: toastIn .3s var(--ease); pointer-events: auto;
}
.toast.is-error .icon { color: #ff8a7a; }
.toast.is-success .icon { color: #5ee08f; }
.toast.is-leaving { animation: toastOut .25s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Estado vacío ---------- */
.empty { text-align: center; padding: 56px 20px; display: grid; justify-items: center; gap: 10px; }
.empty-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 6px; }
.empty h3 { font-size: 19px; }
.empty p { color: var(--muted); max-width: 340px; }

/* =============================================================
   AUTENTICACIÓN (login / registro / instalador)
   ============================================================= */
.auth-page { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 960px) { .auth-page.has-aside { grid-template-columns: 1.05fr 1fr; } }
.auth-aside {
  display: none; position: relative; overflow: hidden; padding: 48px; color: #fff;
  background: radial-gradient(120% 80% at 0% 100%, #ff7a50 0%, transparent 55%), radial-gradient(90% 70% at 100% 0%, #3b2a1f 0%, transparent 60%), #17140f;
}
@media (min-width: 960px) { .auth-aside { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-aside .brand { color: #fff; }
.auth-aside .brand-mark { background: #fff; color: #17140f; }
.auth-aside h2 { font-size: clamp(32px, 3.4vw, 46px); max-width: 520px; font-weight: 700; }
.auth-aside p { color: rgba(255,255,255,.7); max-width: 440px; margin-top: 14px; font-size: 16px; }
.auth-aside .mini-cards { display: flex; gap: 12px; margin-top: 32px; }
.auth-aside .mini { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(8px); border-radius: 16px; padding: 14px 16px; font-size: 13px; color: rgba(255,255,255,.8); display: flex; align-items: center; gap: 10px; }
.auth-main { display: grid; place-items: center; padding: 32px 18px; }
.auth-card { width: 100%; max-width: 420px; margin: auto; display: grid; gap: 22px; padding: 32px 0; }
.auth-page:not(.has-aside) .auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; margin: 40px auto; max-width: 520px; }
.auth-card h1 { font-size: 32px; font-weight: 700; }
.auth-card .sub { color: var(--muted); margin-top: -12px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 14px; }
.auth-foot a { color: var(--accent); font-weight: 650; text-decoration: none; }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.pw-meter i { height: 4px; border-radius: 4px; background: var(--line); transition: background .2s; }
.pw-meter[data-score="1"] i:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-score="2"] i:nth-child(-n+2) { background: var(--warn); }
.pw-meter[data-score="3"] i:nth-child(-n+3) { background: #65a30d; }
.pw-meter[data-score="4"] i { background: var(--success); }
.secure-note { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 12.5px; color: var(--muted); }

/* =============================================================
   LANDING
   ============================================================= */
.l-wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.l-nav { position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(1.4) blur(12px); background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid transparent; transition: border-color .2s; }
.l-nav.is-scrolled { border-bottom-color: var(--line); }
.l-nav .l-wrap { display: flex; align-items: center; gap: 12px; height: 68px; }
.l-nav .spacer { flex: 1; }
.hero { padding: 64px 0 40px; display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) { .hero { grid-template-columns: 1.05fr .95fr; padding: 88px 0 72px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.eyebrow .dot { background: var(--accent); color: #fff; border-radius: 99px; padding: 2px 8px; font-size: 11px; font-weight: 800; }
.hero h1 { font-size: clamp(40px, 6vw, 72px); font-weight: 750; letter-spacing: -.035em; margin-top: 20px; }
.hero h1 em { font-style: normal; color: var(--accent); position: relative; white-space: nowrap; }
.hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: .06em; height: .14em; background: var(--accent); opacity: .18; border-radius: 4px; }
.hero .lead { font-size: 18px; color: var(--ink-2); max-width: 520px; margin-top: 20px; }
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.hero .proof { display: flex; gap: 22px; margin-top: 28px; color: var(--muted); font-size: 13.5px; flex-wrap: wrap; }
.hero .proof span { display: inline-flex; align-items: center; gap: 6px; }


.section { padding: 72px 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head .kicker { color: var(--accent); font-weight: 750; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); margin-top: 10px; }
.section-head p { color: var(--ink-2); margin-top: 12px; font-size: 17px; }
.features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.feature { padding: 26px; }
.feature .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 18px; }
.feature h3 { font-size: 18px; }
.feature p { color: var(--ink-2); margin-top: 8px; font-size: 14.5px; }
.steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); counter-reset: step; }
.step { padding: 26px; position: relative; }
.step::before { counter-increment: step; content: counter(step); font-family: var(--display); font-size: 56px; font-weight: 800; color: var(--accent); opacity: .18; position: absolute; right: 22px; top: 8px; }
.step h3 { font-size: 18px; } .step p { color: var(--ink-2); margin-top: 8px; font-size: 14.5px; }
.security-band { background: #17140f; color: #f4f1ec; border-radius: 28px; padding: clamp(28px, 5vw, 56px); display: grid; gap: 32px; }
@media (min-width: 900px) { .security-band { grid-template-columns: .9fr 1.1fr; align-items: center; } }
.security-band h2 { font-size: clamp(28px, 3.5vw, 40px); }
.security-band p { color: rgba(244,241,236,.7); margin-top: 12px; }
.sec-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.sec-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); font-size: 14px; }
.sec-item .icon { color: #5ee08f; margin-top: 1px; }
.sec-item b { display: block; font-size: 14px; }
.sec-item span { color: rgba(244,241,236,.6); font-size: 13px; }
.cta-final { text-align: center; padding: 88px 0; }
.cta-final h2 { font-size: clamp(32px, 5vw, 56px); max-width: 760px; margin: 0 auto; }
.cta-final p { color: var(--ink-2); margin: 16px auto 28px; max-width: 520px; font-size: 17px; }
.l-foot { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 13.5px; }
.l-foot .l-wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* =============================================================
   PANEL (app shell)
   ============================================================= */
.app { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .app { grid-template-columns: 260px 1fr; } }
.sidebar { display: none; position: sticky; top: 0; height: 100dvh; padding: 22px 16px; border-right: 1px solid var(--line); background: var(--surface); flex-direction: column; gap: 24px; }
@media (min-width: 1000px) { .sidebar { display: flex; } }
.nav { display: grid; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 12px;
  text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14.5px; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--line-2); color: var(--ink); }
.nav a.is-active { background: var(--ink); color: var(--bg); }
.nav-label { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 0 12px; margin: 8px 0 4px; }
.store-pill { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.store-pill .avatar { width: 38px; height: 38px; }
.store-pill .meta { min-width: 0; flex: 1; }
.store-pill b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-pill small { color: var(--muted); font-size: 12px; }
.sidebar .bottom { margin-top: auto; display: grid; gap: 10px; }
.avatar { border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.main { min-width: 0; padding-bottom: 96px; }
@media (min-width: 1000px) { .main { padding-bottom: 40px; } }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 66px; padding: 0 clamp(16px, 3vw, 36px); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-2); }
.topbar h1 { font-size: 22px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .mobile-brand { display: inline-flex; }
@media (min-width: 1000px) { .topbar .mobile-brand { display: none; } }
.content { padding: clamp(16px, 3vw, 36px); max-width: 1280px; }

.bottom-nav { position: fixed; z-index: 40; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
@media (min-width: 1000px) { .bottom-nav { display: none; } }
.bottom-nav a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: 11px; font-weight: 650; color: var(--muted); text-decoration: none; border-radius: 12px; }
.bottom-nav a.is-active { color: var(--accent); }

.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat { padding: 20px; display: grid; gap: 4px; }
.stat .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 10px; }
.stat .num { font-family: var(--display); font-size: 34px; font-weight: 750; letter-spacing: -.03em; }
.stat .lbl { color: var(--muted); font-size: 13.5px; font-weight: 550; }
.ic-accent { background: var(--accent-soft); color: var(--accent); }
.ic-success { background: var(--success-soft); color: var(--success); }
.ic-warn { background: var(--warn-soft); color: var(--warn); }
.ic-dark { background: var(--line-2); color: var(--ink); }

.share-card { padding: 22px; display: grid; gap: 14px; background: linear-gradient(135deg, var(--surface) 40%, var(--accent-soft)); }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.share-link { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 12px; background: var(--surface); border: 1px dashed var(--line); font-size: 14px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.share-link span { overflow: hidden; text-overflow: ellipsis; }

.dash-grid { display: grid; gap: 18px; margin-top: 18px; }
@media (min-width: 1100px) { .dash-grid { grid-template-columns: 1.4fr 1fr; } }
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 22px; border-bottom: 1px solid var(--line-2); }
.list-row:last-child { border-bottom: 0; }
.list-row .thumb { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; background: var(--line-2); flex: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .grow small { color: var(--muted); font-size: 12.5px; }
.checklist { display: grid; gap: 4px; padding: 10px; }
.check-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; font-size: 14px; font-weight: 550; }
.check-item:hover { background: var(--line-2); }
.check-item .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.check-item.done .tick { background: var(--success); border-color: var(--success); color: #fff; }
.check-item.done span { color: var(--muted); text-decoration: line-through; }

/* Toolbar de productos */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .search { flex: 1 1 260px; }
.toolbar .select { width: auto; flex: 0 1 190px; }
.search { position: relative; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 42px !important; }

.p-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (max-width: 480px) { .p-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.p-card { overflow: hidden; display: flex; flex-direction: column; border-radius: 18px; transition: box-shadow .2s, transform .2s var(--ease); }
.p-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.p-card .media { position: relative; aspect-ratio: 1; background: var(--line-2); overflow: hidden; }
.p-card .media img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.p-card .media .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.p-card .media .tags { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.p-card.is-inactive .media img, .p-card.is-inactive .media .placeholder { opacity: .4; filter: grayscale(1); }
.p-card .body { padding: 12px 14px 14px; display: grid; gap: 4px; flex: 1; }
.p-card .cat { font-size: 11.5px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.p-card .name { font-weight: 650; font-size: 14.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-card .price { display: flex; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 6px; }
.p-card .price b { font-size: 16px; font-family: var(--display); }
.p-card .price s { color: var(--muted); font-size: 13px; }
.p-card .actions { display: flex; gap: 6px; padding: 0 10px 10px; }
.p-card .actions .btn { flex: 1; }

.pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin-top: 18px; color: var(--muted); font-size: 13.5px; }
.pagination.is-empty { display: none; }
.pagination:has(> .pg-info:only-child) { justify-content: center; }
.pg-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pg-btn {
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 600; cursor: pointer; display: inline-grid; place-items: center; transition: background .15s, border-color .15s, color .15s;
}
.pg-btn:hover:not(:disabled):not(.is-active) { border-color: var(--accent); color: var(--accent); }
.pg-btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; cursor: default; }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; }
.pg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pg-gap { padding: 0 4px; color: var(--muted); }
@media (max-width: 560px) { .pagination { justify-content: center; } .pg-info { width: 100%; text-align: center; } }
/* Barra de filtros compacta */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-bar .select, .filter-bar .input { width: auto; min-width: 150px; flex: 0 1 auto; }
.filter-count { margin-left: auto; font-size: 13px; color: var(--muted); }

/* Subida de imagen */
.dropzone {
  position: relative; display: grid; place-items: center; gap: 6px; text-align: center; padding: 18px;
  aspect-ratio: 1; border-radius: 18px; border: 2px dashed var(--line); background: var(--surface-2); cursor: pointer; color: var(--muted); overflow: hidden; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .remove { position: absolute; top: 8px; right: 8px; z-index: 2; }
.product-form { display: grid; gap: 18px; }
@media (min-width: 620px) { .product-form { grid-template-columns: 200px 1fr; } }
.product-form .fields { display: grid; gap: 14px; }
.toggles { display: flex; gap: 20px; flex-wrap: wrap; padding-top: 4px; }

.cat-list .list-row .count { color: var(--muted); font-size: 13px; }
.inline-form { display: flex; gap: 8px; padding: 16px 22px; border-bottom: 1px solid var(--line-2); }
.inline-form .input { flex: 1; }

.settings-grid { display: grid; gap: 18px; }
@media (min-width: 1100px) { .settings-grid { grid-template-columns: 1fr 360px; align-items: start; } }
.logo-up { display: flex; align-items: center; gap: 16px; }
.logo-up .avatar { width: 76px; height: 76px; border-radius: 20px; font-size: 28px; }
.color-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 34px; height: 34px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.swatch.is-active { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--surface); }
.color-row input[type="color"] { width: 34px; height: 34px; border: 0; padding: 0; background: none; cursor: pointer; }
.preview-mini { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.preview-mini .ph { padding: 18px; color: #fff; display: flex; align-items: center; gap: 12px; }
.preview-mini .ph .avatar { width: 44px; height: 44px; background: rgba(255,255,255,.2); color: #fff; }
.preview-mini .ph b { font-family: var(--display); font-size: 17px; display: block; }
.preview-mini .ph small { opacity: .8; }
.preview-mini .pb { padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: var(--bg); }
.preview-mini .pb i { aspect-ratio: 1; border-radius: 12px; background: var(--line); }

.btn-wa { background: #25d366; color: #fff; }
.btn-wa:hover { background: #1fbe5b; }
.state-page { min-height: 70dvh; display: grid; place-items: center; }

/* Ajustes del panel */
.grid-stack { display: grid; gap: 18px; align-content: start; }
.check-progress { padding: 4px 12px 8px; font-size: 13px; }
.share-card h3 { font-size: 19px; }
.span-all { grid-column: 1 / -1; }
.dz-hint { display: grid; justify-items: center; gap: 4px; }
.dz-hint b { color: var(--ink); font-size: 14px; }
.dz-hint small { font-size: 12px; }
.p-card .actions { align-items: center; }
.p-card .actions .switch { flex: none; }
.sep { border: 0; border-top: 1px solid var(--line-2); margin: 22px 0; }
.mb-12 { margin-bottom: 12px; }
.text-success { color: var(--success); font-size: 12.5px; font-weight: 600; }
.account-grid { display: grid; gap: 18px; max-width: 760px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }

.center { text-align: center; }

/* Correcciones tras revisión visual */
.field { align-content: start; }
.p-card .actions .btn-icon { flex: none; }
.toolbar .select { flex: 1 1 150px; }
@media (max-width: 999px) { .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); } }
.cart-fab:not(.is-visible) { visibility: hidden; transition: transform .35s var(--ease), visibility 0s .35s; }
.pd .pd-info { padding-right: 56px; }
.pd .pd-info > .badge { align-self: flex-start; }
@media (max-width: 639px) { .pd .pd-info { padding-right: 24px; } }
.toolbar .select { min-width: 0; }

/* SaaS: aviso de plan */
.plan-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px clamp(16px, 3vw, 36px) 0; padding: 12px 14px 12px 16px; border-radius: 14px; font-size: 14px; font-weight: 550; }
.plan-banner span { flex: 1 1 260px; }
.plan-banner .btn { height: 36px; }
.plan-banner.is-expired { background: var(--danger-soft); color: var(--danger); }
.plan-banner.is-expiring { background: var(--warn-soft); color: var(--warn); }
.plan-card { padding: 20px 22px; display: grid; gap: 14px; }
.plan-card .plan-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-card .plan-name { font-family: var(--display); font-size: 22px; font-weight: 750; }
.meter { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.meter .bar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.meter .bar i { display: block; height: 100%; border-radius: 99px; background: var(--success); width: 0; transition: width .6s var(--ease); }
.meter .bar i.is-warn { background: var(--warn); }
.meter .bar i.is-full { background: var(--danger); }
.meter .row { display: flex; justify-content: space-between; }

/* Superadmin */
.admin-avatar { width: 38px; height: 38px; background: var(--ink); color: var(--bg); }
.bottom-nav.six { grid-template-columns: repeat(6, 1fr); }
.bottom-nav.six a { font-size: 10px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.cell-store { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.cell-store .avatar { width: 40px; height: 40px; font-size: 14px; }
.cell-store b { display: block; }
.cell-store small { color: var(--muted); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.state-badge.is-active { background: var(--success-soft); color: var(--success); }
.state-badge.is-expiring { background: var(--warn-soft); color: var(--warn); }
.state-badge.is-expired { background: var(--danger-soft); color: var(--danger); }
.state-badge.is-suspended { background: var(--ink); color: var(--bg); }
.plans-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.plan-tile { padding: 22px; display: grid; gap: 10px; align-content: start; }
.plan-tile .price { font-family: var(--display); font-size: 30px; font-weight: 750; letter-spacing: -.02em; }
.plan-tile .price small { font-size: 14px; color: var(--muted); font-weight: 500; }
.plan-tile ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.plan-tile li { display: flex; gap: 8px; align-items: center; }
.plan-tile li .icon { color: var(--success); }
.plan-tile.is-off { opacity: .6; }
.credentials { background: var(--surface-2); border: 1px dashed var(--line); border-radius: 14px; padding: 14px 16px; font-size: 14px; display: grid; gap: 6px; white-space: pre-line; word-break: break-word; }
.quick-renew { display: flex; gap: 8px; flex-wrap: wrap; }
.event-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 22px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.event-row:last-child { border-bottom: 0; }
.event-row .ev-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.event-row small { color: var(--muted); display: block; font-size: 12.5px; }
.event-row time { color: var(--muted); font-size: 12.5px; white-space: nowrap; text-align: right; }
.bar-list { display: grid; gap: 12px; padding: 18px 22px; }
@media (max-width: 700px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 6px; border-bottom: 1px solid var(--line-2); }
  .table td { border: 0; padding: 4px 10px; }
  .table td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 92px; color: var(--muted); font-size: 12px; font-weight: 600; }
  .row-actions { justify-content: flex-start; padding-top: 6px; }
}

.plan-top small { display: block; }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr 1fr; gap: 10px; } .stat { padding: 16px; } .stat .num { font-size: 28px; } }

/* Contraseña temporal */
.pass-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.pass-box .muted { flex: 1 1 220px; }
.pass-value { font-size: 16px; font-weight: 700; padding: 6px 10px; letter-spacing: .04em; }
.limit-strip { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.limit-strip .meter { flex: 1 1 200px; }
.limit-strip.is-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.limit-strip.is-full { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.limit-strip .txt { flex: 1 1 260px; font-weight: 550; }


/* Botón de tema (día / noche) */
.theme-toggle { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: inline-grid; place-items: center; cursor: pointer; flex: none; transition: color .15s, border-color .15s, transform .2s var(--ease); }
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-2); }
.theme-toggle:active { transform: rotate(-20deg) scale(.94); }
.theme-float { position: fixed; top: 16px; right: 16px; z-index: 60; }
.topbar-tools { display: flex; align-items: center; gap: 8px; }
:root[data-theme="dark"] .info-pill.is-wa { background: #10291a; border-color: #1d4a2f; color: #5ee08f; }
:root[data-theme="dark"] .sold-out { background: rgba(0,0,0,.55); color: #fff; }

/* Panel lateral del login: cálido en modo día, oscuro solo en modo noche */
.auth-aside { background: radial-gradient(90% 70% at 100% 0%, rgba(255,255,255,.28), transparent 60%), radial-gradient(80% 60% at 0% 100%, rgba(120,30,0,.25), transparent 60%), linear-gradient(150deg, #ff8a5c 0%, #ff5a36 50%, #e5431f 100%); }
:root[data-theme="dark"] .auth-aside { background: radial-gradient(120% 80% at 0% 100%, #ff7a50 0%, transparent 55%), radial-gradient(90% 70% at 100% 0%, #3b2a1f 0%, transparent 60%), #17140f; }
.auth-aside .brand b { color: #fff; }
.auth-aside .brand-mark { box-shadow: inset 0 -3px 0 #17140f; }

/* Galería de fotos del producto */
.product-form.product-form-wide { grid-template-columns: 1fr; }
.gallery { display: grid; gap: 8px; padding: 12px; border-radius: 16px; border: 1px dashed var(--line); background: var(--surface-2); transition: border-color .15s, background .15s; }
.gallery.is-over { border-color: var(--accent); background: var(--accent-soft); }
.gallery-head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.gallery-skel { aspect-ratio: 1; border-radius: 12px; }
.gallery-tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--line-2); border: 2px solid transparent; }
.gallery-tile.is-cover { border-color: var(--accent); }
.gallery-tile img { width: 100%; height: 100%; object-fit: cover; }
.cover-tag { position: absolute; left: 6px; bottom: 6px; height: 18px; font-size: 10px; }
.tile-tools { position: absolute; top: 4px; right: 4px; display: flex; gap: 4px; }
.tile-btn { width: 26px; height: 26px; border-radius: 8px; border: 0; background: rgba(255,255,255,.92); color: #17140f; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); }
.tile-btn:hover { background: #fff; color: var(--accent); }
.gallery-add { aspect-ratio: 1; border-radius: 12px; border: 2px dashed var(--line); background: var(--surface); color: var(--muted); display: grid; place-content: center; justify-items: center; gap: 4px; font-size: 12px; font-weight: 650; cursor: pointer; }
.gallery-add:hover { border-color: var(--accent); color: var(--accent); }
.gallery-add.is-busy { opacity: .6; pointer-events: none; }

/* Pagos y entrega */
.settings-stack { display: grid; gap: 18px; max-width: 820px; }
.sec-title { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.sec-title > .icon { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.sec-title h3 { font-size: 18px; }
.qr-upload { display: flex; gap: 16px; align-items: center; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.qr-upload img, .qr-empty { width: 110px; height: 110px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
.qr-empty { display: grid; place-content: center; justify-items: center; color: var(--muted); background: var(--surface); }
.qr-upload .grid-stack { gap: 6px; }
.day-row { display: grid; grid-template-columns: 150px 1fr auto 1fr; gap: 10px; align-items: center; }
.day-row .input { height: 40px; }
.day-row .input:disabled { opacity: .45; }
@media (max-width: 520px) { .day-row { grid-template-columns: 1fr 1fr auto 1fr; font-size: 13px; } .day-row .switch { gap: 6px; } }
.sticky-save { position: sticky; bottom: 76px; z-index: 5; display: flex; justify-content: flex-end; }
@media (min-width: 1000px) { .sticky-save { bottom: 16px; } }
.sticky-save .btn { box-shadow: var(--shadow-lg); }

.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; }
.bottom-nav a { position: relative; }
.bottom-nav .nav-badge { position: absolute; top: 2px; right: calc(50% - 22px); margin: 0; min-width: 18px; height: 18px; font-size: 10px; }

/* Estadísticas */
.chart-card { margin-top: 18px; }
.chart-card h3 { font-size: 17px; }
.chart-box { margin-top: 12px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar { fill: var(--ink-2); transition: opacity .15s; }
.chart.is-accent .bar { fill: var(--accent); }
.chart .bar:hover { opacity: .75; }
.chart-skel { height: 180px; border-radius: 12px; }
.chart-empty { padding: 30px 0; text-align: center; }
.dash-grid.two-even { grid-template-columns: 1fr; }
@media (min-width: 1000px) { .dash-grid.two-even { grid-template-columns: 1fr 1fr; } }
.rank { width: 26px; height: 26px; border-radius: 8px; background: var(--line-2); display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.pad { padding: 18px 22px; }


/* Menú "Más" (celular) */
.menu-grid { display: grid; gap: 10px; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-decoration: none; border-radius: 16px; }
.menu-item .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.menu-item > span:nth-child(2) { flex: 1; display: grid; }
.menu-item small { color: var(--muted); font-size: 12.5px; }
.sidebar { overflow-y: auto; }
.nav a .nav-badge { margin-left: auto; }

.panel-title { display: flex; align-items: center; gap: 4px; }
.checkout-pad { padding: 12px 20px; }
.checkout-form { gap: 14px; }
.radio-cards { display: grid; gap: 8px; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); cursor: pointer; transition: border-color .15s, background .15s; }
.radio-card:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.radio-card input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.rc-body { display: grid; gap: 2px; }
.rc-body small { color: var(--muted); font-size: 12.5px; }

/* =============================================================
   PRESTACONTROL — componentes del SaaS de préstamos
   ============================================================= */

/* Color propio del negocio (funcionalidad "Personalización") */
.has-brand { --accent-hover: color-mix(in srgb, var(--accent) 86%, #000); --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--surface)); }

/* Marca del negocio (logo o inicial) */
.biz-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.biz-brand b { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.biz-logo { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-2); }
.biz-initials { display: grid; place-items: center; background: var(--ink); color: var(--bg); font-family: var(--display); font-weight: 800; font-size: 18px; box-shadow: inset 0 -3px 0 var(--accent); }
.auth-aside .biz-brand { color: #fff; }
.auth-aside .biz-initials { background: #fff; color: #17140f; box-shadow: inset 0 -3px 0 #17140f; }
.auth-card .biz-brand.dark { display: none; }
@media (max-width: 959px) { .auth-card .biz-brand.dark { display: flex; } }
.has-brand .auth-aside.biz-aside { background: radial-gradient(90% 70% at 100% 0%, rgba(255,255,255,.25), transparent 60%), radial-gradient(80% 60% at 0% 100%, rgba(0,0,0,.25), transparent 60%), var(--accent); }
.forgot { font-size: 14px; color: var(--muted); }
.forgot summary { cursor: pointer; color: var(--accent); font-weight: 650; list-style: none; text-align: center; }
.forgot summary::-webkit-details-marker { display: none; }
.forgot p { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.nav-skel { height: 42px; border-radius: 12px; }
.back-btn { margin-right: -4px; }

/* Landing: tarjeta de ejemplo */
.hero-card { padding: 22px; display: grid; gap: 14px; box-shadow: var(--shadow-lg); max-width: 460px; justify-self: center; width: 100%; }
.hc-head { display: flex; gap: 12px; align-items: center; }
.hc-head b { display: block; font-family: var(--display); font-size: 18px; }
.hc-head small { color: var(--muted); }
.hc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hc-stats > div { padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); display: grid; gap: 2px; }
.hc-stats small { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.hc-stats b { font-family: var(--display); font-size: 18px; }
.hc-stats b.is-warn { color: var(--warn); }
.hc-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); font-size: 14px; }
.hc-row b { margin-left: auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--success); }
.dot.late { background: var(--danger); }
@media (max-width: 480px) { .hc-stats { grid-template-columns: 1fr 1fr; } .hc-stats > div:last-child { grid-column: 1 / -1; } }

/* Estados comerciales y de negocio */
.st { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-free { background: #e8f1ff; color: #1d4ed8; }
.st-trial { background: #f1eaff; color: #6d28d9; }
.st-active { background: var(--success-soft); color: var(--success); }
.st-pending { background: var(--warn-soft); color: var(--warn); }
.st-expired { background: var(--danger-soft); color: var(--danger); }
.st-suspended { background: var(--ink); color: var(--bg); }
.st-cancelled, .st-inactive { background: var(--line-2); color: var(--muted); }
:root[data-theme="dark"] .st-free { background: #13233f; color: #7aa7ff; }
:root[data-theme="dark"] .st-trial { background: #241640; color: #b794ff; }

/* Tarjetas de KPI con detalle */
.kpi-sub { color: var(--muted); font-size: 12.5px; }
.kpi-sub b { color: var(--ink-2); }
.money { font-variant-numeric: tabular-nums; }

/* Pestañas */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; height: 42px; padding: 0 14px; border: 0; background: none; color: var(--muted); font-weight: 650; font-size: 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }

/* Cabecera de ficha (negocio / plan) */
.profile-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.profile-head .biz-logo { width: 56px; height: 56px; border-radius: 16px; font-size: 22px; }
.profile-head .grow { flex: 1; min-width: 200px; display: grid; gap: 4px; }
.profile-head h2 { font-size: 24px; }
.profile-head .meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13.5px; }
.profile-head .meta a { color: var(--ink-2); font-weight: 600; }
.url-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); border: 1px dashed var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none; }

/* Constructor de planes */
.plan-editor { display: grid; gap: 18px; align-items: start; }
@media (min-width: 1150px) { .plan-editor { grid-template-columns: minmax(0, 1fr) 360px; } }
.plan-editor > .grid-stack { min-width: 0; }
.step-card { scroll-margin-top: 80px; }
.step-card .sec-title .num { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 800; flex: none; font-family: var(--display); }
.step-card .sec-title p { margin-top: 2px; }
.plan-aside { display: grid; gap: 14px; }
@media (min-width: 1150px) { .plan-aside { position: sticky; top: 84px; } }

.feat-groups { display: grid; gap: 18px; }
.feat-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.feat-group-head h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-family: var(--font); font-weight: 750; }
.feat-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.feat-card { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 14px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; text-align: left; }
.feat-card:hover { border-color: var(--ink-2); }
.feat-card.is-on { border-color: var(--success); background: color-mix(in srgb, var(--success) 6%, var(--surface)); }
.feat-card.is-off-global { opacity: .55; }
.feat-card .fc-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); }
.feat-card.is-on .fc-ic { background: var(--success-soft); color: var(--success); }
.feat-card > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.feat-card b { display: block; font-size: 14px; line-height: 1.3; }
.feat-card small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.4; }
.feat-card .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.feat-card input { position: absolute; opacity: 0; pointer-events: none; }
.feat-card .switch input { position: relative; opacity: 1; pointer-events: none; }

.limit-rows { display: grid; gap: 10px; }
.limit-row { display: grid; grid-template-columns: 1fr 150px auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); }
.limit-row b { display: block; font-size: 14px; }
.limit-row small { color: var(--muted); font-size: 12.5px; }
.limit-row .input { height: 40px; }
.limit-row .input:disabled { opacity: .45; }
@media (max-width: 560px) { .limit-row { grid-template-columns: 1fr 1fr; } .limit-row > div:first-child { grid-column: 1 / -1; } }

/* Vista previa del plan (como lo verá el negocio) */
.preview { border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.preview-top { padding: 20px; background: var(--ink); color: var(--bg); display: grid; gap: 4px; }
.preview-top small { opacity: .7; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.preview-top b { font-family: var(--display); font-size: 24px; }
.preview-top .price { font-family: var(--display); font-size: 30px; font-weight: 800; }
.preview-top .price small { font-size: 14px; text-transform: none; letter-spacing: 0; opacity: .7; }
.preview-body { padding: 16px 18px; display: grid; gap: 12px; font-size: 13.5px; }
.preview-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.preview-list li { display: flex; gap: 8px; align-items: flex-start; }
.preview-list li .icon { margin-top: 1px; }
.preview-list li.is-yes .icon { color: var(--success); }
.preview-list li.is-no { color: var(--muted); text-decoration: line-through; }
.preview-list li.is-no .icon { color: var(--muted); }
.preview-list li.is-soon { color: var(--muted); }
.preview-h { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 750; }
.summary-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.summary-kv dt { color: var(--muted); }
.summary-kv dd { margin: 0; font-weight: 650; text-align: right; }

/* Selector de 3 estados para excepciones (Según plan | Activar | Desactivar) */
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--line-2); gap: 2px; flex: none; }
.seg button { height: 30px; padding: 0 10px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-weight: 650; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.seg button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg button.is-active.on { color: var(--success); }
.seg button.is-active.off { color: var(--danger); }
.ovr-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 22px; border-bottom: 1px solid var(--line-2); }
.ovr-row:last-child { border-bottom: 0; }
.ovr-row b { display: block; font-size: 14px; }
.ovr-row small { color: var(--muted); font-size: 12.5px; }
.ovr-row .eff { width: 92px; text-align: right; }
@media (max-width: 640px) { .ovr-row { grid-template-columns: 1fr auto; } .ovr-row .seg { grid-column: 1 / -1; justify-self: start; } .ovr-row .eff { grid-row: 1; grid-column: 2; } }
.group-label { padding: 14px 22px 6px; font-size: 11.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line-2); }

/* Tarjetas de planes (listado) */
.plan-tile { position: relative; }
.plan-tile .plan-tile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.plan-tile h3 { font-size: 20px; }
.plan-tile .desc { color: var(--muted); font-size: 13.5px; min-height: 20px; }
.plan-tile .chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.plan-tile .tile-actions { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--line-2); margin-top: 4px; }
.mini-stat { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 650; color: var(--ink-2); }

/* Bloque de credenciales */
.cred { display: grid; gap: 10px; padding: 16px; border-radius: 16px; border: 1px dashed var(--line); background: var(--surface-2); }
.cred-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; font-size: 14px; }
.cred-row span { color: var(--muted); }
.cred-row code { font-size: 15px; font-weight: 700; padding: 4px 10px; }

/* Usuarios y medidores */
.user-row .avatar { width: 40px; height: 40px; font-size: 14px; }
.user-row.is-disabled { opacity: .55; }
.usage-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.usage-card { padding: 16px 18px; }
.usage-card .meter .row b.unl { color: var(--success); }
.lock-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.lock-note .icon { color: var(--muted); flex: none; margin-top: 1px; }

/* Pantalla de bloqueo del negocio */
.blocked-card { max-width: 520px; margin: 40px auto; padding: 32px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.blocked-card .empty-icon { background: var(--danger-soft); color: var(--danger); }

/* Ajustes varios */
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form-section { display: grid; gap: 14px; }
.form-section + .form-section { padding-top: 18px; border-top: 1px solid var(--line-2); }
.form-section h4 { font-size: 15px; }
.hint { color: var(--muted); font-size: 12.5px; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.danger-zone h3 { color: var(--danger); }
.payment-row.is-void { opacity: .5; text-decoration: line-through; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-12 { margin-top: 12px; } .mt-18 { margin-top: 18px; }
.ev-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.changes { margin-top: 6px; display: grid; gap: 2px; font-size: 12.5px; color: var(--ink-2); }
.changes span { display: block; }
.changes s { color: var(--muted); }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 13.5px; }
.bar-row .bar { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.affix { display: flex; align-items: stretch; }
.affix > span { flex: 0 1 auto; display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px; background: var(--surface-2); color: var(--muted); font-size: 13.5px; white-space: nowrap; max-width: 62%; overflow: hidden; text-overflow: ellipsis; }
.affix > input { flex: 1 1 140px; }
.affix > input { border-radius: 0 12px 12px 0 !important; min-width: 0; }
.link-row { text-decoration: none; color: inherit; }

/* ===================== Fase 2 · Préstamos ===================== */
.list-row .avatar, .loan-item .avatar, .picked .avatar, .pick-item .avatar, .lh-name .avatar { width: 40px; height: 40px; font-size: 14px; }
.avatar.is-danger { background: var(--danger-soft); color: var(--danger); }
.avatar-lg { width: 64px; height: 64px; border-radius: 18px; font-size: 22px; }
.ev-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.text-danger { color: var(--danger); }
.text-right { text-align: right; }
.st-paid { background: #e8f1ff; color: #1d4ed8; }
:root[data-theme="dark"] .st-paid { background: #13233f; color: #7aa7ff; }
.row-btn { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line-2); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.row-btn:hover { background: var(--surface-2); }
.is-void { opacity: .55; }
.is-void b { text-decoration: line-through; }
.summary-kv.left dd { text-align: left; }
.card-head.flat { padding: 0 0 14px; border: 0; }

/* Barra de progreso */
.progress { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin: 8px 0 6px; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #ff8a5c); transition: width .6s var(--ease); }
.progress.lg { height: 12px; margin: 16px 0 8px; }

/* Fila de préstamo */
.loan-item { display: flex; align-items: flex-start; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--line-2); }
.loan-item:last-child { border-bottom: 0; }
.loan-item .loan-row { padding: 0; border: 0; flex: 1; }
.loan-row { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--line-2); min-width: 0; }
.loan-row:last-child { border-bottom: 0; }
.loan-row > .grow { flex: 1; min-width: 0; display: block; color: inherit; text-decoration: none; }
.loan-row small { display: block; font-size: 12.5px; }
.lr-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 2px; }
.lr-top b { font-size: 14.5px; }

/* Cobro: cotización */
.quote-box { display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.quote-line { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--ink-2); }
.quote-line.is-warn b { color: var(--warn); }
.quote-line.is-danger b { color: var(--danger); }
.quote-line.is-total { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 2px; font-size: 15px; color: var(--ink); }
.quick-amounts { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-amounts button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; }
.quick-amounts button:hover, .quick-amounts button.is-active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
input.amount-input { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -.02em; height: 56px; }

/* Selector de cliente */
.client-pick { display: grid; gap: 10px; }
.pick-results { display: grid; gap: 6px; }
.pick-results:empty { display: none; }
.pick-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%; }
.pick-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.pick-item:disabled { opacity: .5; cursor: not-allowed; }
.pick-item .grow, .picked .grow { flex: 1; min-width: 0; }
.pick-item b, .picked b { display: block; font-size: 14px; }
.pick-item small { color: var(--muted); font-size: 12px; }
.picked { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--accent); }
.picked small { display: block; }

/* Tablas de cronograma */
.mini-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 14px; }
.mini-table th { text-align: left; color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.mini-table td { padding: 6px 4px; border-bottom: 1px solid var(--line-2); }
.mini-table .center { text-align: center; }
.sched tr.is-paid td { color: var(--muted); }
.sched tr.is-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

/* Ficha del préstamo */
.loan-hero { padding: 22px; margin-bottom: 18px; }
.lh-client { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lh-name { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.lh-name b { display: block; font-size: 16px; }
.lh-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.lh-stats > div { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line-2); min-width: 0; }
.lh-stats small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lh-stats b { font-family: var(--display); font-size: 20px; letter-spacing: -.02em; }
.lh-stats .is-danger { background: var(--danger-soft); border-color: transparent; }
.lh-stats .is-danger b { color: var(--danger); }
.btn-wa { background: #25d366; color: #fff; border-color: #25d366; }
.btn-wa:hover { background: #1fb457; }

/* Por cobrar */
.due-row .grow { color: inherit; text-decoration: none; }
.due-row.is-late { background: linear-gradient(90deg, var(--danger-soft), transparent 40%); }
.due-row .text-right small { display: block; font-size: 12px; }

/* Caja */
.cash-hero { padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; background: linear-gradient(135deg, var(--surface) 55%, var(--accent-soft)); }
.cash-amount { font-family: var(--display); font-size: 40px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; margin: 4px 0; }

/* Gráfico de barras */
.day-bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 150px; }
.day-bar { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.day-bar i { width: 100%; max-width: 28px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--accent), #ff8a5c); transition: height .6s var(--ease); }
.day-bar small { font-size: 10.5px; color: var(--muted); }

/* Recibo */
.receipt { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; background: #fff; color: #111; border: 1px dashed #cfcac2; border-radius: 12px; padding: 18px; max-width: 360px; margin: 0 auto; position: relative; }
.rc-head { text-align: center; display: grid; gap: 2px; margin-bottom: 10px; }
.rc-biz { font-size: 16px; }
.rc-head small { color: #555; }
.rc-title { display: flex; justify-content: space-between; border-top: 1px solid #111; border-bottom: 1px solid #111; padding: 6px 0; margin: 8px 0; font-weight: 700; }
.rc-void { text-align: center; color: #c0261b; font-weight: 800; border: 2px solid #c0261b; border-radius: 6px; padding: 4px; margin: 6px 0; }
.receipt.is-void { opacity: 1; }
.receipt.is-void b { text-decoration: none; }
.rc-row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.rc-row span { color: #555; }
.rc-row b { text-align: right; }
.rc-sep { border-top: 1px dashed #999; margin: 8px 0; }
.rc-total { display: flex; justify-content: space-between; font-size: 16px; font-weight: 800; padding: 4px 0; }
.rc-note { text-align: center; color: #555; margin-top: 10px; font-size: 12px; }

@media (max-width: 720px) {
  .lh-stats { grid-template-columns: 1fr 1fr; }
  .cash-amount { font-size: 32px; }
  .loan-item { padding: 14px 16px; }
  .loan-row { flex-wrap: wrap; }
  .due-row { flex-wrap: wrap; }
  .due-row .grow { flex-basis: calc(100% - 60px); }
  .due-row .text-right { margin-left: 54px; text-align: left; flex: 1; }
  .day-bars { gap: 3px; }
}

@media print {
  body.printing-receipt > *:not(dialog) { display: none !important; }
  body.printing-receipt dialog.modal { position: static; box-shadow: none; border: 0; width: auto; max-height: none; }
  body.printing-receipt dialog.modal::backdrop { background: none; }
  body.printing-receipt .modal-head, body.printing-receipt .modal-foot { display: none !important; }
  body.printing-receipt .receipt { border: 0; max-width: 80mm; padding: 0; }
}
.toolbar .input[type=date] { flex: 0 0 168px; width: 168px; }
.toolbar > .select { flex: 0 1 220px; width: auto; }
@media (max-width: 720px) { .toolbar .input[type=date] { flex: 1 1 140px; width: auto; } .toolbar > .select { flex: 1 1 100%; } }
/* Cronograma compacto en celular: N° · fecha · cuota / estado · mora */
@media (max-width: 700px) {
  .table.sched tr { display: grid; grid-template-columns: 30px 1fr auto; gap: 2px 10px; align-items: center; padding: 10px 14px; }
  .table.sched td { padding: 0; width: auto; }
  .table.sched td[data-label]::before { display: none; }
  .table.sched td:nth-child(1) { grid-row: span 2; }
  .table.sched td:nth-child(4), .table.sched td:nth-child(5), .table.sched td:nth-child(6) { display: none; }
  .table.sched td:nth-child(3) { text-align: right; }
  .table.sched td:nth-child(7) { grid-column: 3; grid-row: 2; text-align: right; font-size: 12px; }
  .table.sched td:nth-child(7):not(.text-danger) { visibility: hidden; }
  .table.sched td:nth-child(8) { grid-column: 2; grid-row: 2; }
  .sched tr.is-overdue td:first-child { box-shadow: none; color: var(--danger); }
}

/* ===================== Garantías ===================== */
.toggle-card { transition: border-color .2s, box-shadow .2s; }
.toggle-card.is-on { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.toggle-head { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.toggle-head .grow { flex: 1; min-width: 0; }
.toggle-head b { display: block; font-size: 15.5px; }
.toggle-head small { display: block; font-size: 13px; }
.toggle-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; transition: transform .3s var(--ease); }
.toggle-card.is-on .toggle-ic { transform: rotate(-8deg) scale(1.06); background: var(--accent); color: #fff; }
.toggle-body { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); animation: fadeIn .25s; }
/* Interruptor grande estilo iOS */
.switch-xl { position: relative; width: 56px; height: 32px; flex: none; }
.switch-xl input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch-xl i { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .25s; }
.switch-xl i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .3s var(--ease); }
.switch-xl input:checked + i { background: var(--accent); }
.switch-xl input:checked + i::after { transform: translateX(24px); }
.switch-xl input:focus-visible + i { outline: 3px solid var(--accent-soft); outline-offset: 2px; }

.type-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.type-chip { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; transition: all .15s; }
.type-chip:hover { border-color: var(--ink-2); }
.type-chip.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.photo-tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--line-2); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile img.is-loading { opacity: 0; }
.photo-tile img.is-broken { opacity: .2; }
.photo-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.photo-del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.photo-add { aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--line); background: var(--surface-2); color: var(--ink-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.photo-add:hover { border-color: var(--accent); color: var(--accent); }

.guarantee-card { padding: 18px; display: grid; gap: 14px; }
.gc-head { display: flex; align-items: center; gap: 12px; }
.gc-head .grow { flex: 1; min-width: 0; }
.gc-head b { display: block; font-size: 15px; }
.gc-head small { display: block; font-size: 12.5px; }
.gc-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.gc-details { margin: 0; font-size: 13.5px; color: var(--ink-2); white-space: pre-line; }
.gc-actions { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--line-2); padding-top: 12px; }

.g-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.g-item { display: grid; color: inherit; text-decoration: none; overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s; }
.g-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.g-cover { position: relative; aspect-ratio: 16 / 10; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.g-cover img { width: 100%; height: 100%; object-fit: cover; }
.g-count { position: absolute; bottom: 8px; right: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 700; }
.g-info { padding: 14px 16px; display: grid; gap: 4px; }
.g-info small { font-size: 12.5px; }

dialog.modal.modal-lg { width: min(860px, calc(100vw - 24px)); }
.lightbox { display: grid; gap: 12px; }
.lightbox-stage { display: grid; place-items: center; background: #000; border-radius: 12px; min-height: 240px; }
.lightbox-img { max-width: 100%; max-height: 70vh; object-fit: contain; }
.lightbox-nav { display: flex; align-items: center; justify-content: space-between; }

/* ===================== Notificaciones ===================== */
.bell-wrap { position: relative; }
.bell-btn { position: relative; }
.bell-btn.has-unread svg { animation: bellRing 1.2s var(--ease) 1; transform-origin: 50% 10%; }
@keyframes bellRing { 0%,100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } }
.bell-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.notif-panel { position: absolute; right: 0; top: calc(100% + 10px); width: min(400px, calc(100vw - 24px)); max-height: min(70vh, 560px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 60; overflow: hidden; animation: modalIn .2s var(--ease); }
.notif-panel[hidden] { display: none; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.notif-head b { font-size: 16px; }
.notif-list { overflow-y: auto; flex: 1; }
.notif-group { padding: 10px 16px 4px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.notif-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.notif-item .grow { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.notif-item .grow b { display: block; font-size: 13.5px; }
.notif-item .grow small { display: block; font-size: 12.5px; color: var(--muted); }
.notif-item:hover { background: var(--surface-2); }
.notif-item.is-read { opacity: .6; }
.notif-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.notif-item.is-danger .notif-ic { background: var(--danger-soft); color: var(--danger); }
.notif-item.is-warn .notif-ic { background: var(--warn-soft); color: var(--warn); }
.notif-item.is-info .notif-ic { background: #e8f1ff; color: #1d4ed8; }
:root[data-theme="dark"] .notif-item.is-info .notif-ic { background: #13233f; color: #7aa7ff; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.notif-push { display: flex; align-items: center; gap: 10px; width: calc(100% - 24px); margin: 12px; padding: 10px 12px; border-radius: var(--radius); border: 1px dashed var(--accent); background: var(--accent-soft); color: var(--accent); font: inherit; text-align: left; cursor: pointer; }
.notif-push b { display: block; font-size: 13.5px; }
.notif-push small { display: block; font-size: 12px; color: var(--ink-2); }
.notif-empty { display: grid; justify-items: center; gap: 6px; padding: 32px 16px; text-align: center; }
.notif-foot { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 12px; font-size: 13px; font-weight: 700; color: var(--accent); text-decoration: none; border-top: 1px solid var(--line-2); }
@media (max-width: 560px) { .notif-panel { position: fixed; left: 12px; right: 12px; top: 72px; width: auto; } }

/* ===================== Instalar app (PWA) ===================== */
.install-slot:empty { display: none; }
.install-card { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: linear-gradient(120deg, var(--surface) 40%, var(--accent-soft)); }
.install-card .grow { flex: 1; min-width: 0; }
.install-card b { display: block; }
.install-card small { display: block; font-size: 12.5px; }
.install-ic { width: 46px; height: 46px; border-radius: 12px; flex: none; }
.install-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: 14.5px; }
.mb-12 { margin-bottom: 12px; }
@media (max-width: 560px) { .install-card { flex-wrap: wrap; } .install-card .inline-actions { width: 100%; justify-content: flex-end; } }

/* ===================== Foto de perfil ===================== */
.store-pill[role="link"] { cursor: pointer; transition: border-color .15s; }
.store-pill[role="link"]:hover { border-color: var(--ink-2); }
.profile-photo { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.avatar-edit { position: relative; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 24px; }
.avatar-xl { width: 84px; height: 84px; border-radius: 24px; font-size: 30px; }
.avatar-cam { position: absolute; right: -4px; bottom: -4px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; border: 3px solid var(--surface); }
.user-row .avatar img, .list-row .avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ===================== Asistente ===================== */
.ai-orb { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; background: conic-gradient(from 210deg, #ff5a36, #ff9a5c, #7c3aed, #2563eb, #ff5a36); box-shadow: 0 4px 14px -4px rgba(255, 90, 54, .6); }
.ai-orb.sm { width: 26px; height: 26px; border-radius: 9px; }
.ai-orb.lg { width: 44px; height: 44px; border-radius: 14px; }
.ai-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #f1eaff; color: #6d28d9; }
.ai-badge[hidden] { display: none; }

.explain-card { padding: 18px; display: grid; gap: 12px; background: linear-gradient(160deg, var(--surface) 55%, #f6f1ff); }
:root[data-theme="dark"] .explain-card { background: linear-gradient(160deg, var(--surface) 55%, #221a33); }
.explain-head { display: flex; align-items: center; gap: 10px; }
.explain-head small { margin-left: auto; }

.rich { display: grid; gap: 4px; font-size: 14px; line-height: 1.5; }
.rich p { margin: 0; }
.rich-li { display: flex; gap: 8px; }
.rich-bul { color: var(--accent); font-weight: 800; flex: none; min-width: 10px; }
.rich-gap { height: 6px; }

.chat { display: flex; flex-direction: column; height: calc(100dvh - 190px); min-height: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.chat.is-compact { height: 100%; min-height: 0; border: 0; border-radius: 0; }
.chat-top { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.chat-top .grow { flex: 1; min-width: 0; }
.chat-top b { display: block; font-size: 16px; }
.chat-top small { display: block; font-size: 12.5px; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.chat-msg { display: flex; gap: 10px; align-items: flex-end; max-width: 88%; animation: fadeIn .25s; }
.chat-msg.is-user { align-self: flex-end; }
.chat-bubble { padding: 12px 14px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line-2); display: grid; gap: 10px; min-width: 0; }
.chat-msg.is-assistant .chat-bubble { border-bottom-left-radius: 6px; }
.chat-msg.is-user .chat-bubble { background: var(--ink); color: var(--bg); border-color: transparent; border-bottom-right-radius: 6px; }
.chat-msg.is-user .chat-bubble p { margin: 0; white-space: pre-wrap; }
.chat-msg.is-error .chat-bubble { background: var(--danger-soft); color: var(--danger); }
.chat-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-src { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: #6d28d9; }
.chat-chips { display: flex; gap: 6px; padding: 0 18px 10px; overflow-x: auto; scrollbar-width: none; }
.chat-chips:empty { display: none; }
.chat-chips .chip { white-space: nowrap; flex: none; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-2); background: var(--surface); }
.chat-input { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 16px; padding: 11px 14px; font: inherit; font-size: 15px; background: var(--surface-2); color: var(--ink); outline: none; max-height: 120px; }
.chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat-send { width: 46px; height: 46px; padding: 0; border-radius: 14px; flex: none; }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

.ai-fab { position: fixed; z-index: 45; right: 18px; bottom: calc(84px + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 18px 0 14px; border: 0; border-radius: 99px; color: #fff; font: inherit; font-weight: 750; font-size: 14px; cursor: pointer;
  background: linear-gradient(135deg, #ff5a36, #ff7a45 45%, #7c3aed); box-shadow: 0 10px 30px -8px rgba(124, 58, 237, .55), 0 6px 16px -6px rgba(255, 90, 54, .6); transition: transform .2s var(--ease), opacity .2s; }
.ai-fab:hover { transform: translateY(-2px) scale(1.02); }
.ai-fab.is-hidden, .ai-fab[hidden] { display: none; }
@media (min-width: 1000px) { .ai-fab { bottom: 24px; right: 24px; } }
@media (max-width: 560px) { .ai-fab { width: 52px; height: 52px; padding: 0; justify-content: center; } .ai-fab span { display: none; } }
.ai-panel { position: fixed; z-index: 70; right: 16px; bottom: 16px; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 32px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg); overflow: hidden;
  opacity: 0; transform: translateY(20px) scale(.98); pointer-events: none; transition: opacity .25s, transform .3s var(--ease); }
.ai-panel.is-open { opacity: 1; transform: none; pointer-events: auto; }
.ai-panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line-2); }
.ai-panel .chat { flex: 1; }
@media (max-width: 560px) { .ai-panel { inset: 0; width: 100%; height: 100dvh; border-radius: 0; } }

.help-box { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line-2); font-size: 13.5px; }
.help-box summary { cursor: pointer; font-weight: 700; }
.help-box ol { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.app .content { padding-bottom: 96px; }
@media (max-width: 560px) { .type-chips { grid-template-columns: repeat(3, 1fr); } .type-chip { padding: 10px 4px; font-size: 11.5px; } }
.g-cover { overflow: hidden; } .g-cover img { position: absolute; inset: 0; }
.rich-li.is-link { cursor: pointer; border-radius: 8px; padding: 2px 6px; margin: 0 -6px; transition: background .15s; } .rich-li.is-link:hover, .rich-li.is-link:focus-visible { background: var(--accent-soft); color: var(--accent); outline: none; }
.chat-suggest { display: grid; gap: 6px; padding-top: 4px; border-top: 1px dashed var(--line); }
.chat-suggest small { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.chat-suggest-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.chat-suggest-btn:hover, .chat-suggest-btn:focus-visible { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); outline: none; }
.chat-suggest-btn svg { flex: none; opacity: .6; }
.chat-suggest.is-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } .chat-suggest.is-grid small { grid-column: 1 / -1; }

/* ===================== Cronograma compartido (página del cliente) ===================== */
body.sched-page { background: var(--bg); }
.sched-wrap { max-width: 860px; margin: 0 auto; padding: 24px 16px 48px; display: grid; gap: 14px; }
.sched-head { padding: 22px; display: grid; gap: 18px; border-top: 5px solid var(--accent); }
.sched-biz { display: flex; align-items: center; gap: 12px; }
.sched-biz .biz-logo { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-weight: 800; font-size: 20px; }
.sched-biz b { display: block; font-size: 17px; }
.sched-biz small { color: var(--muted); font-size: 12.5px; }
.sched-title small { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; color: var(--accent); }
.sched-title h1 { font-family: var(--display); font-size: 26px; margin: 2px 0 6px; letter-spacing: -.02em; }
.sched-title p { margin: 0; color: var(--ink-2); }
.sched-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sched-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sched-stats .card { padding: 14px 16px; display: grid; gap: 4px; }
.sched-stats small { color: var(--muted); font-size: 12px; font-weight: 600; }
.sched-stats b { font-family: var(--display); font-size: 19px; letter-spacing: -.02em; }
.sched-stats .is-danger { background: var(--danger-soft); border-color: transparent; }
.sched-stats .is-danger b { color: var(--danger); }
.sched-progress { padding: 14px 18px; }
.sched-progress .progress { margin-top: 0; }
.sched-notes { font-size: 13px; color: var(--ink-2); padding: 0 4px; }
.sched-notes p { margin: 0 0 6px; }
@media (max-width: 640px) { .sched-stats { grid-template-columns: 1fr 1fr; } .sched-title h1 { font-size: 22px; } .sched-actions .btn { flex: 1; } }
@media print { .sched-actions { display: none; } body.sched-page { background: #fff; } }
.progress i.w-0 { width: 0%; }
.progress i.w-5 { width: 5%; }
.progress i.w-10 { width: 10%; }
.progress i.w-15 { width: 15%; }
.progress i.w-20 { width: 20%; }
.progress i.w-25 { width: 25%; }
.progress i.w-30 { width: 30%; }
.progress i.w-35 { width: 35%; }
.progress i.w-40 { width: 40%; }
.progress i.w-45 { width: 45%; }
.progress i.w-50 { width: 50%; }
.progress i.w-55 { width: 55%; }
.progress i.w-60 { width: 60%; }
.progress i.w-65 { width: 65%; }
.progress i.w-70 { width: 70%; }
.progress i.w-75 { width: 75%; }
.progress i.w-80 { width: 80%; }
.progress i.w-85 { width: 85%; }
.progress i.w-90 { width: 90%; }
.progress i.w-95 { width: 95%; }
.progress i.w-100 { width: 100%; }
.sched-pub tr.is-paid td { color: var(--muted); }
.sched-pub tr.is-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
@media (max-width: 700px) {
  .table.sched-pub tr { display: grid; grid-template-columns: 30px 1fr auto; gap: 2px 10px; align-items: center; padding: 10px 14px; }
  .table.sched-pub td { padding: 0; width: auto; }
  .table.sched-pub td[data-label]::before { display: none; }
  .table.sched-pub td:nth-child(1) { grid-row: span 2; }
  .table.sched-pub td:nth-child(3) { text-align: right; }
  .table.sched-pub td:nth-child(4) { grid-column: 3; grid-row: 2; text-align: right; font-size: 12px; }
  .table.sched-pub td:nth-child(5) { grid-column: 2; grid-row: 2; }
}
/* Enviar cronograma */
.share-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 12px; border-radius: var(--radius); background: var(--accent-soft); border: 1px dashed var(--accent); font-size: 13.5px; }
.share-head { display: flex; align-items: center; gap: 12px; }
.share-head b { display: block; }
.share-head small { display: block; font-size: 12.5px; }
.share-doc { width: 46px; height: 54px; border-radius: 8px; display: grid; place-items: center; background: #fff1ec; color: var(--accent); border: 1px solid #ffd5c7; flex: none; }
.share-opts { display: grid; gap: 8px; }
.share-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.share-opt:hover { border-color: var(--ink-2); }
.share-opt .grow { flex: 1; min-width: 0; }
.share-opt b { display: block; font-size: 14px; }
.share-opt small { display: block; font-size: 12.5px; color: var(--muted); }
.share-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.share-opt.is-primary { border-color: #25d366; background: #effbf3; }
.share-opt.is-primary .share-ic { background: #25d366; color: #fff; }
:root[data-theme="dark"] .share-opt.is-primary { background: #11291a; }
/* Anular préstamo */
.void-warn { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius); background: var(--danger-soft); color: var(--danger); }
.void-warn b { display: block; color: var(--ink); }
.void-warn small { color: var(--ink-2); }
.void-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.void-banner { display: flex; gap: 12px; align-items: center; padding: 14px 18px; margin-bottom: 14px; border-radius: var(--radius-lg); background: var(--danger-soft); color: var(--danger); border: 1px solid #f5c2bd; }
.void-banner b { display: block; }
.void-banner small { color: var(--ink-2); }
:root[data-theme="dark"] .void-banner { border-color: transparent; }
.btn.text-danger { color: var(--danger); }
.chip-switch { margin-left: auto; font-size: 13px; }
.loan-hero.is-voided .lh-stats, .loan-hero.is-voided .progress { opacity: .45; filter: grayscale(1); }

/* ===================== Reportes ===================== */
.report-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.report-dates { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-dates .input { width: 158px; }
.export-wrap { position: relative; }
.export-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); display: grid; }
.export-menu[hidden] { display: none; }
.export-menu button { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 0; background: none; border-radius: 8px; font: inherit; font-size: 13.5px; color: var(--ink); text-align: left; cursor: pointer; }
.export-menu button:hover { background: var(--surface-2); }
.report-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.report-h h3 { font-size: 17px; }
.kpi-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.kpi { padding: 16px 18px; display: grid; gap: 4px; align-content: start; }
.kpi > small:first-child { color: var(--muted); font-size: 12.5px; font-weight: 650; }
.kpi > b { font-family: var(--display); font-size: 24px; letter-spacing: -.02em; font-weight: 750; }
.kpi.is-hero { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.kpi.is-hero > small:first-child, .kpi.is-hero .muted { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.kpi.is-hero > b { font-size: 28px; }
.delta { font-size: 12px; font-weight: 700; }
.delta.is-up { color: var(--success); }
.delta.is-down { color: var(--danger); }
.delta.is-flat { color: var(--muted); font-weight: 600; }
.kpi.is-hero .delta.is-up { color: #6ee7a0; }
.kpi.is-hero .delta.is-down { color: #ff9b8f; }
.meter-bar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin: 4px 0 2px; }
.meter-bar i { display: block; height: 100%; border-radius: 99px; }
.meter-bar i.is-good { background: var(--success); }
.meter-bar i.is-warn { background: var(--warn); }
.meter-bar i.is-bad { background: var(--danger); }
.status-txt { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; }
.status-txt.is-good { color: var(--success); }
.status-txt.is-warn { color: var(--warn); }
.status-txt.is-bad { color: var(--danger); }
.meter-bar i.w-0, .aging-track i.w-0 { width: 0%; }
.meter-bar i.w-5, .aging-track i.w-5 { width: 5%; }
.meter-bar i.w-10, .aging-track i.w-10 { width: 10%; }
.meter-bar i.w-15, .aging-track i.w-15 { width: 15%; }
.meter-bar i.w-20, .aging-track i.w-20 { width: 20%; }
.meter-bar i.w-25, .aging-track i.w-25 { width: 25%; }
.meter-bar i.w-30, .aging-track i.w-30 { width: 30%; }
.meter-bar i.w-35, .aging-track i.w-35 { width: 35%; }
.meter-bar i.w-40, .aging-track i.w-40 { width: 40%; }
.meter-bar i.w-45, .aging-track i.w-45 { width: 45%; }
.meter-bar i.w-50, .aging-track i.w-50 { width: 50%; }
.meter-bar i.w-55, .aging-track i.w-55 { width: 55%; }
.meter-bar i.w-60, .aging-track i.w-60 { width: 60%; }
.meter-bar i.w-65, .aging-track i.w-65 { width: 65%; }
.meter-bar i.w-70, .aging-track i.w-70 { width: 70%; }
.meter-bar i.w-75, .aging-track i.w-75 { width: 75%; }
.meter-bar i.w-80, .aging-track i.w-80 { width: 80%; }
.meter-bar i.w-85, .aging-track i.w-85 { width: 85%; }
.meter-bar i.w-90, .aging-track i.w-90 { width: 90%; }
.meter-bar i.w-95, .aging-track i.w-95 { width: 95%; }
.meter-bar i.w-100, .aging-track i.w-100 { width: 100%; }
/* Gráficos (paleta validada: s-1 prestado, s-2 cobrado) */
.viz-wrap { --s1: #ff5a36; --s2: #2563eb; --viz-grid: #ece8e1; --viz-tick: #8b857c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .viz-wrap { --s1: #ee5b3a; --s2: #5b8def; --viz-grid: #2f2b27; --viz-tick: #8f887e; } }
:root[data-theme="dark"] .viz-wrap { --s1: #ee5b3a; --s2: #5b8def; --viz-grid: #2f2b27; --viz-tick: #8f887e; }
.viz-canvas { position: relative; }
.viz { width: 100%; height: auto; display: block; overflow: visible; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; stroke-dasharray: 2 4; }
.viz-base { stroke: var(--viz-grid); stroke-width: 1; }
.viz-tick { fill: var(--viz-tick); font-size: 11px; font-family: var(--font); }
.viz-bar.s-1 { fill: var(--s1); }
.viz-bar.s-2 { fill: var(--s2); }
.viz-hit { fill: transparent; cursor: crosshair; }
.viz-hit.is-hover { fill: color-mix(in srgb, var(--ink) 5%, transparent); }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.viz-key.s-1 { background: var(--s1); }
.viz-key.s-2 { background: var(--s2); }
.viz-tip { position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 8px 10px; font-size: 12.5px; min-width: 150px; display: grid; gap: 4px; z-index: 5; }
.viz-tip[hidden] { display: none; }
.viz-tip-row { display: flex; align-items: center; gap: 6px; }
.viz-tip-row span { flex: 1; color: var(--ink-2); }
.proj-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 10px; font-size: 13.5px; }
/* Antigüedad: rampa secuencial de un solo tono (más días = más intenso) */
.aging { display: grid; gap: 10px; }
.aging-row { display: grid; grid-template-columns: 110px 1fr 110px 90px; align-items: center; gap: 12px; font-size: 13.5px; }
.aging-track { height: 14px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.aging-track i { display: block; height: 100%; border-radius: 99px; }
.seq-1 { background: #f6b3a8; } .seq-2 { background: #ef8a78; } .seq-3 { background: #e35d48; } .seq-4 { background: #c8321f; } .seq-5 { background: #8f1d11; }
.aging-row .money { text-align: right; }
@media (max-width: 640px) { .aging-row { grid-template-columns: 90px 1fr 90px; } .aging-row small { display: none; } }
/* Alertas */
.insight-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.insight { display: flex; gap: 12px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); }
.insight b { display: block; font-size: 14px; margin: 1px 0 3px; }
.insight p { margin: 0; font-size: 13px; color: var(--ink-2); }
.insight-lvl { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.insight-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.insight.is-bad { border-color: #f5c2bd; background: var(--danger-soft); } .insight.is-bad .insight-ic { background: var(--danger); color: #fff; } .insight.is-bad .insight-lvl { color: var(--danger); }
.insight.is-warn { border-color: #f3d9ae; background: var(--warn-soft); } .insight.is-warn .insight-ic { background: var(--warn); color: #fff; } .insight.is-warn .insight-lvl { color: var(--warn); }
.insight.is-good { border-color: #bfe5cb; background: var(--success-soft); } .insight.is-good .insight-ic { background: var(--success); color: #fff; } .insight.is-good .insight-lvl { color: var(--success); }
.insight.is-info .insight-ic { background: #2563eb; color: #fff; } .insight.is-info .insight-lvl { color: #2563eb; }
:root[data-theme="dark"] .insight { border-color: transparent; }
.rank { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 800; flex: none; }
.dash-grid.even { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user .avatar { width: 34px; height: 34px; font-size: 13px; }
.cell-user b { display: block; }
.print-head { display: none; }
@media print {
  body.printing-report .sidebar, body.printing-report .topbar, body.printing-report .bottom-nav, body.printing-report .ai-fab, body.printing-report .plan-banner, body.printing-report .report-bar { display: none !important; }
  body.printing-report .app { display: block; }
  body.printing-report .print-head { display: block; font-size: 16px; margin-bottom: 8px; }
  body.printing-report .card { break-inside: avoid; box-shadow: none; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px; }
  .kpi > b { font-size: 18px; }
  .kpi.is-hero { grid-column: 1 / -1; }
  .kpi.is-hero > b { font-size: 24px; }
  .report-dates .input { width: auto; flex: 1 1 120px; }
  .report-bar .chips { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  #page-actions .btn span { display: none; }
}

/* ---------- Filtros y paginación ---------- */
.chip-filter { display: inline-flex; align-items: center; gap: 6px; padding-right: 4px; }
.chip-x { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; border: 0; background: rgba(255,255,255,.22); color: inherit; cursor: pointer; }
.chip-x:hover { background: rgba(255,255,255,.4); }
.card.is-loading, .g-grid.is-loading { opacity: .55; transition: opacity .15s; pointer-events: none; }
.filter-bar > svg { color: var(--muted); }

/* ---------- Consulta RENIEC / SUNAT en el formulario de clientes ---------- */
.grid-doc { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid-doc { grid-template-columns: minmax(150px, 210px) 1fr; } }
.doc-input { position: relative; display: flex; gap: 8px; align-items: stretch; }
.doc-input input { flex: 1; min-width: 0; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.doc-input.is-searching input { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.doc-btn { flex: 0 0 auto; gap: 6px; }
.doc-btn[hidden] { display: none; }
.doc-btn.is-searching svg { animation: doc-scan 1s ease-in-out infinite; }
@keyframes doc-scan { 0%, 100% { transform: translateX(0) scale(1); } 50% { transform: translateX(2px) scale(1.12); } }
.doc-status { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px 8px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.45; background: var(--surface-2); color: var(--muted); }
.doc-status > svg { flex: 0 0 auto; margin-top: 1px; }
.doc-status:not(.is-busy) > span { flex: 1 1 0; min-width: 0; }
.doc-status.is-ok b { color: var(--ink); }
.doc-status.is-busy { background: var(--accent-soft); color: var(--accent); font-weight: 600; align-items: center; }
.doc-status.is-ok { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--ink-2); }
.doc-status.is-ok > svg { color: var(--success); }
.doc-status.is-warn { background: color-mix(in srgb, var(--warn, #d97706) 14%, transparent); color: var(--ink-2); }
.doc-status.is-error { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.doc-spinner { display: inline-grid; place-items: center; }
.doc-spinner svg { animation: doc-spin .8s linear infinite; }
@keyframes doc-spin { to { transform: rotate(360deg); } }
.doc-dots { display: inline-flex; gap: 3px; }
.doc-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: doc-dot 1s ease-in-out infinite; }
.doc-dots i:nth-child(2) { animation-delay: .15s; } .doc-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes doc-dot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.doc-existing { flex-basis: 100%; display: flex; gap: 6px; align-items: center; color: var(--danger); font-weight: 600; }
.doc-existing a { color: inherit; text-decoration: underline; }
input.autofilled { animation: autofill-flash 1.4s ease-out; }
@keyframes autofill-flash { 0% { background: color-mix(in srgb, var(--success) 22%, var(--surface)); border-color: var(--success); } 100% { } }
@media (prefers-reduced-motion: reduce) { .doc-spinner svg, .doc-dots i, .doc-btn.is-searching svg, input.autofilled { animation: none; } }

.doc-prov { padding: 14px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.doc-prov:first-child { border-top: 0; padding-top: 0; }
.doc-prov-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doc-prov-head .st { margin-left: auto; }
.doc-test h4 { margin: 0 0 8px; font-size: 14px; }

/* ---------- Contrato ---------- */
.small-note { font-size: 13px; line-height: 1.5; margin: 0; }
.share-doc.is-contract { background: #f3efe8; color: #8a6a3b; border-color: #e3d8c6; }
.letterhead-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .letterhead-grid { grid-template-columns: 1fr 1fr; } }
.lh-slot { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.lh-head { display: grid; gap: 2px; }
.lh-prev { min-height: 70px; border-radius: 10px; background: #fff; border: 1px dashed var(--line); display: grid; place-items: center; overflow: hidden; }
.lh-prev img { width: 100%; height: auto; display: block; }
.lh-empty { display: grid; justify-items: center; gap: 4px; color: var(--muted); padding: 14px; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 4px 10px; font: 600 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; cursor: pointer; }
.ph-chip:hover { border-color: var(--accent); color: var(--accent); }
.field textarea.contract-tpl { min-height: 380px; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; }
.help-box code { font-size: 12px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

/* ---------- Splash de la app instalada (PWA) ---------- */
.splash { display: none; }
.splash.is-on {
  --splash: #ff5a36;
  position: fixed; inset: 0; z-index: 10000; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: env(safe-area-inset-top) 24px env(safe-area-inset-bottom);
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--splash) 82%, #fff) 0%, var(--splash) 55%, color-mix(in srgb, var(--splash) 78%, #000) 100%);
  color: #fff; text-align: center; transition: opacity .4s ease, visibility .4s;
}
.splash.is-out { opacity: 0; visibility: hidden; }
.splash-center { display: grid; justify-items: center; gap: 10px; animation: splash-in .55s cubic-bezier(.2, .8, .2, 1) both; }
.splash-logo {
  width: 96px; height: 96px; border-radius: 28px; background: #fff; display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .22), 0 0 0 6px rgba(255, 255, 255, .18); margin-bottom: 8px; animation: splash-pop 1.8s ease-in-out .5s infinite;
}
.splash-logo img { width: 100%; height: 100%; object-fit: cover; }
.splash-logo span { font: 800 44px/1 var(--font-display, inherit); color: var(--splash); }
.splash-name { font-size: 22px; font-weight: 800; letter-spacing: -.01em; max-width: 280px; }
.splash-sub { font-size: 13px; opacity: .85; letter-spacing: .02em; }
.splash-bar { width: 120px; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .28); overflow: hidden; margin-top: 28px; }
.splash-bar i { display: block; width: 40%; height: 100%; border-radius: inherit; background: #fff; animation: splash-load 1.1s ease-in-out infinite; }
.splash-foot { position: absolute; bottom: calc(22px + env(safe-area-inset-bottom)); font-size: 11.5px; opacity: .7; }
@keyframes splash-in { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes splash-pop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes splash-load { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) { .splash-center, .splash-logo, .splash-bar i { animation: none; } }
/* Maqueta del membrete del contrato */
.lh-mock-wrap { display: grid; gap: 8px; margin-top: 4px; }
.lh-mock { position: relative; width: 100%; max-width: 300px; aspect-ratio: 210 / 297; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, .08); overflow: hidden; color: #1d2021; }
.lh-mock-band { position: absolute; top: 0; right: 0; width: 38.5%; height: 1.6%; clip-path: polygon(0 0, 100% 0, 100% 100%, 9% 100%); }
.lh-mock-logo { position: absolute; left: 9.4%; top: 2.2%; height: 5.6%; max-width: 46%; display: flex; align-items: center; }
.lh-mock-logo img { height: 100%; width: auto; max-width: 100%; object-fit: contain; }
.lh-mock-logo b { font-size: 11px; }
.lh-mock-body { position: absolute; left: 12%; right: 12%; top: 14%; display: grid; gap: 7px; }
.lh-mock-body span { height: 5px; border-radius: 3px; background: #ebe7e0; }
.lh-mock-body span:nth-child(1) { width: 60%; justify-self: center; background: #d6d0c6; }
.lh-mock-body span:nth-child(4) { width: 70%; }
.lh-mock-foot { position: absolute; left: 9.4%; right: 9.4%; bottom: 3.2%; font-size: 7px; }
.lh-mock-foot hr { border: 0; border-top: 1px solid #1d2021; margin: 0 0 5px; }
.lh-mock-foot div { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.lh-mock-foot span { display: inline-flex; align-items: center; gap: 4px; }
.lh-mock-foot .dot { width: 7px; height: 5px; border-radius: 1px; display: inline-block; }
.lh-mock-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 1.1%; background: #1d2021; }
.lh-prev img { max-height: 90px; width: auto; max-width: 100%; margin: 8px auto; }

.lh-mock-foot.is-img { left: 0; right: 0; bottom: 0; }
.lh-mock-foot.is-img img { display: block; width: 100%; height: auto; }
.lh-mock-foot.is-img ~ .lh-mock-bar { display: none; }

/* =====================================================================
   Página principal (lp-): estilo "dibujado a mano" (líneas negras, rellenos planos).
   Un solo momento animado: el cuaderno se tacha y aparece el sistema cobrando.
   ===================================================================== */
.lp {
  --lp-paper: #fdfcf9; --lp-yellow: #ffd84d; --lp-mint: #bfe8cf; --lp-stroke: var(--ink);
  background: var(--lp-paper);
}
:root[data-theme="dark"] .lp { --lp-paper: var(--bg); --lp-yellow: #e9c23a; --lp-mint: #1f4a33; }
.lp-wrap { width: min(1140px, 100% - 32px); margin-inline: auto; }
.lp svg:not(.icon) :is(path, rect, circle, ellipse) { fill: none; stroke: var(--lp-stroke); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lp svg:not(.icon) .fill-paper { fill: var(--surface); }
.lp svg:not(.icon) .fill-yellow { fill: var(--lp-yellow); }
.lp svg:not(.icon) .fill-mint { fill: var(--lp-mint); }

/* Navegación */
.lp-nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--lp-paper) 86%, transparent); backdrop-filter: blur(12px) saturate(1.3); border-bottom: 1px solid transparent; transition: border-color .2s; }
.lp-nav.is-scrolled { border-bottom-color: var(--line); }
.lp-nav .lp-wrap { display: flex; align-items: center; gap: 14px; height: 66px; }
.lp-nav .spacer { flex: 1; }
.lp-links { display: none; gap: 26px; margin-left: 36px; }
.lp-links a { color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 600; }
.lp-links a:hover { color: var(--ink); }
@media (min-width: 820px) { .lp-links { display: flex; } }

/* Hero */
.lp-hero { display: grid; gap: 40px; padding: 56px 0 64px; align-items: center; }
@media (min-width: 980px) { .lp-hero { grid-template-columns: 1.05fr 1fr; padding: 80px 0 96px; } }
.lp-hero h1 { display: grid; gap: 18px; }
.lp-h1-main { font-size: clamp(36px, 8.4vw, 76px); font-weight: 800; letter-spacing: -.045em; line-height: 1; white-space: nowrap; }
.lp-h1-strike { position: relative; display: inline-block; }
.lp-strike { position: absolute; left: -4%; width: 108%; top: 40%; height: .32em; overflow: visible; }
.lp svg.lp-strike path { stroke: var(--accent); stroke-width: 7; stroke-dasharray: 460; stroke-dashoffset: 460; animation: lp-draw .7s var(--ease) .9s forwards; }
.lp-h1-sub { font-size: clamp(24px, 3.1vw, 36px); font-weight: 650; letter-spacing: -.025em; line-height: 1.15; color: var(--ink); max-width: 18ch; }
.lp-lead { margin-top: 22px; font-size: 18px; line-height: 1.6; color: var(--ink-2); max-width: 46ch; }
.lp-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.lp-proof { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 26px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 14px; }
.lp-proof li { display: inline-flex; align-items: center; gap: 7px; }

/* Escena del hero: cuaderno -> flecha -> app */
.lp-scene { position: relative; min-height: 440px; display: grid; place-items: center; }
.lp-notebook { position: absolute; left: 0; top: 18px; width: 46%; max-width: 230px; transform: rotate(-7deg); }
.lp svg.lp-notebook .nb-page { fill: var(--surface); }
.lp svg.lp-notebook .nb-rings circle { fill: var(--lp-paper); }
.lp svg.lp-notebook .nb-text path { stroke-width: 3; opacity: .55; }
.lp svg.lp-notebook .nb-scribble path { stroke: var(--accent); stroke-width: 4; stroke-dasharray: 520; stroke-dashoffset: 520; animation: lp-draw .8s ease-in-out .45s forwards; }
.lp-notebook .nb-q { font: 600 15px/1 var(--display); fill: var(--muted); transform: rotate(-4deg); transform-origin: 140px 226px; }
.lp-arrow { position: absolute; left: 30%; top: 4px; width: 130px; transform: rotate(8deg); }
.lp svg.lp-arrow path { stroke-dasharray: 220; stroke-dashoffset: 220; animation: lp-draw .6s ease-out 1.2s forwards; }
.lp-app {
  position: relative; z-index: 2; width: min(380px, 88%); margin: 70px 0 0 auto; padding: 20px; border-radius: 22px;
  background: var(--surface); border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--ink);
  opacity: 0; transform: translateY(18px) rotate(1.5deg); animation: lp-in .6s var(--ease) 1.45s forwards;
}
.lp-app-head { display: flex; gap: 12px; align-items: center; }
.lp-app-head b { display: block; font-family: var(--display); font-size: 17px; }
.lp-app-head small { color: var(--muted); font-size: 13px; }
.lp-app-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 12px; }
.lp-app-kpis > div { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.lp-app-kpis small { display: block; color: var(--muted); font-size: 12.5px; }
.lp-app-kpis b { font-family: var(--display); font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.lp-app-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lp-app-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 14.5px; }
.lp-app-list li small { display: block; color: var(--muted); font-size: 12.5px; }
.lp-app-list li b { font-variant-numeric: tabular-nums; }
.st-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); }
.st-dot.late { background: var(--danger); animation: lp-paid .4s ease 2.55s forwards; }
.lp-app-list li.is-late { animation: lp-row .6s ease 2.5s both; }
.lp-toast {
  position: absolute; left: -34px; bottom: -28px; display: flex; gap: 10px; align-items: center; padding: 11px 16px 11px 12px;
  background: var(--ink); color: var(--lp-paper); border-radius: 14px; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .35);
  opacity: 0; transform: translateY(10px) scale(.9); animation: lp-pop .45s cubic-bezier(.3, 1.5, .5, 1) 2.3s forwards;
}
.lp-toast > svg { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--success); color: #fff; }
.lp-toast b { display: block; font-size: 14px; }
.lp-toast small { font-size: 12.5px; opacity: .75; }
.lp-spark { position: absolute; right: 2%; top: 6%; width: 38px; }
.lp svg.lp-spark path { fill: var(--lp-yellow); animation: lp-twinkle 3.2s ease-in-out 3s infinite; transform-origin: center; }
@keyframes lp-draw { to { stroke-dashoffset: 0; } }
@keyframes lp-in { to { opacity: 1; transform: translateY(0) rotate(1.5deg); } }
@keyframes lp-pop { to { opacity: 1; transform: none; } }
@keyframes lp-paid { to { background: var(--success); } }
@keyframes lp-row { 0%, 100% { background: transparent; } 40% { background: var(--success-soft); } }
@keyframes lp-twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(.82) rotate(18deg); } }
@media (max-width: 560px) {
  .lp-scene { min-height: 400px; }
  .lp-notebook { width: 40%; }
  .lp-arrow { left: 34%; width: 96px; }
  .lp-toast { left: 0; }
}

/* Para quién: cinta que corre despacio */
.lp-who { border-block: 2px solid var(--ink); background: var(--lp-yellow); overflow: hidden; }
.lp-marquee { overflow: hidden; }
.lp-marquee-track { display: flex; width: max-content; animation: lp-marquee 38s linear infinite; }
.lp-marquee-track span { padding: 14px 26px; font: 650 17px/1 var(--display); color: #17140f; white-space: nowrap; position: relative; }
.lp-marquee-track span::after { content: ""; position: absolute; right: -4px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: #17140f; }
@keyframes lp-marquee { to { transform: translateX(-50%); } }

/* Secciones */
.lp-sec { padding: 88px 0 0; }
.lp-h2 { font-size: clamp(30px, 4.2vw, 48px); font-weight: 800; letter-spacing: -.035em; max-width: 20ch; }
.lp-intro { margin-top: 14px; font-size: 17.5px; line-height: 1.6; color: var(--ink-2); max-width: 58ch; }

/* Antes / Ahora */
.lp-swap-grid { display: grid; gap: 18px; margin-top: 32px; }
@media (min-width: 820px) { .lp-swap-grid { grid-template-columns: 1fr 1fr; } }
.lp-before, .lp-after { padding: 26px 28px; border-radius: 20px; }
.lp-before { background: transparent; border: 2px dashed var(--line); }
.lp-after { background: var(--surface); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--lp-mint); }
.lp-swap h3 { font-size: 20px; }
.lp-swap ul { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.lp-swap li { position: relative; padding-left: 30px; line-height: 1.5; }
.lp-before li { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent); text-decoration-thickness: 2px; }
.lp-before li::before { content: ""; position: absolute; left: 4px; top: 5px; width: 14px; height: 14px; border: 2px solid var(--line); border-radius: 4px; }
.lp-after li::before { content: ""; position: absolute; left: 4px; top: 4px; width: 16px; height: 16px; border-radius: 5px; background: var(--lp-mint); }
.lp-after li::after { content: ""; position: absolute; left: 9px; top: 6px; width: 5px; height: 9px; border: solid var(--ink); border-width: 0 2.4px 2.4px 0; transform: rotate(45deg); }

/* Funciones: rejilla de piezas de distintos tamaños */
.lp-bento { display: grid; gap: 16px; margin-top: 36px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .lp-bento { grid-template-columns: repeat(6, 1fr); } }
.lp-tile { position: relative; padding: 24px; border-radius: 20px; background: var(--surface); border: 1.5px solid var(--line); display: grid; align-content: start; gap: 8px; overflow: hidden; }
.lp-tile h3 { font-size: 19px; letter-spacing: -.015em; }
.lp-tile p { color: var(--ink-2); font-size: 14.5px; line-height: 1.55; margin: 0; }
.lp-doodle { width: 84px; height: 84px; margin-bottom: 6px; }
@media (min-width: 760px) {
  .t-sched { grid-column: span 4; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
  .t-contract, .t-reniec, .t-cash { grid-column: span 2; }
  .t-contract { grid-row: span 1; }
  .t-wa { grid-column: span 2; }
  .t-report { grid-column: span 2; }
  .t-more { grid-column: span 4; align-content: center; }
  .t-more .lp-mini { grid-template-columns: 1fr 1fr; gap: 16px 24px; }
}
.t-sched { background: var(--lp-mint); border-color: var(--ink); border-width: 2px; }
.t-sched p { color: var(--ink); }
.lp-sched { background: var(--surface); border: 2px solid var(--ink); border-radius: 14px; padding: 6px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.lp-sched .row { display: grid; grid-template-columns: .6fr 1.3fr 1fr; gap: 6px; padding: 8px 10px; border-radius: 8px; }
.lp-sched .row.h { color: var(--muted); font-size: 12px; font-weight: 600; }
.lp-sched .row span:last-child { text-align: right; font-weight: 650; }
.lp-sched .row.paid { color: var(--muted); }
.lp-sched .row.paid span:last-child::after { content: " ✓"; color: var(--success); }
.lp svg:not(.icon) .sign { stroke: var(--accent); stroke-width: 2.6; }
.lp .will-draw .sign { stroke-dasharray: 120; stroke-dashoffset: 120; }
.lp .is-seen .sign { animation: lp-draw 1s ease-out .2s forwards; }
.lp-chat { display: grid; gap: 8px; margin-bottom: 10px; }
.lp-chat p { margin: 0; max-width: 88%; padding: 9px 12px; font-size: 13.5px; line-height: 1.4; border-radius: 14px; }
.lp-chat .out { justify-self: end; background: #d9fdd3; color: #17140f; border-bottom-right-radius: 4px; }
.lp-chat .in { justify-self: start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.lp-bars { display: flex; align-items: flex-end; gap: 7px; height: 84px; margin-bottom: 6px; }
.lp-bars i { flex: 1; border: 2px solid var(--ink); border-bottom-width: 2px; border-radius: 6px 6px 2px 2px; background: var(--surface-2); height: var(--h, 40%); transform-origin: bottom; }
.lp-bars i:nth-child(1) { --h: 34%; --i: 0; } .lp-bars i:nth-child(2) { --h: 48%; --i: 1; } .lp-bars i:nth-child(3) { --h: 42%; --i: 2; } .lp-bars i:nth-child(4) { --h: 60%; --i: 3; }
.lp-bars i:nth-child(5) { --h: 56%; --i: 4; } .lp-bars i:nth-child(6) { --h: 74%; --i: 5; } .lp-bars i:nth-child(7) { --h: 92%; --i: 6; background: var(--accent); }
.lp .will-draw .lp-bars i { transform: scaleY(.08); }
.lp .is-seen .lp-bars i { transform: scaleY(1); transition: transform .7s var(--ease); }
.lp .is-seen .lp-bars i:nth-child(n) { transition-delay: calc(var(--i, 0) * 60ms); }
.lp-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lp-mini li { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; }
.lp-mini svg { color: var(--accent); }

/* Pasos (secuencia real: 1, 2, 3) */
.lp-steps { list-style: none; counter-reset: lp; margin: 36px 0 0; padding: 0; display: grid; gap: 28px; }
@media (min-width: 860px) { .lp-steps { grid-template-columns: repeat(3, 1fr); gap: 36px; } }
.lp-steps li { counter-increment: lp; position: relative; padding-top: 70px; }
.lp-steps li::before {
  content: counter(lp); position: absolute; left: 0; top: 0; width: 52px; height: 52px; display: grid; place-items: center;
  font: 800 24px/1 var(--display); border: 2px solid var(--ink); border-radius: 50%; background: var(--lp-yellow); color: #17140f;
}
@media (min-width: 860px) {
  .lp-steps li:not(:last-child)::after { content: ""; position: absolute; left: 66px; right: -20px; top: 26px; border-top: 2px dashed var(--ink); opacity: .35; }
}
.lp-steps b { font: 700 20px/1.25 var(--display); letter-spacing: -.015em; }
.lp-steps p { margin: 8px 0 0; color: var(--ink-2); line-height: 1.55; max-width: 34ch; }

/* Planes */
.lp-plans { display: grid; gap: 18px; margin-top: 36px; align-items: stretch; }
@media (min-width: 900px) { .lp-plans { grid-template-columns: repeat(3, 1fr); } }
.lp-plan { position: relative; display: flex; flex-direction: column; padding: 28px 26px; border-radius: 22px; background: var(--surface); border: 1.5px solid var(--line); }
.lp-plan.is-pop { border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--accent); }
.lp-pop { position: absolute; top: -14px; left: 24px; padding: 5px 12px; border-radius: 999px; background: var(--ink); color: var(--lp-paper); font-size: 12.5px; font-weight: 700; }
.lp-plan h3 { font-size: 22px; }
.lp-plan-for { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
.lp-price { display: flex; align-items: baseline; gap: 5px; margin: 20px 0 18px; }
.lp-price small { font-weight: 700; font-size: 18px; }
.lp-price b { font: 800 46px/1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.lp-price span { color: var(--muted); font-size: 14px; margin-left: 2px; }
.lp-plan ul { list-style: none; margin: 0 0 24px; padding: 18px 0 0; border-top: 1.5px dashed var(--line); display: grid; gap: 10px; flex: 1; align-content: start; }
.lp-plan li { position: relative; padding-left: 26px; font-size: 14.5px; line-height: 1.45; }
.lp-plan li::before { content: ""; position: absolute; left: 2px; top: 3px; width: 6px; height: 11px; border: solid var(--success); border-width: 0 2.4px 2.4px 0; transform: rotate(45deg); }
.lp-year {
  display: grid; gap: 16px 28px; align-items: center; margin-top: 22px; padding: 26px 28px; border-radius: 22px;
  background: var(--lp-yellow); border: 2px solid var(--ink); color: #17140f;
}
@media (min-width: 860px) { .lp-year { grid-template-columns: auto 1fr auto auto; } }
.lp-year-doodle { width: 76px; height: 76px; }
.lp .lp-year svg.lp-year-doodle .fill-paper { fill: #fff; }
.lp .lp-year svg.lp-year-doodle path, .lp .lp-year svg.lp-year-doodle rect { stroke: #17140f; }
.lp .will-draw .tick { stroke-dasharray: 60; stroke-dashoffset: 60; }
.lp .is-seen .tick { stroke-width: 4; animation: lp-draw .5s ease-out .3s forwards; }
.lp-year h3 { font-size: 24px; color: #17140f; }
.lp-year p { margin: 6px 0 0; line-height: 1.5; max-width: 52ch; }
.lp-year .lp-price { margin: 0; }
.lp-year .lp-price span { color: #3d3a35; }

/* Preguntas */
.lp-faq-list { margin-top: 28px; display: grid; gap: 0; max-width: 820px; border-top: 1.5px solid var(--ink); }
.lp-faq details { border-bottom: 1.5px solid var(--line); }
.lp-faq summary { list-style: none; cursor: pointer; padding: 20px 40px 20px 0; position: relative; font: 650 18px/1.35 var(--display); letter-spacing: -.01em; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: ""; position: absolute; right: 8px; top: 50%; width: 12px; height: 12px; margin-top: -8px; border: solid var(--ink); border-width: 0 2.4px 2.4px 0; transform: rotate(45deg); transition: transform .2s var(--ease); }
.lp-faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.lp-faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.lp-faq details p { margin: 0 0 20px; color: var(--ink-2); line-height: 1.6; max-width: 64ch; }

/* Cierre */
.lp-close { padding: 96px 0 88px; }
.lp-close-card { position: relative; padding: 56px 28px; border-radius: 28px; background: var(--ink); color: var(--lp-paper); text-align: center; overflow: hidden; }
.lp-close-card h2 { font-size: clamp(30px, 4.6vw, 52px); font-weight: 800; letter-spacing: -.035em; color: var(--lp-paper); }
.lp-close-card p { margin: 14px auto 28px; max-width: 46ch; opacity: .78; font-size: 17px; line-height: 1.55; }
.lp-close-doodle { position: absolute; right: 4%; top: 10%; width: 180px; opacity: .9; }
.lp svg.lp-close-doodle path, .lp svg.lp-close-doodle circle { stroke: var(--lp-yellow); }
@media (max-width: 700px) { .lp-close-doodle { width: 110px; right: -10px; top: 4px; opacity: .55; } }
.lp-foot { border-top: 1px solid var(--line); padding: 26px 0; color: var(--muted); font-size: 13.5px; }
.lp-foot .lp-wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lp-foot a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  .lp *, .lp *::before, .lp *::after { animation-duration: .001s !important; animation-delay: 0s !important; transition: none !important; }
  .lp-marquee-track { animation: none !important; }
}
