:root {
  --navy: #0C3A76; --navy-2: #0A2C59; --ink: #212529; --muted: #5F6B7A; --line: #E2E7EF;
  --soft: #E9EDF3; --bg: #F5F7FA; --ok: #1F9D62; --ok-bg: #E5F5EC; --warn: #B7791F; --warn-bg: #FDF3E1;
  --wa-bg: #EFEAE2; --wa-out: #D9FDD3; --r: 8px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { font-family: "Outfit", system-ui, sans-serif; color: var(--ink); background: #000; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; }
input { user-select: text; -webkit-user-select: text; }
button { font-family: inherit; }
.screen { position: fixed; inset: 0; display: none; }
.screen.on { display: block; }

/* ---------- Vídeos ---------- */
#vid { background: #000; }
#player { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.prog { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; width: min(420px, 40vw); z-index: 2; }
.prog i { flex: 1; height: 4px; border-radius: 3px; background: rgba(255,255,255,.35); overflow: hidden; }
.prog b { display: block; height: 100%; width: 0; background: #fff; }
.sound { position: absolute; top: 18px; left: 18px; z-index: 2; display: inline-flex; gap: 8px; align-items: center; font-weight: 700; font-size: 15px; letter-spacing: .5px; color: var(--navy); background: rgba(255,255,255,.95); border: 0; border-radius: 999px; padding: 11px 18px; box-shadow: 0 6px 20px rgba(0,0,0,.2); cursor: pointer; }
.sound.on { background: var(--navy); color: #fff; }
.vid-brand { position: absolute; left: 18px; bottom: 18px; z-index: 2; display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.95); border-radius: 999px; padding: 8px 18px 8px 12px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.vid-brand img { height: 26px; }
.vid-brand span { font-weight: 600; color: var(--navy); font-size: 15px; }
.cta { position: absolute; right: 22px; bottom: 22px; z-index: 2; display: inline-flex; align-items: center; gap: 12px; font-size: clamp(18px, 2vw, 24px); font-weight: 700; color: #fff; background: var(--navy); border: 0; border-radius: 999px; padding: 18px 30px; cursor: pointer; box-shadow: 0 12px 34px rgba(12,58,118,.5); animation: breathe 2.4s ease-in-out infinite; }
.cta i { width: 12px; height: 12px; border-radius: 50%; background: #FF6B6F; box-shadow: 0 0 0 0 rgba(255,107,111,.6); animation: pulse 1.6s infinite; }
.cta span { font-size: 1.2em; }
@keyframes breathe { 50% { transform: scale(1.04); } }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(255,107,111,0); } 100% { box-shadow: 0 0 0 0 rgba(255,107,111,0); } }

/* ---------- Demo ---------- */
#demo { background: var(--bg); display: none; grid-template-rows: auto 1fr; }
#demo.on { display: grid; }
.bar { display: flex; align-items: center; gap: 16px; padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--line); }
.logo { height: 30px; }
.hint { flex: 1; display: flex; justify-content: center; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); }
.hint i { width: 8px; height: 8px; border-radius: 50%; background: #E5484D; animation: pulse 1.6s infinite; }
.hint b { color: var(--navy); }
.back { font-weight: 700; font-size: 14px; letter-spacing: .5px; color: var(--navy); background: #fff; border: 1.5px solid var(--navy); border-radius: 999px; padding: 9px 16px; cursor: pointer; }
.stage { display: grid; grid-template-columns: minmax(330px, 38%) 1fr; gap: 14px; padding: 14px; min-height: 0; }

.chat { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; min-height: 0; position: relative; box-shadow: 0 12px 30px rgba(12,58,118,.07); }
.mode { display: flex; gap: 6px; padding: 8px; background: var(--soft); }
.mode button { flex: 1; font-weight: 700; font-size: 14px; letter-spacing: .5px; color: var(--muted); background: transparent; border: 0; border-radius: 999px; padding: 9px; cursor: pointer; }
.mode button.on { background: #fff; color: var(--navy); box-shadow: 0 2px 8px rgba(12,58,118,.12); }
.wa, .call { display: none; flex: 1; flex-direction: column; min-height: 0; position: relative; }
.wa.on, .call.on { display: flex; }
.chat-head { display: flex; align-items: center; gap: 10px; background: var(--navy); color: #fff; padding: 10px 12px; }
.chat-head small { display: block; font-size: 12px; opacity: .8; }
.av { width: 36px; height: 36px; border-radius: 50%; background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; }
.av img { width: 28px; }
.msgs { flex: 1; overflow-y: auto; background: var(--wa-bg); padding: 12px 10px; display: flex; flex-direction: column; gap: 7px; min-height: 0; }
.m { max-width: 86%; padding: 8px 11px 5px; border-radius: 10px; font-size: 15px; line-height: 1.38; box-shadow: 0 1px 1px rgba(0,0,0,.06); white-space: pre-wrap; word-wrap: break-word; animation: pop .2s ease-out; user-select: text; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.m.in { align-self: flex-start; background: #fff; border-top-left-radius: 2px; }
.m.out { align-self: flex-end; background: var(--wa-out); border-top-right-radius: 2px; }
.m .h { display: block; text-align: right; font-size: 11px; color: #8696A0; margin-top: 1px; }
.m .tag { display: inline-block; margin-top: 5px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--bg); border-radius: 6px; padding: 3px 7px; }
.m .thumbs { display: flex; gap: 5px; margin-bottom: 4px; }
.m .thumbs img { width: 70px; height: 92px; object-fit: cover; border-radius: 7px; }
.m.sys { align-self: center; background: #FFF6D6; font-size: 13px; color: #6B5B1E; box-shadow: none; }
.typing { align-self: flex-start; background: #fff; border-radius: 10px; padding: 11px 13px; display: flex; gap: 5px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9AA6B2; animation: dot 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; transform: translateY(-3px); } }
.sugg { display: flex; gap: 7px; flex-wrap: wrap; padding: 8px 10px 4px; background: var(--wa-bg); max-height: 128px; overflow: hidden; }
.chip { font-weight: 600; font-size: 13.5px; color: var(--navy); background: #fff; border: 1.5px solid var(--navy); border-radius: 999px; padding: 6px 11px; cursor: pointer; }
.chip:active { background: var(--navy); color: #fff; }
.chip.qr { border-style: dashed; }
.composer { display: flex; gap: 7px; align-items: center; padding: 8px 10px; background: #F0F2F5; }
.composer input { flex: 1; min-width: 0; font: 16px "Outfit"; border: 0; border-radius: 999px; padding: 11px 15px; outline: none; background: #fff; }
.clip { font-size: 20px; background: #fff; border: 0; border-radius: 50%; width: 40px; height: 40px; cursor: pointer; flex: none; }
.send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; font-size: 17px; cursor: pointer; flex: none; }
.send:disabled { opacity: .5; }
.sheet { position: absolute; inset: 0; background: rgba(10,25,50,.45); display: flex; align-items: flex-end; z-index: 3; }
.sheet[hidden] { display: none; }
.sheet-in { background: #fff; width: 100%; border-radius: 16px 16px 0 0; padding: 14px; animation: up .25s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sheet-h button { border: 0; background: var(--bg); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; }
.tk { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.tk label { position: relative; cursor: pointer; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; }
.tk label:has(input:checked) { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(12,58,118,.2); }
.tk input { position: absolute; top: 7px; right: 7px; width: 22px; height: 22px; accent-color: var(--navy); }
.tk img { width: 100%; height: 130px; object-fit: cover; display: block; }
.tk span { display: block; font-size: 13px; font-weight: 600; padding: 6px 8px; }
.tk small { display: block; color: var(--muted); font-weight: 500; }
.btn { width: 100%; background: var(--navy); color: #fff; font-weight: 700; font-size: 16px; border: 0; border-radius: var(--r); padding: 13px; cursor: pointer; }
.btn:disabled { opacity: .45; }

/* Llamada */
.call { background: linear-gradient(180deg, #0C3A76 0%, #0A2C59 100%); color: #fff; padding: 16px; }
.call-top { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 6px; }
.call-top small { opacity: .8; font-size: 14px; }
.ring { width: 96px; height: 96px; border-radius: 50%; background: #fff; display: grid; place-items: center; margin-bottom: 6px; position: relative; }
.ring img { width: 70px; }
.ring.live::before, .ring.live::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); animation: wave 1.8s infinite; }
.ring.live::after { animation-delay: .9s; }
.ring.talk { box-shadow: 0 0 0 6px rgba(255,255,255,.25); }
@keyframes wave { from { transform: scale(1); opacity: 1; } to { transform: scale(1.45); opacity: 0; } }
.tr { flex: 1; overflow-y: auto; margin: 12px 0; display: flex; flex-direction: column; gap: 7px; min-height: 0; }
.tr-empty { margin: auto; text-align: center; font-size: 15px; line-height: 1.7; opacity: .85; }
.tr-empty em { color: #CFE0FF; }
.tl { max-width: 88%; font-size: 14.5px; line-height: 1.38; padding: 7px 11px; border-radius: 10px; }
.tl.u { align-self: flex-end; background: rgba(255,255,255,.18); }
.tl.a { align-self: flex-start; background: #fff; color: var(--ink); }
.callbtn { display: flex; justify-content: center; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; color: #fff; background: var(--ok); border: 0; border-radius: 999px; padding: 15px; cursor: pointer; }
.callbtn.hang { background: #E5484D; }

/* Panel gestoría */
.side { display: grid; grid-template-rows: 1.25fr 1fr; gap: 14px; min-height: 0; }
.panel, .log { background: #fff; border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; box-shadow: 0 12px 30px rgba(12,58,118,.07); }
.p-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding: 10px 14px 0; border-bottom: 1px solid var(--line); }
.p-head small, .l-head small { display: block; color: var(--muted); font-size: 12.5px; }
.p-head > div { padding-bottom: 8px; }
.tabs { display: flex; gap: 2px; }
.tabs button { font-weight: 600; font-size: 13.5px; color: var(--muted); background: none; border: 0; padding: 9px 10px; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--navy); border-bottom-color: var(--navy); }
.tabs em { font-style: normal; background: #E5484D; color: #fff; border-radius: 999px; font-size: 10.5px; padding: 1px 6px; margin-left: 3px; }
.tabs em:empty { display: none; }
.p-body { flex: 1; overflow: hidden; padding: 10px 14px; min-height: 0; }
.pane { display: none; height: 100%; overflow-y: auto; }
.pane.on { display: block; animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.sec { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); margin: 2px 0 7px; }
.cal { display: grid; grid-template-columns: 46px repeat(5, 1fr); gap: 4px; font-size: 12px; }
.cal .dh { font-weight: 700; text-align: center; color: var(--muted); }
.cal .hh { color: var(--muted); font-weight: 600; padding-top: 6px; }
.slot { min-height: 34px; border-radius: 8px; padding: 4px 6px; font-size: 11px; line-height: 1.2; overflow: hidden; }
.slot.busy { background: var(--bg); color: #8A94A3; }
.slot.free { border: 1px dashed var(--line); color: #B3BBC6; }
.slot.mine { background: linear-gradient(135deg, #2C5BA8, var(--navy)); color: #fff; font-weight: 600; box-shadow: 0 6px 14px rgba(12,58,118,.3); }
.slot.na { background: repeating-linear-gradient(45deg, #fafbfc, #fafbfc 6px, #f2f4f7 6px, #f2f4f7 12px); }
.row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; }
.row .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--soft); display: grid; place-items: center; font-size: 16px; }
.row .n { font-weight: 600; font-size: 14px; }
.row .d { font-size: 12.5px; color: var(--muted); }
.row .a { font-weight: 700; text-align: right; font-size: 14px; }
.row .a small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.prog2 { height: 6px; background: var(--soft); border-radius: 4px; overflow: hidden; margin-top: 5px; width: 140px; }
.prog2 i { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--ok)); transition: width .6s; }
.pill { font-size: 10.5px; font-weight: 700; letter-spacing: .8px; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.navy { background: var(--soft); color: var(--navy); }
.new { animation: flash 2.6s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 3px rgba(12,58,118,.35); background: #EEF3FB; } 100% { box-shadow: 0 0 0 0 transparent; } }
.empty { color: var(--muted); font-size: 13.5px; padding: 6px 0; }

/* Registro de actividad */
.l-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.kpis { display: flex; gap: 6px; }
.kpis span { font-size: 12px; font-weight: 600; color: var(--navy); background: var(--soft); border-radius: 999px; padding: 4px 9px; white-space: nowrap; }
.kpis span b { font-weight: 800; }
.l-body { flex: 1; overflow-y: auto; padding: 8px 14px; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.ev { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: start; font-size: 13.5px; line-height: 1.35; padding: 7px 0; border-bottom: 1px dashed var(--line); animation: pop .3s ease-out; }
.ev .e { width: 30px; height: 30px; border-radius: 8px; background: var(--soft); display: grid; place-items: center; font-size: 15px; }
.ev time { font-size: 11.5px; color: var(--muted); white-space: nowrap; padding-top: 2px; }
.ev b { color: var(--navy); }
.ev.fresh { background: linear-gradient(90deg, #EEF3FB, transparent); border-radius: 8px; padding-left: 4px; }

@media (max-width: 1000px) {
  .hint { display: none; }
  .tabs button { padding: 9px 7px; font-size: 12.5px; }
  .kpis span:nth-child(n+3) { display: none; }
}
@media (orientation: portrait) {
  .stage { grid-template-columns: 1fr; grid-template-rows: 1.1fr 1fr; }
  .side { grid-template-rows: 1fr 0.8fr; }
}
.slot.offer { border: 2px dashed var(--navy); background: #EEF3FB; color: var(--navy); font-weight: 700; animation: glow 1.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 4px rgba(12,58,118,.18); } }
