/* Estilos del panel y de las páginas del cliente (se cargan después de site.css) */
body.app { background: #f4f1ea; }
.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--dark); color: #cfdcd3; padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.side .logo { padding: 6px 10px 18px; }
.side button.tab { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; border-radius: 10px; cursor: pointer; text-align: left; }
.side button.tab:hover { background: rgba(255,255,255,.06); color: #fff; }
.side button.tab.on { background: rgba(232,163,61,.16); color: #fff; }
.side .ic { width: 22px; text-align: center; }
.side .me { margin-top: auto; border-top: 1px solid #2a3c32; padding: 14px 10px 0; font-size: .85rem; }
.side .me a, .side .me button { color: #9fb3a5; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
.main { padding: 28px clamp(16px, 3vw, 40px) 100px; min-width: 0; }
.main h1 { font-size: 1.9rem; margin-bottom: 4px; }
.sub { color: var(--muted); margin-bottom: 24px; }
.trial { background: #fff6e5; border: 1px solid #f1d39a; color: #7a5410; padding: 10px 14px; border-radius: 12px; margin-bottom: 20px; font-size: .9rem; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 20px; }
.panel h2 { font-family: var(--font); font-size: 1.1rem; font-weight: 800; margin-bottom: 14px; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.kpi .l { font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.kpi .v { font-size: 1.8rem; font-weight: 800; margin: 4px 0; }
.kpi .d { font-size: .8rem; font-weight: 700; }
.up { color: var(--ok); } .down { color: var(--bad); } .flat { color: var(--muted); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1; min-width: 160px; }
.row > .btn, .row > .shrink { flex: 0 0 auto; min-width: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.two-wide { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
table.list { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.list th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.list td { padding: 12px 10px; border-bottom: 1px solid #f0ebe0; }
table.list tr.click { cursor: pointer; } table.list tr.click:hover td { background: #faf7f0; }
.chip { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--bg-2); color: var(--ink-2); }
.chip.Activo { background: #e1efe4; color: #2f5d3a; } .chip.Asiduo { background: #dfe9fb; color: #2a4f8f; } .chip.Inactivo { background: #fbe4e1; color: #a5372a; } .chip[class*="Recién"] { background: #fff1d6; color: #8a5a10; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }
.live li { list-style: none; padding: 10px 0; border-bottom: 1px solid #f0ebe0; display: flex; gap: 10px; font-size: .9rem; }
.live { padding: 0; margin: 0; }
.live .t { color: var(--muted); font-size: .8rem; margin-left: auto; white-space: nowrap; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b i { display: block; width: 100%; background: var(--brand-2); border-radius: 6px 6px 2px 2px; min-height: 2px; transition: height .3s; }
.bars .b span { font-size: .68rem; color: var(--muted); }
.bars .b:hover i { background: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--dark); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 600; opacity: 0; transition: .25s; z-index: 200; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--bad); }
.modal-bg { position: fixed; inset: 0; background: rgba(10,20,14,.55); display: grid; place-items: center; z-index: 150; padding: 16px; }
.modal { background: #fff; border-radius: 18px; width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 24px; position: relative; }
.modal .x { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 24px; cursor: pointer; color: var(--muted); }
#reader { width: 100%; max-width: 420px; border-radius: 14px; overflow: hidden; background: #000; }
.cust-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; flex: none; }
.big-btn { width: 100%; justify-content: center; font-size: 1.1rem; padding: 1em; }
.reward-box { background: #fff6e5; border: 1.5px solid #f1d39a; border-radius: 12px; padding: 12px 14px; margin: 10px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; margin: 12px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatches button.on { box-shadow: 0 0 0 2px var(--ink); }
.icons { display: flex; flex-wrap: wrap; gap: 6px; }
.icons button { width: 42px; height: 42px; font-size: 22px; border: 1px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; }
.icons button.on { border: 2px solid var(--brand); background: #eef5ef; }
.preview-phone { position: sticky; top: 20px; }
.mobile-tabs { display: none; }
.err-msg { color: var(--bad); font-weight: 600; font-size: .9rem; min-height: 1.3em; margin-top: 8px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .mobile-tabs { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--dark); z-index: 80; overflow-x: auto; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .mobile-tabs button { flex: 1 0 auto; min-width: 68px; background: none; border: 0; color: #a9bbaf; font: inherit; font-size: .7rem; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; cursor: pointer; }
  .mobile-tabs button span { font-size: 20px; }
  .mobile-tabs button.on { color: #fff; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .two, .two-wide { grid-template-columns: 1fr; }
  .preview-phone { position: static; }
  .hide-sm { display: none; }
}

/* Páginas del cliente */
body.client { background: #ecebe6; min-height: 100vh; display: flex; justify-content: center; padding: 20px 16px 40px; }
.client-wrap { width: min(420px, 100%); }
.client .pass { padding: 20px; }
.client .stamp { font-size: 24px; }
.client-section { background: #fff; border-radius: 16px; padding: 18px; margin-top: 14px; }
.notif { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f0ebe0; font-size: .95rem; }
.notif:last-child { border: 0; }
.notif small { color: var(--muted); display: block; }
.badge-new { background: var(--accent); color: #1d1405; font-size: .7rem; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.celebrate { animation: pop .6s ease; }
@keyframes pop { 50% { transform: scale(1.04); } }
.back-fields div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f0ebe0; font-size: .92rem; }
.back-fields div span:first-child { color: var(--muted); }

/* Impresión del kit */
@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea { position: absolute; inset: 0; }
}
/* Official Google Wallet badge: preserve its aspect ratio and clear space. */
.wallet-section { text-align: center; }
.wallet-section[hidden] { display: none; }
.wallet-button { display: inline-block; border: 0; background: transparent; padding: 8px; cursor: pointer; max-width: 100%; }
.wallet-button img { display: block; height: 48px; width: auto; max-width: 100%; }
.wallet-button:focus-visible { outline: 3px solid #2f5d3a; outline-offset: 3px; border-radius: 8px; }
.wallet-button:disabled { opacity: .65; cursor: wait; }
.wallet-error { margin: 8px 0 0; color: #9b2525; font-size: .9rem; }
