/* Repite escritorio — mismo tema "noche índigo" que la página principal */
:root {
  --bg: #061a1c; --bg2: #0a2427; --surface: #0e2f33; --surface2: #133c41;
  --line: rgba(255,255,255,.11); --text: #f1fffc; --muted: #9fcfca;
  --amber: #ffb547; --amber2: #ff8a3d; --coral: #ff5c7a; --violet: #14d4c0; --mint: #4ade80; --cyan: #22d3ee;
  --display: "Bahnschrift SemiBold Condensed", "Bahnschrift", "Arial Narrow", Impact, sans-serif;
  --body: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--body); font-size: 14.5px; overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--amber); }
h1, h2, h3, .display { font-family: var(--display); text-transform: uppercase; font-weight: 700; letter-spacing: .015em; line-height: 1; margin: 0; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 10px; } ::-webkit-scrollbar-track { background: transparent; }

#bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
#bg .blob { position: absolute; border-radius: 50%; filter: blur(100px); }
#bg .a { width: 560px; height: 560px; background: var(--violet); top: -190px; left: -170px; opacity: .55; animation: drift 18s ease-in-out infinite; }
#bg .b { width: 520px; height: 520px; background: var(--amber2); bottom: -220px; right: -150px; opacity: .38; animation: drift 22s ease-in-out infinite reverse; }
@keyframes drift { 50% { transform: translate(50px, 36px); } }
#app, #modal-root, #toasts { position: relative; z-index: 1; }
#app { height: 100vh; }

