/* =============================================================
   Brío — 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: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --ink: #0b1220;
  --ink-2: #3c4657;
  --muted: #7a8496;
  --line: #e3e7ec;
  --line-2: #eef1f4;
  --accent: #0e9f6e;
  --accent-hover: #0b855c;
  --accent-ink: #ffffff;
  --accent-soft: #e3f6ee;
  --volt: #ffd166;
  --volt-ink: #2a1f00;
  --success: #15803d;
  --success-soft: #e9f7ee;
  --danger: #d92d20;
  --danger-soft: #fdeceb;
  --warn: #b45309;
  --warn-soft: #fdf3e2;
  --skel: #e6e9ee;
  --skel-shine: #f4f6f8;
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, .06);
  --shadow: 0 1px 2px rgba(11, 18, 32, .05), 0 8px 24px -8px rgba(11, 18, 32, .12);
  --shadow-lg: 0 24px 64px -16px rgba(11, 18, 32, .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: #0b0f16;
    --surface: #121821;
    --surface-2: #18202b;
    --ink: #eef2f6;
    --ink-2: #c3cad6;
    --muted: #8a94a6;
    --line: #263140;
    --line-2: #1c2531;
    --accent: #34d399;
    --accent-hover: #4ade9b;
    --accent-soft: #0f2e24;
    --success-soft: #11291a;
    --danger-soft: #3a1513;
    --warn-soft: #33240f;
    --skel: #1c2531;
    --skel-shine: #2a3646;
    --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: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: minmax(0, 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%, #0e9f6e 0%, transparent 60%), radial-gradient(90% 70% at 100% 0%, #0b5c45 0%, transparent 60%), #0b1220;
}
@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: #0b1220; }
.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: #0b1220; 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; }
.grow { flex: 1 1 auto; min-width: 0; }
.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(198,244,50,.28), transparent 55%), radial-gradient(80% 60% at 0% 100%, rgba(10,0,60,.45), transparent 60%), linear-gradient(150deg, #7b61ff 0%, #0e9f6e 50%, #3b1fd1 100%); }
:root[data-theme="dark"] .auth-aside { background: radial-gradient(120% 80% at 0% 100%, #0e9f6e 0%, transparent 60%), radial-gradient(90% 70% at 100% 0%, #0b5c45 0%, transparent 60%), #0b1220; }
.auth-aside .brand b { color: #fff; }
.auth-aside .brand-mark { box-shadow: inset 0 -3px 0 #0b1220; }

/* 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: #0b1220; 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: #0b1220; box-shadow: inset 0 -3px 0 #0b1220; }
.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: #e3f6ee; color: #0b855c; }
.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, #0e9f6e, #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: #e3f6ee; color: #0b855c; }
.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: #0b855c; }
.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%, #0e9f6e); 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: #0e9f6e;
  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; }

.cash-formula { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: 12px; font-size: 13.5px; color: var(--ink-2); }
.cash-formula .op { font-weight: 700; color: var(--muted); }
.cash-formula small { flex-basis: 100%; margin-top: 4px; font-size: 12.5px; line-height: 1.45; max-width: 60ch; }
.stat-sub { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.mov-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mov-head .chips { margin: 0; }
.list-row.is-digital b.money { font-weight: 600; }
.mov-note { display: block; font-size: 11.5px; color: var(--muted); }

/* Detalle de una caja (modal) */
.sess { gap: 18px; }
.sess-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.sess-hero { padding: 18px 20px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.sess-hero > small { color: var(--muted); font-size: 13px; }
.sess-amount { font: 750 34px/1.1 var(--display); letter-spacing: -.03em; margin-top: 4px; }
.sess-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .sess-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sess-tile { min-width: 0; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); display: grid; gap: 4px; align-content: start; }
.sess-tile small { color: var(--muted); font-size: 12.5px; }
.sess-tile b.money { font: 700 19px/1.2 var(--display); letter-spacing: -.02em; }
.sess-tile.in b.money { color: var(--success); }
.sess-tile.out b.money { color: var(--danger); }
.sess-tile.digital { background: var(--accent-soft); border-color: transparent; }
.sess-sub { font-size: 12px; color: var(--muted); line-height: 1.4; }
.sess-close { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .sess-close { grid-template-columns: 1fr 1fr; } .sess-close .sess-result { grid-column: span 2; } }
.sess-close.is-ok .sess-result { background: var(--success-soft); border-color: transparent; }
.sess-close.is-ok .sess-result b { color: var(--success); }
.sess-close.is-warn .sess-result { background: var(--warn-soft); border-color: transparent; }
.sess-close.is-warn .sess-result b { color: var(--warn); }
.sess-close.is-bad .sess-result { background: var(--danger-soft); border-color: transparent; }
.sess-close.is-bad .sess-result b { color: var(--danger); }
.sess .card { overflow: hidden; }
.sess .list-row { min-width: 0; }
.sess .list-row .grow { min-width: 0; }
.sess .list-row .grow b, .sess .list-row .grow small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess .list-row .text-right { flex: none; }
.mov-head .chips { flex-wrap: wrap; overflow: visible; }

