:root {
  --negro: #0E0E12; --morado: #8A1680; --morado-h: #6F1167; --morado-s: #F6EAF5;
  --bg: #F4F3F6; --card: #FFFFFF; --borde: #E6E3EA; --texto: #17151C; --sec: #68646F;
  --caliente: #D7334F; --tibio: #B87908; --tibio-dot: #E39A1C; --frio: #3E7BD6; --ok: #18945F;
  --equipo: #E7F0FF; --r: 12px; --r-s: 8px;
  --sombra: 0 1px 2px rgba(23, 21, 28, .05), 0 4px 16px rgba(23, 21, 28, .05);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --titulo: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--texto); background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, h4 { font-family: var(--titulo); font-weight: 800; font-style: normal; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 26px; } h2 { font-size: 19px; font-weight: 700; } h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--morado); }
:focus-visible { outline: 3px solid var(--morado); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--sec); }
.num { font-variant-numeric: tabular-nums; }

/* Botones (radio 8px; sin píldoras) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: var(--r-s); border: 1px solid var(--borde); background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; text-decoration: none; color: var(--texto); }
.btn:hover { border-color: #CFCAD6; background: #FAF9FB; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primario { background: var(--morado); border-color: var(--morado); color: #fff; }
.btn-primario:hover { background: var(--morado-h); border-color: var(--morado-h); }
.btn-negro { background: var(--negro); border-color: var(--negro); color: #fff; }
.btn-negro:hover { background: #2a2a33; }
.btn-suave { background: var(--morado-s); border-color: #EBD3E8; color: var(--morado-h); }
.btn-suave:hover { background: #F0DCEE; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #127A4E; }
.btn-chico { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn-icono { width: 40px; padding: 0; }
.input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--borde); border-radius: var(--r-s); background: #fff; }
.input:focus { border-color: var(--morado); outline: none; box-shadow: 0 0 0 3px rgba(138, 22, 128, .18); }
label.campo { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }

.card { background: var(--card); border: 1px solid var(--borde); border-radius: var(--r); box-shadow: var(--sombra); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: #F0EEF3; color: var(--sec); white-space: nowrap; }
.temp { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.t-caliente { color: var(--caliente); } .t-tibio { color: var(--tibio); } .t-frio { color: var(--frio); }
.d-caliente { background: var(--caliente); } .d-tibio { background: var(--tibio-dot); } .d-frio { background: var(--frio); }
.b-caliente { background: #FCE8EC; color: #A71E38; } .b-tibio { background: #FDF1DC; color: #8A5A04; } .b-frio { background: #E5EEFB; color: #24589F; }

/* Switch (radio 6px; no es píldora) */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .pista { width: 42px; height: 24px; border-radius: 6px; background: #D8D4DE; position: relative; transition: background .2s; flex: none; }
.switch .pista::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 4px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + .pista { background: var(--morado); }
.switch input:checked + .pista::after { transform: translateX(18px); }
.switch input:focus-visible + .pista { outline: 3px solid var(--morado); outline-offset: 2px; }

.vacio { padding: 40px 20px; text-align: center; color: var(--sec); display: grid; gap: 8px; justify-items: center; }
.vacio strong { color: var(--texto); font-family: var(--titulo); font-size: 16px; }
.cargando { padding: 24px; display: grid; gap: 12px; }
.skel { height: 14px; border-radius: 6px; background: linear-gradient(90deg, #ECEAF0 25%, #F6F5F8 50%, #ECEAF0 75%); background-size: 200% 100%; animation: brillo 1.2s infinite; }
@keyframes brillo { to { background-position: -200% 0; } }

.toasts { position: fixed; top: 16px; right: 16px; z-index: 100; display: grid; gap: 8px; max-width: min(360px, calc(100vw - 32px)); }
.toast { background: var(--negro); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-weight: 500; font-size: 14px; animation: entra .25s ease-out; border-left: 4px solid var(--morado); }
.toast-error { border-left-color: var(--caliente); }
.toast-ok { border-left-color: var(--ok); }
.toast.out { opacity: 0; transform: translateY(-6px); transition: .4s; }
@keyframes entra { from { opacity: 0; transform: translateY(-8px); } }

.pie { text-align: center; font-size: 12px; color: var(--sec); padding: 20px 16px 28px; }

/* ===================== Login ===================== */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .card { width: min(400px, 100%); padding: 32px; display: grid; gap: 18px; }
.login .marca { display: flex; align-items: center; gap: 12px; }
.login img { width: 52px; height: 52px; border-radius: 10px; border: 1px solid var(--borde); }
.error { color: #B4233D; font-size: 14px; font-weight: 500; min-height: 20px; }

/* ===================== Shell del panel ===================== */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.lateral { background: var(--negro); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.lateral .marca { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.lateral .marca img { width: 40px; height: 40px; border-radius: 9px; background: #fff; }
.lateral .marca b { font-family: var(--titulo); font-size: 15px; line-height: 1.2; display: block; }
.lateral .marca small { color: #B6B2BD; font-size: 12px; }
.nav { display: grid; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; color: #D9D6DE; text-decoration: none; font-weight: 600; font-size: 14px; position: relative; }
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav a:hover { background: #1C1C24; color: #fff; }
.nav a[aria-current="page"] { background: var(--morado); color: #fff; }
.nav .cuenta { margin-left: auto; background: var(--caliente); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 6px; }
.lateral .usuario { margin-top: auto; border-top: 1px solid #26262F; padding: 14px 8px 0; display: flex; align-items: center; gap: 10px; }
.lateral .usuario .btn { margin-left: auto; background: transparent; color: #D9D6DE; border-color: #33333D; }
.lateral .usuario .btn:hover { background: #1C1C24; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; background: var(--morado-s); color: var(--morado-h); font-family: var(--titulo); }
.avatar.chico { width: 32px; height: 32px; font-size: 12px; }
.principal { min-width: 0; display: flex; flex-direction: column; }
.vista { flex: 1; padding: 28px 32px; min-width: 0; }
.encabezado { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.encabezado p { color: var(--sec); margin-top: 4px; }
.mock-aviso { background: var(--morado-s); color: var(--morado-h); font-size: 13px; font-weight: 600; padding: 6px 12px; text-align: center; }
.topbar { display: none; }

/* ===================== Hoy ===================== */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 18px 18px 16px; display: grid; gap: 6px; align-content: start; }
.kpi .etq { color: var(--sec); font-size: 13px; font-weight: 600; }
.kpi .valor { font-family: var(--titulo); font-weight: 800; font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .det { font-size: 13px; color: var(--sec); }
.kpi .det b { color: var(--ok); }
.kpi.alerta .valor { color: var(--caliente); }
.grid-hoy { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.panel { padding: 20px; min-width: 0; }
.panel h2 { margin-bottom: 4px; }
.panel .sub { color: var(--sec); font-size: 13px; margin-bottom: 16px; }
.barras { display: grid; gap: 14px; }
.barra-fila { display: grid; gap: 6px; }
.barra-fila .cab { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.barra-fila .cab span:first-child { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pista-barra { height: 12px; background: #EFEDF2; border-radius: 6px; position: relative; overflow: hidden; }
.pista-barra .lleno { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: var(--morado); transition: width .8s ease-out; }
.pista-barra .meta { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--negro); }
.leyenda { display: flex; gap: 16px; font-size: 13px; color: var(--sec); margin-bottom: 12px; flex-wrap: wrap; }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.fuente-fila { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; font-size: 14px; }
.fuente-fila .dos { display: grid; gap: 4px; }
.fuente-fila .b { height: 12px; border-radius: 4px; display: flex; align-items: center; }
.fuente-fila .b span { font-size: 12px; font-weight: 600; padding-left: calc(100% + 6px); white-space: nowrap; color: var(--texto); }
.embudo-viz { display: grid; gap: 8px; }
.embudo-viz .paso { display: grid; grid-template-columns: 120px minmax(0, 1fr) 40px; gap: 10px; align-items: center; font-size: 14px; }
.embudo-viz .paso .b { height: 26px; border-radius: 6px; background: var(--morado); opacity: var(--o, 1); }
.actividad { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.actividad li a { display: flex; gap: 12px; align-items: center; padding: 10px 8px; border-radius: 8px; text-decoration: none; color: inherit; }
.actividad li a:hover { background: #F7F6F9; }
.actividad .txt { min-width: 0; flex: 1; }
.actividad .txt b { display: block; font-size: 14px; }
.actividad .txt span { font-size: 13px; color: var(--sec); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actividad time { font-size: 12px; color: var(--sec); white-space: nowrap; }

/* ===================== Bandeja ===================== */
.vista.bandeja-vista { padding: 0; }
.bandeja { display: grid; grid-template-columns: 340px minmax(0, 1fr) 340px; height: 100vh; min-height: 0; }
.lista { border-right: 1px solid var(--borde); background: #fff; display: flex; flex-direction: column; min-height: 0; }
.lista-cab { padding: 20px 16px 12px; display: grid; gap: 12px; border-bottom: 1px solid var(--borde); }
.filtros { display: flex; gap: 6px; flex-wrap: wrap; }
.filtros button { border: 1px solid var(--borde); background: #fff; border-radius: 8px; padding: 6px 9px; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; }
.filtros button[aria-pressed="true"] { background: var(--negro); color: #fff; border-color: var(--negro); }
.lista-items { overflow-y: auto; flex: 1; }
.lead-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #F0EEF3; cursor: pointer; text-decoration: none; color: inherit; position: relative; }
.lead-item:hover { background: #FAF9FB; }
.lead-item[aria-current="true"] { background: var(--morado-s); }
.lead-item[aria-current="true"]::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--morado); }
.lead-item .nom { font-weight: 700; display: flex; align-items: center; gap: 6px; min-width: 0; }
.lead-item .nom span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-item .curso { font-size: 12px; color: var(--morado-h); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-item .ult { font-size: 13px; color: var(--sec); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-item .der { display: grid; justify-items: end; gap: 6px; align-content: start; font-size: 12px; color: var(--sec); }
.lead-item .noleidos { background: var(--morado); color: #fff; font-weight: 700; font-size: 11px; min-width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; padding: 0 5px; }
.lead-item.nuevo { animation: nuevoLead 1.6s ease-out; }
@keyframes nuevoLead { 0% { background: #F0DCEE; transform: translateY(-8px); opacity: 0; } 20% { opacity: 1; transform: none; } 100% { background: transparent; } }

.chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.chat-cab { background: #fff; border-bottom: 1px solid var(--borde); padding: 12px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chat-cab .quien { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 200px; }
.chat-cab .quien b { display: block; font-size: 15px; }
.chat-cab .quien small { color: var(--sec); font-size: 12px; }
.chat-acciones { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.volver { display: none; }
.mensajes { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: min(75%, 520px); padding: 9px 12px 6px; border-radius: 12px; background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.06); font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .meta { font-size: 11px; color: var(--sec); display: flex; gap: 6px; justify-content: flex-end; margin-top: 2px; }
.msg .ia { font-weight: 700; color: var(--morado); }
.msg[data-de="alumno"] { align-self: flex-start; border-top-left-radius: 4px; }
.msg[data-de="agente"] { align-self: flex-end; background: var(--morado-s); border-top-right-radius: 4px; }
.msg[data-de="equipo"] { align-self: flex-end; background: var(--equipo); border-top-right-radius: 4px; }
.msg[data-de="sistema"] { align-self: center; background: #E9E7EC; color: #4A4651; font-size: 12.5px; font-weight: 600; box-shadow: none; padding: 5px 12px; border-radius: 8px; }
.msg[data-de="sistema"] .meta { display: none; }
.msg.entra { animation: entra .25s ease-out; }
.redactar { background: #fff; border-top: 1px solid var(--borde); padding: 12px 16px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.redactar textarea { resize: none; min-height: 44px; max-height: 140px; }
.aviso-piloto { font-size: 12.5px; padding: 8px 16px; background: #FFF7E6; color: #7A5200; border-top: 1px solid #F3E2BD; }
.aviso-piloto.on { background: var(--morado-s); color: var(--morado-h); border-color: #EBD3E8; }
.menu { position: relative; }
.menu-lista { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: #fff; border: 1px solid var(--borde); border-radius: 10px; box-shadow: 0 12px 32px rgba(23,21,28,.14); padding: 6px; width: 280px; display: grid; gap: 2px; }
.menu-lista button { text-align: left; background: none; border: 0; padding: 10px; border-radius: 8px; cursor: pointer; display: grid; gap: 2px; }
.menu-lista button:hover, .menu-lista button:focus-visible { background: var(--morado-s); }
.menu-lista button b { font-size: 14px; } .menu-lista button span { font-size: 12.5px; color: var(--sec); }

.ficha-wrap { border-left: 1px solid var(--borde); background: #fff; overflow-y: auto; min-height: 0; }
.ficha-toggle { display: none; }
.ficha { padding: 20px; display: grid; gap: 18px; }
.ficha-score { display: flex; align-items: center; gap: 16px; }
.gauge { width: 92px; height: 92px; position: relative; flex: none; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 9; }
.gauge .fondo { stroke: #EFEDF2; }
.gauge .arco { stroke-linecap: round; transition: stroke-dashoffset .8s ease-out, stroke .4s; }
.gauge .n { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--titulo); font-weight: 800; font-size: 28px; font-variant-numeric: tabular-nums; }
.ficha-score .badge, .ficha-score .temp { justify-self: start; }
.ficha dl { margin: 0; display: grid; gap: 12px; }
.ficha dt { font-size: 12px; font-weight: 600; color: var(--sec); }
.ficha dd { margin: 2px 0 0; font-size: 14px; font-weight: 500; }
.ficha .resumen { background: #F7F6F9; border-radius: 10px; padding: 12px; font-size: 14px; }
.ficha .siguiente { background: var(--morado-s); border-radius: 10px; padding: 12px; font-size: 14px; color: var(--morado-h); }
.ficha .siguiente b { display: block; font-size: 12px; margin-bottom: 2px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.docs { display: grid; gap: 6px; }
.doc { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--borde); border-radius: 8px; cursor: pointer; font-size: 14px; background: #fff; text-align: left; width: 100%; }
.doc .caja { width: 20px; height: 20px; border-radius: 5px; border: 2px solid #C9C4D0; display: grid; place-items: center; flex: none; color: #fff; font-size: 13px; font-weight: 800; }
.doc[aria-checked="true"] .caja { background: var(--ok); border-color: var(--ok); }
.doc[aria-checked="true"] { border-color: #BFE3D2; background: #F1FAF5; }
.sin-chat { display: grid; place-items: center; height: 100%; }

/* ===================== Embudo ===================== */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: #EBE9EF; border-radius: var(--r); padding: 10px; min-height: 300px; display: flex; flex-direction: column; gap: 8px; transition: background .15s, outline-color .15s; outline: 2px dashed transparent; }
.col.sobre { background: var(--morado-s); outline-color: var(--morado); }
.col-cab { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 6px; font-weight: 700; font-size: 14px; }
.col-cab .badge { background: #fff; }
.kcard { background: #fff; border: 1px solid var(--borde); border-radius: 10px; padding: 12px; display: grid; gap: 8px; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.kcard:active { cursor: grabbing; }
.kcard.arrastrando { opacity: .5; }
.kcard .fila { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kcard b { font-size: 14px; } .kcard .curso { font-size: 12px; color: var(--sec); }
.kcard .pts { font-family: var(--titulo); font-weight: 800; font-variant-numeric: tabular-nums; }
.kcard select { font-size: 12px; border: 1px solid var(--borde); border-radius: 6px; padding: 4px 6px; background: #fff; max-width: 100%; }

/* ===================== Cursos / Promos / Volantes ===================== */
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.curso-card { padding: 20px; display: grid; gap: 14px; border-top: 4px solid var(--c, var(--morado)); }
.curso-card .datos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; font-size: 14px; }
.curso-card .datos span { display: block; font-size: 12px; color: var(--sec); font-weight: 600; }
.reparto { display: flex; height: 10px; border-radius: 5px; overflow: hidden; }
.campana { background: #F7F6F9; border-radius: 10px; padding: 14px; display: grid; gap: 8px; font-size: 14px; border: 1px solid var(--borde); }
.campana h4 { font-size: 15px; }
.promo-card { padding: 20px; display: grid; gap: 12px; }
.promo-card.inactiva { opacity: .7; }
.promo-card .usos { font-family: var(--titulo); font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.vol-form { padding: 20px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 20px; }
.volante-card { padding: 20px; display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 16px; align-items: start; }
.volante-qr { width: 132px; height: 132px; display: grid; place-items: center; background: #fff; border: 1px solid var(--borde); border-radius: 8px; padding: 6px; }
.volante-qr img, .volante-qr canvas { width: 118px !important; height: 118px !important; }
.volante-card .stats { display: flex; gap: 18px; margin: 8px 0 12px; }
.volante-card .stats b { font-family: var(--titulo); font-size: 22px; display: block; font-variant-numeric: tabular-nums; }
.volante-card .stats span { font-size: 12px; color: var(--sec); }
.codigo { font-weight: 700; color: var(--morado-h); font-size: 13px; overflow-wrap: anywhere; }

/* ===================== /probar ===================== */
.probar-body { min-height: 100vh; }
.bienvenida { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(180deg, #0E0E12 0, #0E0E12 42%, var(--bg) 42%); }
.bienvenida .card { width: min(460px, 100%); padding: 32px; display: grid; gap: 18px; text-align: center; }
.bienvenida img { width: 88px; height: 88px; border-radius: 16px; margin: 0 auto; border: 1px solid var(--borde); }
.bienvenida h1 { font-size: 28px; line-height: 1.2; }
.bienvenida form { display: grid; gap: 12px; text-align: left; }
.bienvenida .btn { min-height: 48px; font-size: 16px; }
.escena { display: none; min-height: 100vh; padding: 32px; gap: 40px; justify-content: center; align-items: flex-start; }
.escena.on { display: flex; }
.escena .intro { position: absolute; }
.telefono { width: 390px; height: min(800px, calc(100vh - 64px)); min-height: 560px; background: #0E0E12; border-radius: 40px; padding: 10px; box-shadow: 0 30px 60px rgba(23,21,28,.25); flex: none; }
.pantalla { width: 100%; height: 100%; border-radius: 31px; overflow: hidden; display: flex; flex-direction: column; background: #EFEAE8; background: #ECE8EF; }
.wa-cab { background: var(--negro); color: #fff; display: flex; align-items: center; gap: 10px; padding: 16px 14px 12px; }
.wa-cab img { width: 38px; height: 38px; border-radius: 50%; background: #fff; }
.wa-cab b { display: block; font-size: 15px; } .wa-cab small { color: #C9C5CF; font-size: 12px; display: flex; align-items: center; gap: 5px; }
.wa-cab small::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #3BD483; }
.wa-msgs { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.wa-msgs .msg { max-width: 82%; font-size: 14.5px; }
.escribiendo { align-self: flex-start; background: #fff; border-radius: 12px; border-top-left-radius: 4px; padding: 10px 14px; display: inline-flex; gap: 4px; align-items: center; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.escribiendo[hidden] { display: none; }
.escribiendo i { width: 7px; height: 7px; border-radius: 50%; background: #9A95A2; animation: rebote 1.2s infinite; }
.escribiendo i:nth-child(2) { animation-delay: .15s; } .escribiendo i:nth-child(3) { animation-delay: .3s; }
@keyframes rebote { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.docs-sim { background: #fff; border-top: 1px solid var(--borde); padding: 10px 12px; display: grid; gap: 8px; }
.docs-sim[hidden] { display: none; }
.docs-sim .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.docs-sim small { color: var(--sec); font-size: 12px; }
.wa-input { background: #fff; padding: 10px; display: flex; gap: 8px; border-top: 1px solid var(--borde); }
.wa-input input { flex: 1; min-width: 0; }
.wa-input .btn { width: 44px; padding: 0; }
.lado { width: 400px; flex: none; display: grid; gap: 16px; }
.lado-cab h2 { font-size: 22px; } .lado-cab p { color: var(--sec); margin-top: 4px; font-size: 14px; }
.probar-ficha { padding: 0; overflow: hidden; }
.probar-ficha summary { list-style: none; cursor: default; padding: 16px 20px; border-bottom: 1px solid var(--borde); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--titulo); font-weight: 700; }
.probar-ficha summary::-webkit-details-marker { display: none; }
.probar-ficha .vivo { display: inline-flex; gap: 6px; align-items: center; font-family: var(--font); font-size: 12px; color: var(--ok); font-weight: 700; }
.probar-ficha .vivo::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulso 1.6s infinite; }
@keyframes pulso { 50% { opacity: .3; } }
.campo-flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { background: #F0DCEE; } 100% { background: transparent; } }
.nota { font-size: 13px; color: var(--sec); }

/* ===================== Responsivo ===================== */
@media (max-width: 1280px) {
  .bandeja { grid-template-columns: 300px minmax(0, 1fr); }
  .bandeja .ficha-wrap { display: none; }
  .bandeja.ficha-abierta { grid-template-columns: 300px minmax(0, 1fr) 320px; }
  .bandeja.ficha-abierta .ficha-wrap { display: block; }
  .ficha-toggle { display: inline-flex; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .escena { padding: 20px; gap: 24px; }
  .lado { width: 340px; }
  .grid-hoy { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  body { font-size: 15px; }
  .shell { grid-template-columns: 1fr; padding-bottom: 68px; }
  .lateral { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: 64px; padding: 0; flex-direction: row; z-index: 30; border-top: 1px solid #26262F; padding-bottom: env(safe-area-inset-bottom); }
  .lateral .marca, .lateral .usuario { display: none; }
  .nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; gap: 0; }
  .nav a { flex-direction: column; gap: 3px; font-size: 10.5px; padding: 8px 2px; border-radius: 0; justify-content: center; }
  .nav a[aria-current="page"] { background: transparent; color: #fff; box-shadow: inset 0 3px 0 var(--morado); }
  .nav a[aria-current="page"] svg { color: #E6A3E0; }
  .nav .cuenta { position: absolute; top: 4px; right: calc(50% - 20px); margin: 0; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--negro); color: #fff; position: sticky; top: 0; z-index: 25; }
  .topbar img { width: 32px; height: 32px; border-radius: 7px; background: #fff; }
  .topbar b { font-family: var(--titulo); font-size: 15px; flex: 1; }
  .topbar .btn { background: transparent; color: #fff; border-color: #33333D; }
  .vista { padding: 18px 16px; }
  h1 { font-size: 22px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpis .kpi:last-child { grid-column: 1 / -1; }
  .kpi { padding: 14px; } .kpi .valor { font-size: 28px; }
  .bandeja { grid-template-columns: 1fr; height: calc(100vh - 52px - 64px); height: calc(100dvh - 52px - 64px); }
  .bandeja.ficha-abierta { grid-template-columns: 1fr; }
  .bandeja .chat { display: none; }
  .bandeja.con-chat .lista { display: none; }
  .bandeja.con-chat .chat { display: flex; }
  .bandeja .ficha-wrap, .bandeja.ficha-abierta .ficha-wrap { display: none; }
  .bandeja.con-chat.ficha-abierta .ficha-wrap { display: block; position: fixed; inset: 52px 0 64px 0; z-index: 22; border: 0; }
  .ficha-cerrar { display: inline-flex !important; }
  .volver { display: inline-flex; }
  .chat-cab { padding: 10px 12px; }
  .chat-acciones .btn { min-height: 36px; padding: 4px 10px; font-size: 13px; }
  .mensajes { padding: 14px 12px; }
  .msg { max-width: 85%; }
  .redactar { padding: 8px; grid-template-columns: auto minmax(0, 1fr) auto; }
  .kanban { grid-auto-columns: 78vw; scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .rejilla { grid-template-columns: 1fr; }
  .vol-form { grid-template-columns: 1fr; }
  .volante-card { grid-template-columns: 1fr; justify-items: start; }
  .menu-lista { right: auto; left: 0; width: min(280px, calc(100vw - 32px)); }
  .embudo-viz .paso { grid-template-columns: 100px minmax(0, 1fr) 32px; }
  /* /probar en teléfono: pantalla completa */
  .escena { padding: 0; gap: 0; flex-direction: column; }
  .escena.on { display: flex; }
  .telefono { width: 100%; height: 100vh; height: 100dvh; min-height: 0; border-radius: 0; padding: 0; box-shadow: none; order: 2; display: flex; flex-direction: column; }
  .pantalla { border-radius: 0; }
  .lado { width: 100%; order: 1; gap: 0; position: sticky; top: 0; z-index: 5; }
  .lado-cab { display: none; }
  .probar-ficha { border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; max-height: 60vh; overflow-y: auto; }
  .probar-ficha summary { cursor: pointer; padding: 10px 16px; font-size: 14px; }
  .probar-ficha summary::after { content: '▾'; font-size: 14px; color: var(--sec); }
  .probar-ficha[open] summary::after { content: '▴'; }
  .probar-ficha .ficha { padding: 14px 16px; gap: 12px; }
  .escena.on { height: 100dvh; overflow: hidden; }
  .escena .telefono { flex: 1; height: auto; min-height: 0; }
}
.ficha-cerrar { display: none !important; }
@media (max-width: 860px) { .ficha-cerrar { display: inline-flex !important; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

@media print {
  body.imprimiendo * { visibility: hidden; }
  body.imprimiendo .print-target, body.imprimiendo .print-target * { visibility: visible; }
  body.imprimiendo .print-target { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; border: 0; grid-template-columns: 220px 1fr; }
  body.imprimiendo .print-target .volante-qr { width: 220px; height: 220px; }
  body.imprimiendo .print-target .volante-qr img, body.imprimiendo .print-target .volante-qr canvas { width: 200px !important; height: 200px !important; }
  body.imprimiendo .print-target .btn { display: none; }
}
.mock-aviso { height: 32px; display: flex; align-items: center; justify-content: center; padding: 0 12px; }
.con-aviso .bandeja { height: calc(100vh - 32px); }
@media (max-width: 860px) {
  .con-aviso .bandeja { height: calc(100dvh - 52px - 64px - 32px); }
  .mock-aviso { font-size: 12px; height: 28px; }
}

/* Ajuste de integración: que ninguna tarjeta empuje el ancho de la página. */
.card, .actividad, .actividad li, .actividad li a { min-width: 0; }
main, .main, #vista, #app { min-width: 0; }
html, body { overflow-x: hidden; }

/* Revisión de UX (Kiro, 3-nov) */
@media (max-width: 860px) { .redactar .txt-sug { display: none; } .lado > .pie { display: none; } }

/* Revisión E2E (3-nov) */
.ficha { grid-template-columns: minmax(0, 1fr); }
.ficha .badge { white-space: normal; }
@media (min-width: 861px) { .col { max-height: calc(100vh - 200px); overflow-y: auto; } }

/* Revisión visual de Kiro (3-nov, 2.ª ronda) */
:root { --ok: #127A4E; --tibio: #8F5E06; --frio: #2F66B8; }
@media (min-width: 861px) and (max-width: 1439px) {
  .bandeja.ficha-abierta { grid-template-columns: 300px minmax(0, 1fr); }
  .bandeja.ficha-abierta .ficha-wrap { position: fixed; top: 0; right: 0; bottom: 0; width: 340px; z-index: 22; box-shadow: -12px 0 32px rgba(23,21,28,.18); }
}
.col > div, .kcard { min-width: 0; }
.kcard .curso { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kcard .fila:last-child { flex-wrap: wrap; }
.kcard select { width: 100%; min-height: 36px; }
.curso-card { align-content: start; }
@media (min-width: 861px) {
  .lado { max-height: calc(100vh - 64px); grid-template-rows: auto minmax(0, 1fr) auto; }
  .probar-ficha { overflow-y: auto; }
}
@media (max-width: 860px) {
  .chat-acciones { flex-wrap: nowrap; overflow-x: auto; }
  .aviso-piloto { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .toasts { top: auto; bottom: 76px; }
}
@media (pointer: coarse) { .btn-chico, .filtros button, .switch { min-height: 40px; } }
.promo-card .badge { justify-self: start; }
.kcard .fila > :first-child { min-width: 0; overflow-wrap: anywhere; }
.kcard .pts { flex: none; }