/* ---------- iconos ---------- */
.ico { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.lg { width: 24px; height: 24px; } .ico.sm { width: 15px; height: 15px; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.07); cursor: pointer; font-weight: 700; font-size: 13.5px; transition: transform .18s, background .18s, box-shadow .18s; white-space: nowrap; }
.btn:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(135deg, var(--amber), var(--amber2)); color: #2a1300; border: 0; box-shadow: 0 8px 22px rgba(255,138,61,.3); }
.btn.primary:hover { box-shadow: 0 12px 30px rgba(255,138,61,.5); }
.btn.danger { color: #ff9bb0; border-color: rgba(255,92,122,.4); }
.btn.sm { height: 32px; padding: 0 13px; font-size: 12.5px; }
.btn.icon { width: 36px; padding: 0; }
.btn.block { width: 100%; }

/* ---------- formularios ---------- */
label.f { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.17); border-radius: 12px; padding: 10px 13px; outline: 0; transition: border-color .15s, box-shadow .15s; color-scheme: dark; }
.input:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255,181,71,.22); }
.input::placeholder { color: rgba(255,255,255,.35); }
select.input option { background: #0e2f33; }
textarea.input { resize: vertical; min-height: 90px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.field { margin-bottom: 14px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 5px; line-height: 1.45; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.check input { accent-color: var(--amber); width: 17px; height: 17px; }

/* ---------- login ---------- */
.login { height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-box { width: 100%; max-width: 440px; animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--display); text-transform: uppercase; font-weight: 700; font-size: 25px; }
.brand .bi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--amber), var(--coral)); color: #2a1300; }
.login .brand { justify-content: center; font-size: 34px; margin-bottom: 8px; } .login .brand .bi { width: 50px; height: 50px; border-radius: 15px; }
.login .sub { text-align: center; color: var(--muted); margin: 0 0 22px; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.card { background: linear-gradient(180deg, #0f3236, rgba(14, 47, 51,.72)); border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: 0 18px 40px rgba(0,0,0,.28); }
.err { background: rgba(255,92,122,.16); border: 1px solid rgba(255,92,122,.45); color: #ffd5dc; padding: 10px 13px; border-radius: 12px; margin-bottom: 14px; font-size: 13.5px; }
.okmsg { background: rgba(74,222,128,.14); border: 1px solid rgba(74,222,128,.4); color: #c9f7da; padding: 10px 13px; border-radius: 12px; margin-bottom: 14px; font-size: 13.5px; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; text-decoration: underline; }

/* ---------- estructura ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; height: 100vh; }
.side { background: rgba(6, 26, 28,.78); backdrop-filter: blur(14px); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.side .brand { padding: 0 8px 18px; }
.nav { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 14px; border: 0; background: none; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 14.5px; text-align: left; transition: all .18s; position: relative; }
.nav:hover { background: rgba(255,255,255,.09); color: #fff; transform: translateX(3px); }
.nav.on { background: linear-gradient(135deg, rgba(255,181,71,.22), rgba(255,92,122,.18)); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,181,71,.45); }
.nav.on .ico { color: var(--amber); }
.nav .dot { margin-left: auto; min-width: 20px; height: 20px; border-radius: 10px; background: var(--coral); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; padding: 0 6px; animation: pop .4s both; }
@keyframes pop { from { transform: scale(0); } }
.side .who { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.side .who b { display: block; color: var(--text); font-size: 13.5px; margin-bottom: 2px; word-break: break-all; }
.rolechip { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: rgba(20, 212, 192,.25); color: #9bfff0; margin-bottom: 6px; }
.rolechip.biz { background: rgba(255,181,71,.18); color: var(--amber); }
.main { overflow-y: auto; padding: 28px 34px 40px; }
.imp { display: flex; align-items: center; gap: 12px; background: linear-gradient(90deg, rgba(20, 212, 192,.35), rgba(255,92,122,.25)); border: 1px solid rgba(20, 212, 192,.6); border-radius: 16px; padding: 10px 14px; margin-bottom: 20px; animation: rise .4s both; }
.imp b { font-weight: 800; } .imp .btn { margin-left: auto; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.pagehead h1 { font-size: 40px; } .pagehead p { margin: 6px 0 0; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- tarjetas / kpi ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi { padding: 18px 20px; border-radius: 20px; background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.025)); border: 1px solid var(--line); animation: rise .6s both; position: relative; overflow: hidden; }
.kpi .l { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi .n { font-family: var(--display); font-size: 40px; font-weight: 700; margin-top: 6px; line-height: 1; background: linear-gradient(100deg, var(--amber), var(--coral)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi .ki { position: absolute; right: 14px; top: 14px; opacity: .35; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.biz { padding: 20px; border-radius: 22px; background: linear-gradient(180deg, #0f3236, rgba(14, 47, 51,.7)); border: 1px solid var(--line); transition: transform .25s, border-color .25s; animation: rise .5s both; display: flex; flex-direction: column; gap: 12px; }
.biz:hover { transform: translateY(-4px); border-color: rgba(255,181,71,.5); }
.biz h3 { font-size: 24px; } .biz .meta { color: var(--muted); font-size: 13px; line-height: 1.5; }
.biz .stats { display: flex; gap: 16px; padding: 10px 0; border-block: 1px solid var(--line); }
.biz .stats div { flex: 1; text-align: center; } .biz .stats b { display: block; font-family: var(--display); font-size: 26px; } .biz .stats span { font-size: 11.5px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.1); }
.chip.green { background: rgba(74,222,128,.17); color: #8ef0b3; } .chip.amber { background: rgba(255,181,71,.18); color: var(--amber); }
.chip.red { background: rgba(255,92,122,.2); color: #ffa3b5; } .chip.violet { background: rgba(20, 212, 192,.25); color: #9bfff0; }

/* ---------- tabla ---------- */
.tablewrap { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: rgba(255,255,255,.03); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 13px 16px; background: rgba(255,255,255,.05); font-weight: 700; }
td { padding: 13px 16px; border-top: 1px solid var(--line); }
tbody tr { cursor: pointer; transition: background .15s; } tbody tr:hover { background: rgba(255,255,255,.07); }
tbody tr.fresh { animation: flash 2.4s ease-out; }
@keyframes flash { 0% { background: rgba(255,181,71,.4); } 100% { background: transparent; } }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: linear-gradient(135deg, var(--violet), var(--coral)); flex: none; }
.person { display: flex; align-items: center; gap: 11px; }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); } .empty .ico { width: 44px; height: 44px; opacity: .5; margin-bottom: 10px; }
.searchbox { position: relative; flex: 1; max-width: 420px; } .searchbox .ico { position: absolute; left: 13px; top: 11px; color: var(--muted); } .searchbox .input { padding-left: 40px; border-radius: 999px; }

/* ---------- QR ---------- */
.qrcard { padding: 20px; border-radius: 22px; background: linear-gradient(180deg, #0f3236, rgba(14, 47, 51,.7)); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; animation: rise .5s both; }
.qrcard h3 { font-size: 22px; } .qrimg { background: #fff; border-radius: 16px; padding: 10px; align-self: center; } .qrimg img { width: 150px; height: 150px; display: block; }

/* ---------- campañas ---------- */
.types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.type { text-align: left; padding: 18px; border-radius: 20px; background: rgba(255,255,255,.05); border: 1px solid var(--line); cursor: pointer; transition: all .2s; color: inherit; display: flex; flex-direction: column; gap: 8px; }
.type:hover { transform: translateY(-4px); border-color: rgba(255,181,71,.55); background: rgba(255,255,255,.09); }
.type .ti { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #1c0b00; background: linear-gradient(135deg, var(--c1, var(--amber)), var(--c2, var(--coral))); }
.type b { font-family: var(--display); text-transform: uppercase; font-size: 20px; letter-spacing: .02em; } .type span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.camp { padding: 18px 20px; border-radius: 20px; background: linear-gradient(180deg, #0f3236, rgba(14, 47, 51,.7)); border: 1px solid var(--line); display: flex; gap: 16px; align-items: center; margin-bottom: 12px; animation: rise .5s both; flex-wrap: wrap; }
.camp .ti { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #1c0b00; background: linear-gradient(135deg, var(--c1, var(--amber)), var(--c2, var(--coral))); flex: none; }
.camp .info { flex: 1; min-width: 220px; } .camp .info b { font-size: 16px; } .camp .info p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.section-title { font-size: 26px; margin: 28px 0 14px; }

/* ---------- modal / toasts ---------- */
.overlay { position: fixed; inset: 0; background: rgba(2, 12, 13,.7); backdrop-filter: blur(6px); z-index: 50; display: grid; place-items: center; padding: 24px; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; background: #0b2a2d; border: 1px solid rgba(255,181,71,.35); border-radius: 26px; padding: 26px; box-shadow: 0 40px 90px rgba(0,0,0,.6); animation: rise .35s cubic-bezier(.2,.7,.2,1) both; }
.modal.wide { max-width: 760px; }
.modal h2 { font-size: 32px; margin-bottom: 4px; } .modal .mh { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; } .modal .mh p { margin: 6px 0 0; color: var(--muted); }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 14px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; word-break: break-word; }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-radius: 16px; background: #133c41; border: 1px solid rgba(255,181,71,.5); box-shadow: 0 16px 40px rgba(0,0,0,.45); max-width: 380px; animation: toastin .4s cubic-bezier(.2,.9,.3,1.3) both; }
.toast.err { background: #4a1530; border-color: var(--coral); } .toast.good { border-color: var(--mint); }
.toast .ti { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--amber), var(--coral)); color: #2a1300; flex: none; }
.toast.out { animation: toastout .3s both; }
@keyframes toastin { from { opacity: 0; transform: translateX(60px); } } @keyframes toastout { to { opacity: 0; transform: translateX(60px); } }
.loading { display: grid; place-items: center; padding: 70px; color: var(--muted); }
.spin { width: 30px; height: 30px; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--amber); border-radius: 50%; animation: spin .8s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.steps { display: flex; gap: 6px; margin: 10px 0 0; }
.progress { height: 8px; border-radius: 6px; background: rgba(255,255,255,.12); overflow: hidden; } .progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), var(--coral)); border-radius: 6px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } .types { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* pantalla completa */
.fscorner { position: fixed; top: 14px; right: 14px; z-index: 60; }
body.is-fs .main { padding-top: 22px; }

.live { font-family: var(--body); text-transform: none; letter-spacing: 0; vertical-align: middle; margin-left: 10px; animation: livepulse 1.6s ease-in-out infinite; }
@keyframes livepulse { 50% { opacity: .45; } }
input[type=checkbox], input[type=radio] { accent-color: var(--amber); width: 17px; height: 17px; }

/* =====================================================================
   VERSIÓN WEB / PWA — responsive y nivel «cliente» (solo se AÑADE; el diseño existente no se toca)
   ===================================================================== */
html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior: none; }
.shell { height: 100dvh; } #app, .login { height: 100dvh; min-height: 100dvh; }
.login { overflow-y: auto; padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom)); align-items: start; }
.login-box { margin: auto; }
a.link, .link { color: var(--amber); text-decoration: underline; }
.hidden { display: none !important; }
.topbar, .tabbar, .scrim { display: none; }
.input, select.input, textarea.input { font-size: 16px; }

/* franja de la demo */
.demobar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(6,26,28,.94); backdrop-filter: blur(10px); border-top: 1px solid rgba(255,181,71,.4); font-size: 12.5px; }
.demobar .demoroles { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; }
body:has(.demobar) .main { padding-bottom: 96px; }
body:has(.demobar) .tabbar { bottom: 54px; }

/* alta por QR */
.jhead { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.jbrand { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; color: #1c0b00; flex: none; overflow: hidden; }
.jbrand img { width: 100%; height: 100%; object-fit: cover; }
.jname { font-size: 34px; word-break: break-word; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: rgba(255,255,255,.07); border-radius: 999px; margin-bottom: 16px; }
.seg button { border: 0; background: none; height: 38px; border-radius: 999px; cursor: pointer; font-weight: 700; color: var(--muted); }
.seg button.on { background: linear-gradient(135deg, var(--amber), var(--amber2)); color: #1c0b00; }

/* cliente: bandeja y chats */
.cmain { padding: 28px 34px 40px; }
.cview { animation: rise .35s both; max-width: 1180px; }
.pushcard { margin-bottom: 16px; } .pushcard .ti { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #1c0b00; background: linear-gradient(135deg, var(--amber), var(--amber2)); flex: none; }
.inboxwrap { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: stretch; min-height: min(620px, calc(100dvh - 210px)); }
.threads { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: calc(100dvh - 210px); }
.thread { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.05); cursor: pointer; text-align: left; transition: background .18s, border-color .18s; width: 100%; }
.thread:hover { background: rgba(255,255,255,.1); } .thread.on { border-color: rgba(255,181,71,.55); background: linear-gradient(135deg, rgba(255,181,71,.16), rgba(255,92,122,.12)); }
.tav { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 20px; color: #1c0b00; flex: none; text-transform: uppercase; }
.tmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; } .tname { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tprev { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tside { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; } .ttime { font-size: 11.5px; color: var(--muted); }
.tbadge { min-width: 22px; height: 22px; border-radius: 11px; background: var(--coral); color: #fff; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; padding: 0 6px; }
.chatpane { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(180deg, #0f3236, rgba(14,47,51,.72)); overflow: hidden; min-width: 0; }
.chatempty { margin: auto; }
.chathead { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.backbtn { display: none; }
.chatlog { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100dvh - 330px); min-height: 280px; }
.chatfoot { padding: 10px 16px; border-top: 1px solid var(--line); margin: 0; text-align: center; }
.dsep { text-align: center; margin: 6px 0; } .dsep span { font-size: 11.5px; color: var(--muted); background: rgba(255,255,255,.08); padding: 3px 12px; border-radius: 999px; }
.bubble { max-width: min(520px, 88%); align-self: flex-start; background: rgba(255,255,255,.09); border: 1px solid var(--line); border-radius: 6px 20px 20px 20px; padding: 12px 14px; animation: rise .35s both; }
.bubble.new { border-color: rgba(255,181,71,.6); box-shadow: 0 0 0 3px rgba(255,181,71,.12); }
.bubble .bk { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--amber); display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.bubble .bt { font-weight: 800; font-size: 15.5px; } .bubble .bb { margin-top: 4px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; } .bubble .bm { text-align: right; font-size: 11px; color: var(--muted); margin-top: 6px; }
.bcoupon { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding: 9px 12px; border-radius: 14px; border: 1px dashed rgba(255,181,71,.6); background: rgba(255,181,71,.08); }
.bcoupon span { font-size: 12px; color: var(--muted); } .bcoupon b { font-family: var(--display); font-size: 22px; letter-spacing: .08em; color: var(--amber); }
.bcoupon.big { justify-content: center; padding: 14px; } .bcoupon.big b { font-size: 30px; }
.promo h3 { font-size: 26px; }
.wcard-app { padding: 20px; border-radius: 24px; color: #1c0b00; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 18px 40px rgba(0,0,0,.3); animation: rise .5s both; }
.wcard-app .chip { background: rgba(255,255,255,.55); color: #1c0b00; }
.stampgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.stampgrid i { aspect-ratio: 1; border-radius: 50%; border: 2px dashed rgba(28,11,0,.4); display: grid; place-items: center; background: rgba(255,255,255,.18); }
.stampgrid i.on { background: #1c0b00; border-style: solid; color: #ffb547; }
.cphead h1 { font-size: 40px; }

/* ---------- tableta ---------- */
@media (max-width: 1024px) {
  .shell { grid-template-columns: 210px 1fr; }
  .main, .cmain { padding: 24px 22px 36px; }
  .inboxwrap { grid-template-columns: 290px 1fr; }
  .grid3 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- móvil y tableta vertical ---------- */
@media (max-width: 820px) {
  body { font-size: 15px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: max(10px, env(safe-area-inset-top)) 14px 10px; background: rgba(6,26,28,.92); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
  .topbar .brand { font-size: 22px; } .topbar .brand .bi { width: 32px; height: 32px; border-radius: 10px; }
  .topbar-title { margin-left: auto; color: var(--muted); font-weight: 700; font-size: 13px; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .scrim.open { opacity: 1; pointer-events: auto; }
  .shell:not(.cshell) .side { position: fixed; top: 0; bottom: 0; left: 0; width: min(290px, 84vw); z-index: 80; transform: translateX(-102%); transition: transform .25s; background: rgba(6,26,28,.98); padding-top: max(20px, env(safe-area-inset-top)); }
  .shell:not(.cshell) .side.open { transform: none; }
  .cshell .side { display: none; }
  .main, .cmain { padding: 18px 14px 28px; }
  .cmain { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .fscorner { display: none; }
  .pagehead h1, .cphead h1 { font-size: 32px; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; } .kpi .n { font-size: 32px; }
  .grid2, .grid3, .types { grid-template-columns: 1fr; }
  .grid-cards { grid-template-columns: 1fr; }
  .tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; } .tablewrap table { min-width: 640px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 8px; }
  #modal-root > div { padding: 12px; }
  .modal { max-height: 92dvh; border-radius: 22px; padding: 18px; }
  .btn { min-height: 42px; }
  .row > .searchbox { max-width: none; }
  .login { padding-left: 16px; padding-right: 16px; }
  .jname { font-size: 28px; }

  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: rgba(6,26,28,.96); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 700; padding: 6px 2px; border-radius: 14px; cursor: pointer; }
  .tab.on { color: #fff; background: linear-gradient(135deg, rgba(255,181,71,.22), rgba(255,92,122,.18)); } .tab.on .ico { color: var(--amber); }
  .tab .tdot { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--coral); color: #fff; font-style: normal; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; padding: 0 5px; }
  .tab .tdot[hidden] { display: none; }

  .inboxwrap { grid-template-columns: 1fr; min-height: 0; }
  .threads { max-height: none; }
  .inboxwrap.has-chat .threads { display: none; }
  .inboxwrap:not(.has-chat) .chatpane { display: none; }
  .backbtn { display: inline-flex; }
  .chatpane { min-height: calc(100dvh - 250px); }
  .chatlog { max-height: calc(100dvh - 330px); }
  .bubble { max-width: 94%; }
}
@media (max-width: 380px) {
  .kpis { grid-template-columns: 1fr; }
  .stampgrid { gap: 5px; }
  .tab span { font-size: 10px; }
}
@media (hover: none) { .biz:hover, .nav:hover { transform: none; } }
@media (display-mode: standalone) { body { user-select: none; -webkit-user-select: none; } input, textarea, .bubble { user-select: text; -webkit-user-select: text; } }
[hidden] { display: none !important; }
@media (max-width: 820px) { .demobar { flex-wrap: nowrap; gap: 6px; padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); } .demobar .demotxt { display: none; } .demobar .demoroles { flex-wrap: nowrap; } .demobar .btn.sm { padding: 0 10px; height: 36px; min-height: 36px; font-size: 12.5px; } body:has(.demobar) .tabbar { bottom: calc(48px + env(safe-area-inset-bottom)); } }