/* Caja: cuadre total (efectivo + digital) */
.tot-card .card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tot-row { display: grid; gap: 10px; padding: 16px 20px 4px; grid-template-columns: 1fr; align-items: stretch; }
@media (min-width: 760px) { .tot-row { grid-template-columns: 1fr auto 1fr auto 1.1fr; align-items: center; } }
.tot-cell { display: grid; gap: 3px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); min-width: 0; }
.tot-cell small { color: var(--muted); font-size: 12.5px; }
.tot-cell b.money { font: 750 22px/1.15 var(--display); letter-spacing: -.02em; }
.tot-cell span { font-size: 12px; color: var(--muted); }
.tot-cell.is-total { background: var(--ink); border-color: var(--ink); }
.tot-cell.is-total small { color: color-mix(in srgb, var(--surface) 70%, transparent); }
.tot-cell.is-total b.money { color: var(--surface); font-size: 26px; }
.tot-op { justify-self: center; font: 700 22px/1 var(--display); color: var(--muted); }
@media (max-width: 759px) { .tot-op { display: none; } }
.tot-notes { padding: 12px 20px 18px; display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.tot-notes p { margin: 0; line-height: 1.5; }

/* Método de pago */
.pm-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.pm-pill svg { width: 13px; height: 13px; }
.pm-pill.pm-cash { background: var(--success-soft); color: var(--success); border-color: transparent; }
.pm-pill.pm-yape { background: color-mix(in srgb, #742284 12%, var(--surface)); color: #742284; border-color: transparent; }
.pm-pill.pm-plin { background: color-mix(in srgb, #00a6b4 14%, var(--surface)); color: #007f8a; border-color: transparent; }
.pm-pill.pm-transfer { background: color-mix(in srgb, #2563eb 12%, var(--surface)); color: #1d4ed8; border-color: transparent; }
:root[data-theme="dark"] .pm-pill.pm-yape { color: #d7a6e3; }
:root[data-theme="dark"] .pm-pill.pm-plin { color: #6fd6de; }
:root[data-theme="dark"] .pm-pill.pm-transfer { color: #8fb3ff; }
.pm-list { display: flex; flex-wrap: wrap; gap: 4px; }
.pm-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pm-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; font-size: 13.5px; }
.pm-sum-item { display: inline-flex; align-items: center; gap: 6px; }

.cash-gate { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--ink-2); font-size: 14px; }
.cash-gate > svg { color: var(--warn); flex: none; }
.cash-gate > span { flex: 1 1 220px; }
.stats-note { display: flex; align-items: flex-start; gap: 8px; margin: -4px 0 0; font-size: 13px; line-height: 1.45; }
@media (min-width: 720px) { .sess-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Caja: efectivo y digital separados */
.cash-groups { display: grid; gap: 16px; }
@media (min-width: 1000px) { .cash-groups { grid-template-columns: 3fr 2fr; } }
.cash-group { display: grid; gap: 10px; align-content: start; }
.cash-group h4 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 14px; }
.cash-group h4 small { font-weight: 500; color: var(--muted); }
.cash-group-grid { display: grid; gap: 12px; }
.cash-group-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cash-group-grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .cash-group-grid.g3 { grid-template-columns: 1fr 1fr; } .cash-group-grid.g3 > :first-child { grid-column: span 2; } }
.cash-group.is-digital .stat { background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.cash-group .stat .num { font-size: clamp(20px, 2.4vw, 28px); }

/* =============== Agenda de cobros =============== */
.ag-hero { padding: 22px; display: grid; gap: 18px; }
@media (min-width: 980px) { .ag-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: center; } }
.ag-hero-main { display: grid; gap: 8px; }
.ag-hero-amount { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.ag-hero-amount b { font: 750 34px/1.1 var(--display); letter-spacing: -.03em; }
.ag-hero-amount span { color: var(--muted); font-size: 15px; }
.ag-progress { height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.ag-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--success), color-mix(in srgb, var(--success) 70%, #9be7b4)); transition: width .6s var(--ease); }
.ag-kpis { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .ag-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ag-kpi { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.ag-kpi small { color: var(--muted); font-size: 12px; }
.ag-kpi b { font: 700 18px/1.2 var(--display); letter-spacing: -.02em; }
.ag-kpi > span:last-child { font-size: 11.5px; }
.ag-kpi-ic { color: var(--muted); }
.ag-kpi.is-bad b, .ag-kpi.is-bad .ag-kpi-ic { color: var(--danger); }
.ag-note { grid-column: 1 / -1; display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 13px; color: var(--ink-2); }
.ag-search { margin-top: 16px; }
.ag-search .select { width: auto; min-width: 200px; }
.ag-strip { display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 10px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.ag-day {
  flex: 0 0 auto; min-width: 92px; display: grid; gap: 2px; justify-items: start; padding: 10px 14px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; scroll-snap-align: center; position: relative;
  transition: border-color .15s, background .15s, transform .15s;
}
.ag-day small { font-size: 12px; color: var(--muted); font-weight: 650; text-transform: capitalize; }
.ag-day b { font: 750 20px/1.1 var(--display); }
.ag-day span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ag-day:hover { border-color: var(--ink-2); }
.ag-day.is-active { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.ag-day.is-active small, .ag-day.is-active span { color: color-mix(in srgb, var(--surface) 72%, transparent); }
.ag-day.is-zero:not(.is-active) { opacity: .55; }
.ag-day.is-late:not(.is-zero) { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.ag-day.is-late:not(.is-zero) b { color: var(--danger); }
.ag-day.is-late.is-active { background: var(--danger); border-color: var(--danger); }
.ag-day.is-late.is-active b { color: #fff; }
.ag-day.has-promise::after { content: ""; position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.ag-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ag-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; }
.ag-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ag-title h3 { font-size: 19px; }
.ag-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ag-list.is-loading { opacity: .55; pointer-events: none; transition: opacity .15s; }
.ag-group + .ag-group { margin-top: 18px; }
.ag-zone { display: flex; align-items: center; gap: 8px; margin: 0 2px 10px; font-size: 14px; }
.ag-zone svg { color: var(--accent); }
.ag-cards { display: grid; gap: 12px; }
@media (min-width: 1100px) { .ag-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ag-card { padding: 16px 18px; display: grid; gap: 12px; border-left: 4px solid transparent; }
.ag-card.is-late { border-left-color: var(--danger); }
.ag-card.is-promise { border-left-color: var(--accent); }
.ag-card-top { display: flex; gap: 12px; align-items: flex-start; }
.ag-who { display: grid; gap: 3px; min-width: 0; text-decoration: none; color: inherit; }
.ag-who b { font-size: 15.5px; }
.ag-who small { font-size: 13px; }
.ag-addr { display: flex; gap: 5px; align-items: flex-start; }
.ag-addr svg { flex: none; margin-top: 1px; }
.ag-amount { text-align: right; display: grid; gap: 2px; flex: none; }
.ag-amount b { font: 750 18px/1.2 var(--display); }
.ag-amount small { font-size: 12px; }
.ag-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.ag-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.ag-badge svg { width: 13px; height: 13px; }
.ag-badge.is-promise { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.ag-badge.is-ok { background: var(--success-soft); border-color: transparent; color: var(--success); }
.ag-card-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ag-outcomes { display: flex; flex-wrap: wrap; gap: 6px; }
.ag-serial { display: grid; gap: 14px; }
.ag-serial-top { display: grid; gap: 6px; }
.ag-serial-who { display: flex; gap: 12px; align-items: center; }
.ag-serial-who small { display: block; }
.ag-serial textarea { min-height: 130px; }
.btn-wa[disabled] { opacity: .5; }

.tpl-row { display: grid; gap: 10px; padding: 14px 0; border-top: 1px dashed var(--line); }
@media (min-width: 900px) { .tpl-row { grid-template-columns: 1fr 1fr; align-items: start; } }
.tpl-prev-wrap { display: grid; gap: 6px; }
.tpl-preview { margin: 0; padding: 10px 12px; border-radius: 14px 14px 14px 4px; background: #d9fdd3; color: #0b1220; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; max-width: 46ch; }
.ag-card .avatar, .ag-serial-who .avatar { width: 42px; height: 42px; font-size: 14px; }
.ag-who { flex: 1 1 auto; }

/* ---------- Contrato firmado del préstamo ---------- */
.badge-btn { border: 0; background: none; padding: 0; cursor: pointer; display: inline-flex; }
.badge-btn:hover .st { filter: brightness(.96); text-decoration: underline; }
.sc-hero { display: flex; flex-direction: column; gap: 18px; }
.sc-hero.is-signed { border-color: var(--success); background: linear-gradient(180deg, var(--success-soft), var(--surface) 70%); }
.sc-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.sc-head h3 { margin-bottom: 2px; }
.sc-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--success-soft); color: var(--success); flex: none; }
.sc-ic.is-pending { background: var(--warn-soft); color: var(--warn); }
.sc-steps { list-style: none; counter-reset: sc; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; padding: 0; }
.sc-steps li { counter-increment: sc; position: relative; border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 14px 52px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.sc-steps li::before { content: counter(sc); position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--surface); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.sc-steps li span { color: var(--muted); font-size: 13px; }
.sc-steps li .btn { align-self: flex-start; margin-top: 6px; }
.sc-actions .btn { flex: 1 1 auto; justify-content: center; }
.sc-progress { font-size: 14px; font-weight: 600; color: var(--muted); }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.sc-tile { position: relative; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.sc-open { border: 1px solid var(--line); border-radius: 12px; padding: 0; overflow: hidden; background: var(--bg); cursor: zoom-in; aspect-ratio: 3 / 4; display: block; width: 100%; }
.sc-open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-open img.is-loading { opacity: .3; }
.sc-tile figcaption { display: flex; flex-direction: column; font-size: 13px; line-height: 1.3; }
.sc-pdf { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--danger, #d63a1f); padding: 10px; text-align: center; }
.sc-pdf small { color: var(--muted); word-break: break-all; }
@media (max-width: 720px) { .sc-steps { grid-template-columns: 1fr; } .sc-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* =============================================================
   Brío · Gimnasio
   ============================================================= */
/* ---------- Estado de membresía ---------- */
.ms-pill { 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; background: var(--line-2); color: var(--ink-2); }
.ms-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.ms-pill.ms-active { background: var(--success-soft); color: var(--success); }
.ms-pill.ms-warn { background: var(--warn-soft); color: var(--warn); }
.ms-pill.ms-expired { background: var(--danger-soft); color: var(--danger); }
.ms-pill.ms-frozen { background: #e6f4ff; color: #0369a1; }
.ms-pill.ms-scheduled { background: var(--accent-soft); color: var(--accent); }
.ms-pill.ms-none { background: var(--line-2); color: var(--muted); }
:root[data-theme="dark"] .ms-pill.ms-frozen { background: #0c2a3d; color: #7cc7ff; }
.badge-debt { background: var(--danger-soft); color: var(--danger); }
.badge-sent { display: inline-flex; align-items: center; gap: 4px; background: var(--success-soft); color: var(--success); }

/* ---------- Avatar del socio ---------- */
.m-avatar { position: relative; flex: none; display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: linear-gradient(140deg, var(--accent-soft), color-mix(in srgb, var(--accent) 22%, var(--surface))); color: var(--accent); font-weight: 800; letter-spacing: -.02em; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--line); }
.m-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.m-avatar.has-photo span { visibility: hidden; }
.m-avatar.is-sm { width: 34px; height: 34px; font-size: 12.5px; }
.m-avatar.is-md { width: 44px; height: 44px; font-size: 15px; }
.m-avatar.is-lg { width: 96px; height: 96px; font-size: 32px; }
.m-avatar.is-xl { width: 112px; height: 112px; font-size: 38px; }
.m-avatar.st-active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--success); }
.m-avatar.st-expired { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--danger); }
.m-avatar.st-frozen { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #38bdf8; }
.m-avatar.is-guest { background: var(--line-2); color: var(--muted); }
.avatar-edit { position: relative; border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.avatar-edit .ae-badge { position: absolute; right: 2px; bottom: 2px; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; box-shadow: 0 0 0 3px var(--surface); }

/* ---------- Listado de socios ---------- */
.chips-scroll { margin: 4px 0 12px; }
.chip-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; }
.chip.is-active .chip-n { background: var(--bg); color: var(--ink); }
.member-list { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.member-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s var(--ease), box-shadow .15s; }
.member-row:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); transform: translateY(-1px); }
.member-row .grow { min-width: 0; }
.member-row .grow small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mr-side { display: grid; justify-items: end; gap: 4px; text-align: right; }
@media (max-width: 640px) { .member-row { padding: 10px 12px; gap: 10px; } .member-row > .icon { display: none; } .mr-side small { display: none; } }
.select-sm { height: 40px; font-size: 13.5px; max-width: 190px; }

/* ---------- Ficha del socio ---------- */
.member-hero { padding: 22px; display: grid; gap: 18px; position: relative; overflow: hidden; }
.member-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 92px; background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); pointer-events: none; }
.member-hero.st-expired::before { background: linear-gradient(120deg, color-mix(in srgb, var(--danger) 14%, transparent), transparent 70%); }
.member-hero.st-frozen::before { background: linear-gradient(120deg, rgba(56, 189, 248, .18), transparent 70%); }
.mh-main { display: flex; align-items: center; gap: 18px; position: relative; }
.mh-main h2 { font-family: var(--display); font-size: clamp(22px, 4vw, 30px); letter-spacing: -.03em; margin: 6px 0 2px; }
.mh-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.mh-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.mh-stats > div { background: var(--surface-2); padding: 12px 14px; display: grid; gap: 2px; }
.mh-stats small, .ms-facts small { color: var(--muted); font-size: 12px; font-weight: 600; }
.mh-stats b { font-size: 15px; }
@media (max-width: 720px) { .mh-main { flex-direction: column; text-align: center; } .mh-badges { justify-content: center; } .mh-stats { grid-template-columns: 1fr 1fr; } }
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; }
.qa { display: grid; justify-items: center; gap: 6px; min-width: 74px; padding: 10px 8px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; cursor: pointer; text-decoration: none; transition: all .15s; }
.qa:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.qa .qa-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.qa small { font-size: 12px; font-weight: 650; }
@media (max-width: 720px) { .quick-actions { justify-content: center; } .qa { flex: 1 1 calc(20% - 10px); min-width: 60px; } }
.health-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); font-size: 13.5px; position: relative; }
.ms-card { display: grid; gap: 14px; }
.ms-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ms-head h3 { font-family: var(--display); font-size: 22px; margin-top: 2px; }
.ms-dates { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); font-weight: 600; }
.ms-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ms-facts > div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line-2); display: grid; gap: 2px; }
.heat-wrap { display: grid; gap: 8px; }
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; max-width: 320px; }
.heat i { aspect-ratio: 1; border-radius: 5px; background: var(--line-2); }
.heat i.on { background: var(--accent); }
.ev-ic.ic-muted { background: var(--line-2); color: var(--muted); }
.ev-ic.ic-danger { background: var(--danger-soft); color: var(--danger); }
.menu-list { display: grid; gap: 6px; }
.menu-list .menu-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: inherit; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; text-align: left; }
.menu-list .menu-item span { flex: 1; }
.menu-list .menu-item:hover { border-color: #25d366; }

/* ---------- Venta de planes ---------- */
.sell-who { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line-2); }
.sell-who small { display: block; }
.plan-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pp-card { position: relative; display: grid; gap: 2px; text-align: left; padding: 12px 12px 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); font: inherit; color: inherit; cursor: pointer; transition: all .15s; overflow: hidden; }
.pp-card:hover { border-color: var(--ink-2); }
.pp-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--accent-soft); }
.pp-card small { color: var(--muted); font-size: 12px; }
.pp-dot { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.pp-price { font-family: var(--display); font-size: 18px; font-weight: 800; margin-top: 4px; }
.sell-summary { display: grid; gap: 6px; padding: 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px dashed var(--line); }
.ss-dates { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.quote-line.is-good b { color: var(--success); }
.pay-block { display: grid; gap: 10px; }
.pay-methods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pm-btn { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: all .15s; }
.pm-btn:hover { border-color: var(--ink-2); }
.pm-btn.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.pm-btn.pm-yape.is-active { border-color: #742284; background: #f6ecf8; color: #742284; box-shadow: 0 0 0 1px #742284 inset; }
.pm-btn.pm-plin.is-active { border-color: #00a5b5; background: #e6f7f9; color: #007c88; box-shadow: 0 0 0 1px #00a5b5 inset; }
@media (max-width: 520px) { .pay-methods { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Recepción ---------- */
.rx-hero { display: grid; gap: 12px; margin-bottom: 16px; }
.rx-search-wrap { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; background: var(--surface); border: 2px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); transition: border-color .15s; }
.rx-search-wrap:focus-within { border-color: var(--accent); }
.rx-search-wrap > .icon { color: var(--muted); flex: none; }
.rx-search { flex: 1; min-width: 0; height: 48px; border: 0; background: none; font: inherit; font-size: 17px; font-weight: 600; color: var(--ink); outline: none; }
.rx-cam-btn { height: 48px; border-radius: 13px; flex: none; }
.rx-cam-btn.is-active { background: var(--accent); border-color: var(--accent); }
@media (max-width: 520px) { .rx-cam-btn span { display: none; } .rx-search { font-size: 16px; } }
.rx-cam { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #000; aspect-ratio: 4 / 3; max-height: 60vh; }
.rx-video, .k-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.rx-frame, .k-frame { position: absolute; inset: 18% 22%; border-radius: 22px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .38); border: 3px solid rgba(255, 255, 255, .9); pointer-events: none; }
.rx-frame::after, .k-frame::after { content: ""; position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: var(--volt); box-shadow: 0 0 14px var(--volt); animation: scanline 1.8s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { transform: translateY(-120%); opacity: .4; } 50% { transform: translateY(120%); opacity: 1; } }
.rx-cam-close { position: absolute; right: 10px; top: 10px; background: rgba(0, 0, 0, .55); color: #fff; }
.rx-results { display: grid; gap: 8px; }
.rx-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.rx-item .grow { min-width: 0; }
.rx-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .rx-item .ms-pill { display: none; } .rx-item .btn span { display: none; } }
.rx-empty { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; }
.rx-result { margin-bottom: 16px; }
.rx-today { padding: 18px; }
.rx-today-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.rx-kpis { display: flex; gap: 14px; color: var(--muted); font-size: 13.5px; }
.rx-kpis b { color: var(--ink); font-size: 16px; }
.rx-kpis .is-denied b { color: var(--danger); }
.rx-log { display: grid; }
.rx-log-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-top: 1px solid var(--line-2); }
.rx-log-row .grow { min-width: 0; }
.rx-log-row .grow a, .rx-log-row .grow b { font-weight: 700; color: var(--ink); text-decoration: none; }
.rx-log-row .grow small { display: block; }
.rx-log-row.is-denied .rx-time { color: var(--danger); }
.rx-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; color: var(--muted); width: 46px; }

/* Veredicto de ingreso */
.verdict { position: relative; display: flex; align-items: center; gap: 22px; padding: 22px 24px; border-radius: var(--radius-lg); border: 2px solid; overflow: hidden; }
.verdict.is-ok { background: linear-gradient(120deg, color-mix(in srgb, var(--success) 14%, var(--surface)), var(--surface) 70%); border-color: var(--success); }
.verdict.is-warn { background: linear-gradient(120deg, color-mix(in srgb, #f59e0b 18%, var(--surface)), var(--surface) 70%); border-color: #f59e0b; }
.verdict.is-denied { background: linear-gradient(120deg, color-mix(in srgb, var(--danger) 14%, var(--surface)), var(--surface) 70%); border-color: var(--danger); }
.v-icon { position: absolute; right: 18px; top: 18px; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.is-ok .v-icon { background: var(--success); } .is-warn .v-icon { background: #f59e0b; } .is-denied .v-icon { background: var(--danger); }
.v-body { display: grid; gap: 6px; min-width: 0; flex: 1; }
.v-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.v-title b { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.is-ok .v-title b { color: var(--success); } .is-warn .v-title b { color: #b45309; } .is-denied .v-title b { color: var(--danger); }
.v-bday { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: #fff3c4; color: #92400e; }
.verdict h2 { font-family: var(--display); font-size: clamp(24px, 4vw, 34px); letter-spacing: -.03em; margin: 0; padding-right: 50px; }
.v-msg { font-size: 15.5px; font-weight: 600; color: var(--ink-2); }
.v-facts { display: flex; gap: 8px; flex-wrap: wrap; }
.vf { padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--line); display: grid; }
.vf small { font-size: 11.5px; color: var(--muted); font-weight: 650; }
.vf.is-debt b { color: var(--danger); }
.v-actions { margin-top: 4px; }
@media (max-width: 640px) { .verdict { flex-direction: column; text-align: center; padding: 22px 16px; } .v-title, .v-facts, .v-actions { justify-content: center; } .verdict h2 { padding-right: 0; } }

/* Modo recepción (kiosco) */
body.kiosk-mode .sidebar, body.kiosk-mode .topbar, body.kiosk-mode .bottom-nav, body.kiosk-mode .plan-banner { display: none !important; }
body.kiosk-mode .main { margin: 0; padding: 0; }
body.kiosk-mode .content { padding: 0; max-width: none; }
.kiosk { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; background: radial-gradient(120% 80% at 0% 0%, #2a1a7a 0%, #120b33 55%, #05080d 100%); color: #fff; }
.k-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; }
.k-brand b { font-family: var(--display); font-size: 22px; letter-spacing: -.02em; display: block; }
.k-count { font-size: 12.5px; opacity: .65; }
.k-clock { font-family: var(--display); font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.k-tools { display: flex; gap: 6px; }
.k-tools .btn { color: #fff; }
.k-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; padding: 0 24px 24px; align-items: stretch; }
.k-cam { position: relative; border-radius: 28px; overflow: hidden; background: #000; min-height: 50vh; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); }
.k-stage { display: grid; align-content: center; }
.k-stage .verdict { color: var(--ink); background: var(--surface); flex-direction: column; text-align: center; padding: 34px 24px; }
.k-stage .verdict .v-title, .k-stage .verdict .v-facts { justify-content: center; }
.k-stage .verdict h2 { font-size: clamp(28px, 4vw, 46px); padding: 0; }
.k-stage .verdict .v-msg { font-size: 19px; }
.k-stage .m-avatar.is-lg { width: 150px; height: 150px; font-size: 52px; }
.k-idle { text-align: center; display: grid; justify-items: center; gap: 12px; }
.k-idle h2 { font-family: var(--display); font-size: clamp(26px, 4vw, 42px); letter-spacing: -.03em; }
.k-idle p { opacity: .7; font-size: 17px; }
.k-qr-hint { width: 120px; height: 120px; border-radius: 32px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); color: var(--volt); animation: kpulse 2.2s ease-in-out infinite; }
.k-qr-hint .icon { width: 58px; height: 58px; }
@keyframes kpulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(198, 244, 50, .25); } 50% { transform: scale(1.04); box-shadow: 0 0 0 18px rgba(198, 244, 50, 0); } }
.k-input { position: fixed; left: -9999px; top: 0; opacity: 0; }
@media (max-width: 860px) { .k-body { grid-template-columns: 1fr; } .k-cam { min-height: 34vh; } .k-clock { font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { .k-qr-hint, .rx-frame::after, .k-frame::after { animation: none; } }

/* ---------- Planes ---------- */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 12px; }
.gplan { --plan: var(--accent); position: relative; display: grid; gap: 10px; align-content: start; padding: 22px 20px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.gplan .pc-band { position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--plan); }
.gplan.is-featured { border-color: var(--plan); box-shadow: 0 18px 40px -22px var(--plan); }
.gplan.is-archived { opacity: .55; }
.pc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pc-kind { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.pc-star { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 99px; background: var(--plan); color: #fff; }
.gplan h3 { font-family: var(--display); font-size: 22px; letter-spacing: -.02em; }
.pc-price b { font-family: var(--display); font-size: 30px; letter-spacing: -.03em; }
.pc-price small { color: var(--muted); font-weight: 600; }
.pc-facts { list-style: none; display: grid; gap: 6px; padding: 0; margin: 0; font-size: 13.5px; color: var(--ink-2); }
.pc-facts li { display: flex; gap: 8px; }
.pc-facts li::before { content: ""; width: 6px; height: 6px; margin-top: 7px; border-radius: 50%; background: var(--plan); flex: none; }
.type-chip span { display: grid; gap: 2px; text-align: center; }
.type-chip small { font-weight: 500; color: var(--muted); font-size: 11.5px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Inicio ---------- */
.hero-hello { padding: 22px; display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; background: radial-gradient(90% 140% at 100% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%), var(--surface); }
.hero-hello h2 { font-family: var(--display); font-size: clamp(22px, 3.4vw, 30px); letter-spacing: -.03em; }
.quick-row { display: flex; gap: 8px; flex-wrap: wrap; }
.qbtn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; transition: all .15s; }
.qbtn:hover { border-color: var(--ink-2); transform: translateY(-1px); }
.qbtn.is-main { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 24px -12px var(--accent); }
@media (max-width: 640px) { .quick-row { width: 100%; display: grid; grid-template-columns: 1fr 1fr; } .qbtn { justify-content: center; } .qbtn.is-main { grid-column: 1 / -1; height: 52px; font-size: 15px; } }
.kpi-grid { margin-top: 14px; }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); text-decoration: none; color: inherit; transition: transform .15s var(--ease), box-shadow .15s; }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi .kpi-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); margin-bottom: 6px; }
.kpi.is-brand .kpi-ic { background: var(--accent-soft); color: var(--accent); }
.kpi.is-good .kpi-ic { background: var(--success-soft); color: var(--success); }
.kpi.is-bad .kpi-ic { background: var(--danger-soft); color: var(--danger); }
.kpi.is-warn .kpi-ic { background: var(--warn-soft); color: var(--warn); }
.kpi.is-bad > b { color: var(--danger); }
.kpi .kpi-l { font-weight: 700; font-size: 13.5px; }
.kpi small { color: var(--muted); font-size: 12.5px; }
.attn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 14px; }
.attn { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: inherit; text-decoration: none; font-weight: 650; font-size: 14px; transition: all .15s; }
.attn b { font-family: var(--display); font-size: 24px; letter-spacing: -.02em; }
.attn span { flex: 1; color: var(--ink-2); }
.attn > .icon:first-child { width: 34px; height: 34px; padding: 7px; border-radius: 10px; flex: none; }
.attn.is-warn > .icon:first-child { background: var(--warn-soft); color: var(--warn); }
.attn.is-bad > .icon:first-child { background: var(--danger-soft); color: var(--danger); }
.attn.is-debt > .icon:first-child { background: #fde8f1; color: #be185d; }
.attn.is-good > .icon:first-child { background: var(--success-soft); color: var(--success); }
.attn:hover { border-color: var(--ink-2); }
.attn.is-zero { opacity: .6; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sec-head .link { color: var(--accent); font-weight: 700; font-size: 13.5px; text-decoration: none; }
.person-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-2); }
.person-row:first-child { border-top: 0; }
.person-row .grow { text-decoration: none; color: inherit; min-width: 0; }
.person-row .grow small { display: block; }
.bday-card { margin-top: 18px; background: linear-gradient(120deg, #fff7d6, var(--surface) 60%); }
:root[data-theme="dark"] .bday-card { background: linear-gradient(120deg, #3a2f0a, var(--surface) 60%); }

/* Gráficos de barras (SVG) */
.bars-wrap { display: grid; gap: 6px; }
.bars { width: 100%; height: 140px; display: block; overflow: visible; }
.bars .bar { fill: color-mix(in srgb, var(--accent) 55%, var(--line)); transition: fill .15s; }
.bars .bar.is-hl { fill: var(--accent); }
.bars .bar.is-zero { fill: var(--line); }
.bars .bar-hit { fill: transparent; }
.bars g:hover .bar { fill: var(--accent); }
.bars-axis { display: flex; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bars-axis span { flex: 1; text-align: center; white-space: nowrap; overflow: hidden; }

/* ---------- Reportes ---------- */
.sec-title-plain { font-size: 14px; color: var(--muted); font-weight: 700; margin: 6px 0 -4px; }
.rank-list { display: grid; gap: 10px; }
.rank-row { display: grid; grid-template-columns: minmax(90px, 1.1fr) 2fr auto auto; gap: 10px; align-items: center; font-size: 13.5px; }
.rk-l { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-bar { height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.rk-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .6s var(--ease); }
.top-list { display: grid; }
.top-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-2); color: inherit; text-decoration: none; }
.top-row:first-child { border-top: 0; }
.top-n { width: 26px; height: 26px; border-radius: 8px; background: var(--line-2); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.top-row:nth-child(-n+3) .top-n { background: var(--volt); color: var(--volt-ink); }

/* ---------- Pagos ---------- */
.filters { display: grid; gap: 12px; margin-bottom: 14px; }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filter-row .field { min-width: 140px; flex: 0 1 170px; }
.filter-row .select { height: 44px; min-width: 150px; width: auto; flex: 1 1 170px; }
@media (max-width: 560px) { .filter-row .field { flex: 1 1 140px; } .filter-row .select { flex-basis: 100%; } }
.pay-totals { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 12px; border-radius: var(--radius-lg); background: var(--ink); color: var(--bg); }
.pt-main { display: grid; }
.pt-main b { font-family: var(--display); font-size: 30px; letter-spacing: -.03em; }
.pt-main small { opacity: .75; }
.pt-methods { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Mensajes ---------- */
.msg-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line-2); }
.msg-row:first-child { border-top: 0; }
.msg-row .grow { min-width: 0; display: grid; gap: 4px; }
.msg-row .grow a { color: inherit; text-decoration: none; }
.msg-preview { font-size: 13.5px; color: var(--ink-2); background: #e7fbe9; border-radius: 4px 14px 14px 14px; padding: 9px 12px; max-width: 560px; white-space: pre-wrap; }
:root[data-theme="dark"] .msg-preview { background: #133018; }
@media (max-width: 560px) { .msg-row { flex-wrap: wrap; } .msg-row > .btn { width: 100%; justify-content: center; } }
.serial { display: grid; gap: 14px; justify-items: start; }
.serial-who { display: flex; align-items: center; gap: 12px; }
.serial-who small { display: block; }
.tabs-icons .tab .icon { width: 16px; height: 16px; }
.toolbar.between { justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Configuración ---------- */
.hours { display: grid; gap: 6px; }
.hours-row { display: grid; grid-template-columns: 140px 1fr auto 1fr; gap: 8px; align-items: center; }
.hours-row input[type="time"] { height: 40px; }

/* ---------- Carnet (modal y página pública) ---------- */
.m-card { display: grid; gap: 14px; padding: 18px; border-radius: 22px; background: radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%), linear-gradient(160deg, #1b1446, #0b1220); color: #fff; }
.mc-top { display: flex; justify-content: space-between; align-items: baseline; }
.mc-top b { font-family: var(--display); font-size: 18px; }
.mc-top small { opacity: .65; font-size: 12px; }
.mc-who { display: flex; align-items: center; gap: 12px; }
.mc-who small { display: block; opacity: .7; }
.mc-qr { display: grid; place-items: center; padding: 14px; border-radius: 18px; background: #fff; }
.qr-canvas { width: 100%; max-width: 260px; height: auto; image-rendering: pixelated; display: block; }
.mc-state { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mc-state small { opacity: .75; }
.card-page { min-height: 100dvh; background: radial-gradient(120% 70% at 50% 0%, #3b24b8 0%, #140d3d 55%, #05080d 100%); color: #fff; }
.carnet-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.carnet { width: min(420px, 100%); display: grid; gap: 18px; padding: 24px; border-radius: 30px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(10px); box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8); }
.cn-head { display: flex; align-items: center; gap: 12px; }
.cn-head b { display: block; font-family: var(--display); font-size: 20px; }
.cn-head small { opacity: .65; }
.cn-head .biz-logo { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; background: #fff; color: var(--accent); }
.cn-who h1 { font-family: var(--display); font-size: 30px; letter-spacing: -.03em; line-height: 1.1; }
.cn-who p { opacity: .7; margin-top: 2px; }
.cn-qr { display: grid; place-items: center; padding: 18px; background: #fff; border-radius: 22px; min-height: 260px; }
.cn-state { display: grid; justify-items: center; gap: 4px; text-align: center; }
.cn-state b { font-size: 17px; }
.cn-state small { opacity: .75; }
.cn-hint { text-align: center; opacity: .75; font-size: 14px; }
.cn-hours { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 12.5px; opacity: .8; }
.cn-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }
.cn-foot a { color: var(--volt); font-weight: 700; text-decoration: none; }
.cn-foot small { opacity: .5; }

/* Las pilas de una columna no deben ensancharse por un hijo largo (evita scroll lateral en el celular) */
.form, .grid-stack, .settings-stack, .rx-results, .rx-log, .rank-list, .top-list, .ms-card, .serial, .member-hero, .rx-hero, .filters { grid-template-columns: minmax(0, 1fr); }
.msg-row .grow { flex: 1 1 0; }
.rx-item .grow, .person-row .grow, .top-row .grow { flex: 1 1 0; }
@media (max-width: 560px) { .list-row { flex-wrap: wrap; padding: 12px 16px; gap: 10px; } .list-row > .grow { flex-basis: calc(100% - 56px); } }
.field { min-width: 0; }
.hours-row { grid-template-columns: minmax(84px, 140px) minmax(0, 1fr) auto minmax(0, 1fr); }
.hours-row input { min-width: 0; width: 100%; }
.member-hero.st-active, .member-hero.st-expired, .member-hero.st-frozen { background: var(--surface); color: var(--ink); }
.member-hero.st-active::before { background: linear-gradient(120deg, color-mix(in srgb, var(--success) 14%, transparent), transparent 70%); }
body.kiosk-mode .app { display: block; }
body.kiosk-mode .main { padding-bottom: 0; }

/* ---------- Sedes ---------- */
.branch-wrap { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 6px 0 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.branch-wrap:focus-within { border-color: var(--accent); }
.branch-pick { border: 0; background: transparent; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink); max-width: 170px; padding-right: 4px; cursor: pointer; outline: none; }
@media (max-width: 640px) { .branch-wrap { height: 36px; padding-left: 8px; } .branch-pick { max-width: 112px; font-size: 13px; } }
.branch-need { display: grid; gap: 16px; }
.branch-choices { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 560px) { .branch-choices .btn { width: 100%; justify-content: center; } }
.branch-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); margin-top: 12px; }
.branch-card { display: grid; gap: 14px; align-content: start; padding: 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.branch-card.is-archived { opacity: .6; }
.bc-head { display: flex; align-items: flex-start; gap: 12px; }
.bc-head h3 { font-family: var(--display); font-size: 20px; letter-spacing: -.02em; }
.bc-ic { width: 42px; height: 42px; border-radius: 13px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.bc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bc-stats > div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line-2); display: grid; }
.bc-stats b { font-family: var(--display); font-size: 20px; }
.bc-stats small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.bc-series { display: grid; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
.bc-series-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.series-row { display: flex; align-items: center; gap: 12px; }
.series-row .grow small { display: block; }
.series-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; font-size: 15px; letter-spacing: .04em; padding: 6px 10px; border-radius: 10px; background: var(--ink); color: var(--bg); }
.check-list { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 4px 0; }
.pp-branch { color: var(--accent) !important; font-weight: 700; }
.k-branch { display: block; font-size: 13px; color: var(--volt); font-weight: 700; }
.rc-branch { font-weight: 800; color: var(--ink) !important; }

/* =============================================================
   Visitantes y Tienda
   ============================================================= */
.badge-ok { background: var(--success-soft); color: var(--success); }
.badge-visitor { background: #fff1e0; color: #b45309; }
.badge-hot { background: #ffe8ef; color: #be123c; }
:root[data-theme="dark"] .badge-visitor { background: #3a2610; color: #fbbf24; }
:root[data-theme="dark"] .badge-hot { background: #3d1220; color: #fb7185; }
.chip-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink-2); border-style: dashed; }
.chip-link:hover { border-color: var(--accent); color: var(--accent); }
.rc-item { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 2px 0; }
.rc-item span { min-width: 0; }

/* Buscador de personas (socios y visitantes) */
.pk { position: relative; }
.pk-search { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.pk-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pk-search > .icon { color: var(--muted); flex: none; }
.pk-input { flex: 1; min-width: 0; height: 100%; border: 0 !important; background: none !important; box-shadow: none !important; outline: none; font: inherit; font-size: 15px; color: var(--ink); padding: 0 !important; }
.pk-drop { position: absolute; left: 0; right: 0; top: calc(100% - 2px); z-index: 30; max-height: 340px; overflow-y: auto; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); display: grid; gap: 2px; }
.pk-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pk-opt .grow { display: grid; min-width: 0; }
.pk-opt .grow small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-opt:hover, .pk-opt.is-active { background: var(--accent-soft); }
.pk-new { border-top: 1px dashed var(--line); border-radius: 0 0 10px 10px; margin-top: 2px; }
.pk-plus { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; }
.pk-empty { padding: 10px; font-size: 13.5px; }
.pk-chosen { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border: 1.5px solid var(--accent); border-radius: var(--radius-sm); background: var(--accent-soft); }
.pk-chosen .grow { min-width: 0; }
.pk-chosen small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-extra { display: grid; gap: 6px; margin-top: 10px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--line); }
.pk-docstatus { display: flex; align-items: center; gap: 6px; color: var(--success); font-weight: 600; }
.pk-docstatus:empty { display: none; }

/* Duplicados al registrar */
.dup-box { display: grid; gap: 8px; padding: 12px; border-radius: var(--radius); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.dup-box > b { display: flex; align-items: center; gap: 6px; color: var(--warn); font-size: 13.5px; }
.dup-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface); }
.dup-row .grow { min-width: 0; }
.dup-row small { display: block; }

/* Ficha: avisos de visitante y fiado */
.visitor-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius); background: #fff6ea; color: #8a4b0b; font-size: 13.5px; position: relative; }
.visitor-note.is-debt { background: var(--danger-soft); color: var(--danger); }
:root[data-theme="dark"] .visitor-note { background: #2e2010; color: #fbbf24; }
.visitor-note .grow { min-width: 200px; }

/* Visitantes */
.vis-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.vis-row:first-child { border-top: 0; }
.vis-main { display: flex; align-items: center; gap: 12px; flex: 1 1 320px; min-width: 0; color: inherit; text-decoration: none; }
.vis-main .grow small { display: block; }
.vis-actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 560px) { .vis-actions { width: 100%; } .vis-actions > * { flex: 1; justify-content: center; } }
.vis-hits { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.attn.is-visit > .icon:first-child { background: #fff1e0; color: #c2410c; }

/* Tienda: venta rápida */
.pos { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1000px) { .pos { grid-template-columns: minmax(0, 1fr) 380px; } .cart { position: sticky; top: 84px; max-height: calc(100dvh - 100px); overflow-y: auto; } }
.pos-left { display: grid; gap: 10px; min-width: 0; }
.pos-search-wrap { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; }
.pos-search-wrap:focus-within { border-color: var(--accent); }
.pos-search-wrap > .icon { color: var(--muted); flex: none; }
.pos-search { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.prod-card { position: relative; display: grid; gap: 4px; align-content: start; min-height: 112px; padding: 12px; text-align: left; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; cursor: pointer; transition: transform .12s var(--ease), border-color .12s, box-shadow .12s; }
.prod-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.prod-card:active { transform: scale(.98); }
.prod-card.in-cart { border-color: var(--accent); background: var(--accent-soft); }
.prod-card.is-out { opacity: .5; cursor: not-allowed; }
.prod-cat { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.prod-name { font-size: 14.5px; line-height: 1.25; }
.prod-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-top: auto; }
.prod-foot b { font-family: var(--display); font-size: 17px; }
.prod-foot small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.prod-foot small.is-low { color: var(--danger); }
.prod-n { position: absolute; top: -8px; right: -8px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 99px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 13px; box-shadow: 0 0 0 3px var(--bg); }
.cart { padding: 16px; display: grid; gap: 12px; }
.cart-head { display: flex; justify-content: space-between; align-items: center; }
.cart-head h3 { display: flex; align-items: center; gap: 6px; font-size: 17px; }
.cart-lines { display: grid; gap: 2px; }
.cart-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.cart-line .grow { min-width: 0; }
.cart-line .grow b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-line .grow small { display: block; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex: none; }
.qty button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: var(--surface-2); color: var(--ink); cursor: pointer; }
.qty button:hover { background: var(--accent-soft); color: var(--accent); }
.qty span { min-width: 30px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.cart-empty { display: grid; justify-items: center; gap: 6px; padding: 18px 0; text-align: center; font-size: 13.5px; }
.cart-totals { display: grid; gap: 4px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.cart-note { margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; }
.cart-note.is-ok { background: var(--warn-soft); color: var(--warn); }
.cart-note.is-bad { background: var(--danger-soft); color: var(--danger); }
.pos-fab { position: fixed; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 40; display: flex; align-items: center; justify-content: center; gap: 8px; height: 52px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); font-weight: 800; text-decoration: none; box-shadow: 0 14px 30px -12px var(--accent); }
.pos-fab[hidden] { display: none !important; }
@media (min-width: 1000px) { .pos-fab { display: none !important; } }
.cart-form { gap: 12px; }

/* Inventario */
.inv-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 18px; }
.inv-btn { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; cursor: pointer; transition: border-color .15s, transform .15s; }
.inv-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.inv-btn small { color: var(--muted); font-size: 12.5px; }
.inv-btn .qa-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.top-n.is-zero { background: var(--danger-soft) !important; color: var(--danger) !important; }

/* ---------- Pago mixto ---------- */
.link-btn { border: 0; background: none; padding: 4px 0; color: var(--accent); font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; justify-self: start; }
.link-btn:hover { text-decoration: underline; }
.pay-single { display: grid; gap: 10px; }
.split-box { display: grid; gap: 8px; padding: 12px; border-radius: var(--radius); border: 1px dashed var(--accent); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.split-rows { display: grid; gap: 8px; }
.split-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(90px, 1fr) minmax(0, 1.2fr) auto; gap: 6px; align-items: center; }
.split-row select, .split-row input { height: 42px; min-width: 0; width: 100%; }
.split-row input[hidden] { display: block; visibility: hidden; }
@media (max-width: 520px) { .split-row { grid-template-columns: 1fr 1fr auto; } .split-row input:nth-of-type(2) { grid-column: 1 / 3; grid-row: 2; } .split-row input[hidden] { display: none; } }
.split-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.split-info { display: flex; gap: 10px; align-items: center; font-size: 13.5px; flex-wrap: wrap; }
.split-info.is-ok b:last-child { color: var(--success); }
.split-info.is-warn b:last-child { color: var(--warn); }
.split-info.is-bad b:last-child { color: var(--danger); }
.pm-mix { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.pm-card .pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pm-tile { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); }
.pm-tile .grow { display: grid; gap: 2px; min-width: 0; }
.pm-tile small { font-weight: 700; color: var(--muted); }
.pm-tile b { font-family: var(--display); font-size: 22px; letter-spacing: -.02em; }
.pm-tile span.muted { font-size: 12px; }
.pm-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--line-2); color: var(--ink-2); }
.pm-tile.pm-cash .pm-ic { background: var(--success-soft); color: var(--success); }
.pm-tile.pm-yape .pm-ic { background: #f6ecf8; color: #742284; }
.pm-tile.pm-plin .pm-ic { background: #e0f7f9; color: #00707b; }
.pm-tile.pm-card .pm-ic { background: #e0e7ff; color: #3730a3; }
.pm-tile.pm-cash { border-color: color-mix(in srgb, var(--success) 35%, var(--line)); }

/* ---------- Cuentas abiertas (paga al salir) ---------- */
.when-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.when-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font: inherit; font-weight: 700; cursor: pointer; }
.when-btn.is-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.tab-note { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-soft); color: var(--ink-2); font-size: 13.5px; }
.tab-note .icon { color: var(--accent); flex: none; margin-top: 2px; }
.tab-who { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line-2); }
.tab-lines { display: grid; }
.tab-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.tabs-panel { margin-bottom: 16px; border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: linear-gradient(180deg, var(--warn-soft), var(--surface) 70%); }
.tabs-panel h3 { display: flex; align-items: center; gap: 6px; }
.tab-list { display: grid; }
.tab-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.tab-row:first-child { border-top: 0; }
.tab-row .grow { min-width: 200px; }
.tab-row .grow small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-row.is-old { opacity: .9; }
.tab-actions { display: flex; gap: 6px; }
@media (max-width: 560px) { .tab-actions { width: 100%; } .tab-actions .btn-primary, .tab-actions .btn-outline { flex: 1; justify-content: center; } }
.tab-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border-radius: var(--radius); background: var(--warn-soft); }
.tab-strip .chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); }
.tab-info { display: grid; gap: 8px; }
.tab-strip .chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* =============================================================
   Cobrix: clientes, cobros, prospectos, agenda y notificaciones
   ============================================================= */
.today-hero { align-items: flex-start; }
.today-sec { margin-top: 22px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 10px; }
.sec-head h3 { font-family: var(--display); font-size: 18px; letter-spacing: -.02em; display: inline-flex; align-items: center; gap: 4px; }
.sec-head .money { font-size: 16px; }
.sec-sub { font-size: 14px; color: var(--muted); font-weight: 700; margin: 18px 2px 10px; }
.chip-n.is-bad { background: var(--danger); color: #fff; }
.ok-note { display: flex; align-items: center; gap: 8px; color: var(--success); font-weight: 600; }
.date-pill { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; align-content: center; background: var(--accent-soft); color: var(--accent); flex: none; line-height: 1; }
.date-pill b { font: 800 17px/1 var(--display); }
.date-pill small { font-size: 10.5px; font-weight: 700; text-transform: uppercase; }
.ag-card .kpi-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); flex: none; }
.ag-badge.is-late { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.list-row .kpi-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); flex: none; }
.list-row .text-right small { display: block; }
a.list-row { color: inherit; text-decoration: none; }
a.list-row:hover { background: var(--surface-2); }
.client-row .badge { margin-top: 3px; }
.mt-6 { margin-top: 6px; }
.hide-sm { }
@media (max-width: 640px) { .hide-sm { display: none; } }
.stack-sm { }
@media (max-width: 760px) { .grid-2.stack-sm { grid-template-columns: minmax(0, 1fr); } }

/* Push */
.push-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-top: 14px; border: 1px dashed var(--accent); background: linear-gradient(120deg, var(--accent-soft), var(--surface) 70%); flex-wrap: wrap; }
.push-card .grow { flex: 1 1 240px; min-width: 0; }
.push-card .grow b { display: block; font-size: 15px; }
.push-card .grow small { display: block; font-size: 13px; }
.push-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; }
.push-ic.is-on { background: var(--success); }
.push-panel .sec-title { margin-bottom: 12px; }
.warn-note { background: var(--warn-soft); color: var(--warn); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin: 12px 0 0; }
.notif-list .notif-item .grow small + small { margin-top: 2px; }
.notif-list .notif-item .grow small { white-space: pre-line; }

/* Ficha del cliente */
.client-hero { padding: 18px; display: grid; gap: 16px; margin-bottom: 14px; }
.ch-top { display: flex; align-items: flex-start; gap: 14px; }
.ch-top .grow { min-width: 0; flex: 1; }
.ch-top h2 { font-family: var(--display); font-size: clamp(20px, 3vw, 26px); letter-spacing: -.03em; line-height: 1.15; }
.ch-top .back-btn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-2); flex: none; }
.ch-top .back-btn:hover { background: var(--line-2); }
.ch-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ch-stat { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line-2); display: grid; gap: 2px; }
.ch-stat b { font: 750 20px/1.2 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ch-stat small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.ch-stat.is-bad { background: var(--danger-soft); border-color: transparent; }
.ch-stat.is-bad b { color: var(--danger); }
.ch-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) { .ch-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .ch-stats .ch-stat:last-child { grid-column: 1 / -1; } .ch-actions .btn { flex: 1 1 auto; } }
.note-box { margin: 12px 0 0; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line-2); white-space: pre-wrap; font-size: 14px; color: var(--ink-2); }
.next-box { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); }
.next-box > .icon { color: var(--accent); flex: none; }
.next-box.is-late { background: var(--warn-soft); }
.next-box.is-late > .icon { color: var(--warn); }
.next-box small { display: block; color: var(--ink-2); }
.timeline { padding: 6px 0; }
.tl-item { display: flex; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); }
.tl-item:last-child { border-bottom: 0; }
.tl-ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--line-2); flex: none; font-size: 15px; }
.tl-item p { margin: 0 0 2px; white-space: pre-wrap; font-size: 14px; }
.pay-head { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line-2); }
.pay-done { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 10px 0; }
.input-lg { height: 54px; font-size: 22px; font-weight: 750; }
.form-section { display: grid; gap: 12px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); }
.charge-box .form-section { background: var(--accent-soft); border-color: transparent; }
.hint { display: block; color: var(--muted); font-size: 12.5px; }
details.more > summary { cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--accent); padding: 4px 0; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: '+ '; }
details.more[open] > summary::before { content: '− '; }
details.more[open] { display: grid; gap: 12px; }
.check-item input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.check-item span b, .check-item span small { display: block; }
.label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.chips.wrap { flex-wrap: wrap; }
.sum-bar { font-size: 14px; }
.sum-bar .money { font-size: 16px; }
.field.inline { display: inline-grid; grid-template-columns: auto auto; align-items: center; gap: 8px; }
.field.inline span { margin: 0; }
.text-danger { color: var(--danger) !important; }
.money.bad, small.bad { color: var(--danger); }
small.ok { color: var(--success); }

/* Recordatorios */
.task-list { overflow: hidden; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.task-row:last-child { border-bottom: 0; }
.task-row .grow { flex: 1; min-width: 0; }
.task-row .grow b { display: block; font-size: 14.5px; }
.task-row .grow small { display: block; font-size: 12.5px; }
.task-row .grow small a { color: var(--accent); text-decoration: none; font-weight: 600; }
.task-row.is-late .grow small { color: var(--danger); }
.task-row.is-done .grow b { text-decoration: line-through; color: var(--muted); }
.task-check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; color: #fff; padding: 0; }
.task-check:hover { border-color: var(--accent); }
.task-check.is-done { background: var(--success); border-color: var(--success); }

/* Prospectos: tablero */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kb-col { display: grid; align-content: start; gap: 10px; padding: 10px; border-radius: var(--radius-lg); background: var(--line-2); min-height: 200px; transition: background .15s; }
.kb-col.is-over { background: var(--accent-soft); outline: 2px dashed var(--accent); }
.kb-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.kb-card { padding: 12px; display: grid; gap: 8px; cursor: grab; border-left: 3px solid transparent; }
.kb-card.is-late { border-left-color: var(--warn); }
.kb-card.is-drag { opacity: .5; }
.kb-who { text-decoration: none; color: inherit; display: grid; gap: 2px; }
.kb-who small { font-size: 12.5px; }
.kb-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.kb-actions { display: flex; gap: 6px; }
.kb-actions .btn-wa { padding: 0 10px; }

/* Agenda */
.agenda-wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .agenda-wrap { grid-template-columns: minmax(0, 1fr); } }
.cal { padding: 14px; }
.cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.cal-head h3 { flex: 1; text-align: center; font-family: var(--display); font-size: 18px; letter-spacing: -.02em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { text-align: center; font-size: 11.5px; font-weight: 800; color: var(--muted); padding: 4px 0; }
.cal-day { position: relative; min-height: 64px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); padding: 6px 4px 4px; display: grid; justify-items: center; align-content: start; gap: 2px; cursor: pointer; font: inherit; color: inherit; }
.cal-day:hover { border-color: var(--ink-2); }
.cal-day.is-empty { border: 0; background: none; cursor: default; }
.cal-day.is-today .cal-n { background: var(--accent); color: var(--accent-ink); }
.cal-day.is-sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--accent-soft); }
.cal-day.is-late { background: linear-gradient(180deg, var(--danger-soft), var(--surface)); }
.cal-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 750; }
.cal-amt { font-size: 10.5px; font-weight: 750; color: var(--ink-2); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.cal-dots { display: flex; gap: 3px; }
.cal-dots i, .cal-legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-due { background: var(--accent); } .dot-promise { background: #2563eb; } .dot-lead { background: #f59e0b; } .dot-task { background: #db2777; } .dot-exp { background: var(--line); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 12px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-skel { min-height: 64px; border-radius: 12px; }
@media (max-width: 560px) { .cal-day { min-height: 52px; } .cal-amt { display: none; } }
.ev-row.is-done { opacity: .6; }
.ev-row.is-late b { color: var(--danger); }
.ev-emo { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--line-2); flex: none; font-size: 17px; }
.ev-row .grow { text-decoration: none; color: inherit; }

/* Reportes */
.duo-bars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: end; height: 190px; padding-top: 10px; }
.duo { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 6px; justify-items: center; }
.duo-cols { display: flex; align-items: flex-end; gap: 4px; height: 100%; width: 100%; justify-content: center; }
.duo-cols span { width: 34%; max-width: 26px; border-radius: 8px 8px 3px 3px; min-height: 2px; }
.duo-exp { background: var(--line); }
.duo-col { background: var(--accent); }
.duo small { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: capitalize; }
.card-pad .aging-row { grid-template-columns: 110px 1fr 100px; margin-top: 10px; }
.card-pad .aging-track i { background: var(--danger); }
.kv-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.kv-row:last-child { border-bottom: 0; }

/* Estado de cuenta público */
.st-page { background: var(--bg); }
.st-wrap { max-width: 520px; margin: 0 auto; padding: 20px 16px 40px; display: grid; gap: 14px; }
.st-head { display: flex; align-items: center; gap: 12px; }
.st-head b { display: block; font-size: 16px; }
.st-head small { color: var(--muted); font-size: 12.5px; }
.st-logo { width: 46px; height: 46px; border-radius: 14px; object-fit: cover; flex: none; }
.st-ini { display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 800 20px/1 var(--display); }
.st-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm); }
.st-card h2 { font-size: 15px; margin-bottom: 8px; }
.st-hero h1 { font-family: var(--display); font-size: 26px; letter-spacing: -.03em; margin: 2px 0 14px; }
.st-hero > small { color: var(--muted); }
.st-big { padding: 16px; border-radius: var(--radius); background: var(--accent-soft); display: grid; gap: 2px; }
.st-big small { font-weight: 700; color: var(--ink-2); }
.st-big b { font: 800 30px/1.1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.st-big.is-bad { background: var(--danger-soft); } .st-big.is-bad b { color: var(--danger); }
.st-big.is-today { background: var(--warn-soft); } .st-big.is-today b { color: var(--warn); }
.st-big.is-ok { background: var(--success-soft); } .st-big.is-ok b { color: var(--success); font-size: 24px; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.st-row:last-child { border-bottom: 0; }
.st-row b { display: block; font-size: 14.5px; }
.st-row small { color: var(--muted); font-size: 12.5px; }
.st-row.is-bad small { color: var(--danger); }
.st-amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-pay { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.st-pay > div { flex: 1; } .st-pay b { display: block; font-size: 17px; letter-spacing: .02em; } .st-pay small { color: var(--muted); }
.st-pay-ic { width: 52px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; color: #fff; background: #742284; flex: none; }
.st-plin .st-pay-ic { background: #00a5b5; }
.st-copy { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 7px 12px; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.st-banks { margin-top: 10px; font-size: 14px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.st-note { margin: 10px 0 0; color: var(--ink-2); font-size: 13.5px; }
.st-wa { display: block; text-align: center; padding: 15px; border-radius: var(--radius); background: #25d366; color: #05210f; font-weight: 800; text-decoration: none; }
.st-foot { text-align: center; color: var(--muted); font-size: 12px; }

/* ---------- Servicios (catálogo) ---------- */
.list-row .right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; flex: none; }
.list-row .right small { font-size: 12px; }
.svc-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--accent, #0e9f6e) 12%, transparent); color: var(--accent, #0e9f6e); }
.svc-row .grow small { display: block; }
.svc-row.is-muted { opacity: .55; }
