/* ==========================================================================
   Réplica de la interfaz de OmniPRIT (frontend/css/main.css del CRM).
   La usan la demo interactiva y las maquetas de telefonía y consumos.
   Los colores, radios y medidas son los de la app: si la app cambia de
   aspecto, esto se actualiza copiando de main.css, no al revés.
   ========================================================================== */
@font-face { font-family: 'Inter'; src: url(../fonts/inter-var.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

.ax {
  --primary: #0047FF; --primary-light: #3B82F6; --grad: linear-gradient(135deg, #3B82F6, #0033CC);
  --sb: #07102B; --sb-hover: #0D1F4A; --s1: #FFFFFF; --s2: #F5F7FF; --s3: #EEF2FF;
  --bd: #E2E8F0; --tx: #0F172A; --tx2: #475569; --tx3: #94A3B8;
  --ok: #10B981; --danger: #EF4444; --warn: #F59E0B;
  font: 400 13px/1.45 'Inter', 'Segoe UI', system-ui, sans-serif; color: var(--tx); text-align: left;
  -webkit-font-smoothing: antialiased; letter-spacing: 0;
}
.ax * { box-sizing: border-box; }
.ax svg { display: inline-block; flex: none; }
.ax b { font-weight: 600; }

/* Encaje: la maqueta se dibuja a tamaño real y se escala al ancho del marco
   (assets/js/main.js, data-fit), igual que una captura de pantalla. */
.fit { position: relative; overflow: hidden; }
.fit > .ax { position: absolute; left: 0; top: 0; transform-origin: 0 0; }

/* ---------- carcasa: menú lateral + barra superior ---------- */
.ax-shell { display: grid; grid-template-columns: 200px minmax(0, 1fr); background: var(--s2); }
.ax-side { background: var(--sb); display: flex; flex-direction: column; min-width: 0; }
.ax-logo { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border-bottom: 1px solid rgba(255, 255, 255, .07); font-size: 1.05rem; font-weight: 800; color: #fff; }
.ax-logo b { color: var(--primary-light); font-weight: 800; }
.ax-nav { flex: 1; padding: 10px 8px; display: grid; align-content: start; gap: 1px; }
.ax-nav__lbl { padding: 10px 10px 4px; font-size: .6rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: rgba(255, 255, 255, .3); }
.ax-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 2px; color: rgba(255, 255, 255, .6); font-size: .78rem; font-weight: 500; white-space: nowrap; }
.ax-nav a.on { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(0, 71, 255, .4); }
.ax-nav .bdg { margin-left: auto; background: var(--danger); color: #fff; font-size: .6rem; font-weight: 700; min-width: 17px; height: 17px; border-radius: 99px; display: grid; place-items: center; padding: 0 4px; }
.ax-user { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, .07); }
.ax-user b { display: block; color: #fff; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-user small { color: rgba(255, 255, 255, .4); font-size: .66rem; }
.ax-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ax-top { height: 52px; flex: none; background: var(--s1); border-bottom: 1px solid var(--bd); display: flex; align-items: center; gap: 14px; padding: 0 20px; color: var(--tx2); }
.ax-top__sp { flex: 1; }
.ax-clock { text-align: center; line-height: 1.15; }
.ax-clock b { display: block; font-size: .88rem; color: var(--tx); font-weight: 700; font-variant-numeric: tabular-nums; }
.ax-clock small { font-size: .62rem; color: var(--tx3); }
.ax-top .lang { font-size: .7rem; font-weight: 700; color: var(--tx2); }
.ax-top .call { color: var(--ok); }
.ax-body { flex: 1; min-height: 0; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.ax-ttl { display: flex; align-items: center; gap: 10px; }
.ax-ttl h4 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--tx); }
.ax-ttl .sp { flex: 1; }

/* ---------- piezas sueltas ---------- */
.ax-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; font-weight: 700; font-size: .78rem; background: var(--grad); position: relative; }
.ax-av--sm { width: 28px; height: 28px; font-size: .66rem; }
.ax-av .ch { position: absolute; right: -3px; bottom: -3px; width: 15px; height: 15px; border-radius: 3px; background: #fff; color: var(--tx); display: grid; place-items: center; box-shadow: 0 0 0 1.5px #fff; }
.ax-sel { display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 28px; padding: 0 8px; border: 1.5px solid var(--bd); border-radius: 2px; background: var(--s1); font-size: .72rem; font-weight: 500; color: var(--tx); white-space: nowrap; }
.ax-sel--b { font-weight: 600; }
.ax-search { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border: 1.5px solid var(--bd); border-radius: 2px; color: var(--tx3); font-size: .72rem; }
.ax-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 2px; font-size: .72rem; font-weight: 600; background: var(--primary); color: #fff; white-space: nowrap; }
.ax-btn--g { background: var(--s3); color: var(--tx2); border: 1px solid var(--bd); }
.ax-bdg { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: .64rem; font-weight: 600; white-space: nowrap; background: var(--s3); color: var(--tx2); transition: background .4s, color .4s; }
.ax-bdg--b { background: #EEF2FF; color: var(--primary); }
.ax-bdg--ok { background: #ECFDF5; color: #047857; }
.ax-bdg--w { background: #FFFBEB; color: #B45309; }
.ax-bdg--r { background: #FEF2F2; color: #DC2626; }
.ax-bdg .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ax-bdg .dot.blink { animation: blink 1.2s infinite; }
.ax-card { background: var(--s1); border: 1px solid var(--bd); border-radius: 4px; }
.ax-ico { color: var(--tx2); }

/* ---------- conversaciones ---------- */
.ax-conv { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr) 250px; background: var(--s1); border: 1px solid var(--bd); border-radius: 4px; overflow: hidden; }
.ax-list { border-right: 1px solid var(--bd); display: flex; flex-direction: column; min-width: 0; }
.ax-list__h { padding: 12px; border-bottom: 1px solid var(--bd); display: grid; gap: 8px; }
.ax-list__t { display: flex; align-items: center; gap: 8px; }
.ax-list__t h5 { margin: 0; flex: 1; font-size: .86rem; font-weight: 700; }
.ax-list__t svg { color: var(--tx2); }
.ax-list__r { display: grid; grid-template-columns: 1fr 1.2fr; gap: 6px; }
.ax-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--bd); }
.ax-item.on { background: var(--s3); }
.ax-item__b { flex: 1; min-width: 0; }
.ax-item__t { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.ax-item__t b { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-item__t small { font-size: .62rem; color: var(--tx3); white-space: nowrap; }
.ax-item p { margin: 1px 0 0; font-size: .72rem; color: var(--tx3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-item .n { flex: none; min-width: 17px; height: 17px; border-radius: 99px; background: var(--ok); color: #fff; font-size: .6rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }

.ax-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ax-chat__h { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--bd); min-height: 56px; }
.ax-chat__who { min-width: 0; flex: 1; }
.ax-chat__who b { display: block; font-size: .82rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-chat__who small { display: flex; align-items: center; gap: 5px; font-size: .68rem; color: var(--tx3); white-space: nowrap; }
.ax-chat__who small::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.ax-chat__acts { display: flex; align-items: center; gap: 10px; }
.ax-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 5px; position: relative; background-color: #e5ddd5; background-image: url(../img/app/chat-bg-pattern.svg); background-size: 280px 280px; scrollbar-width: none; }
.ax-msgs::-webkit-scrollbar { display: none; }
.ax-msgs::before { content: ''; position: sticky; top: 0; display: block; height: 0; }
.ax-wm { position: absolute; inset: 0; background: url(../img/app/logo-light.png) center/120px auto no-repeat; opacity: .04; pointer-events: none; }
.ax-m { max-width: 74%; display: flex; flex-direction: column; position: relative; z-index: 1; animation: ax-in .4s cubic-bezier(.2, .7, .1, 1) both; }
.ax-m.out { align-self: flex-end; align-items: flex-end; }
.ax-b { position: relative; padding: 6px 10px 4px; border-radius: 0 10px 10px 10px; background: #fff; font-size: .8rem; line-height: 1.45; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); }
.ax-b::before { content: ''; position: absolute; top: 0; left: -7px; border: 7px solid transparent; border-top-color: #fff; border-right-color: #fff; }
.ax-m.out .ax-b { background: #d9fdd3; border-radius: 10px 0 10px 10px; }
.ax-m.out .ax-b::before { left: auto; right: -7px; border-top-color: #d9fdd3; border-right-color: transparent; border-left-color: #d9fdd3; }
.ax-meta { display: flex; justify-content: flex-end; align-items: center; gap: 3px; margin-top: 2px; font-size: .6rem; color: #667781; line-height: 1; }
.ax-meta .ag { font-weight: 600; padding-right: 5px; border-right: 1px solid rgba(0, 0, 0, .2); margin-right: 2px; display: inline-flex; align-items: center; gap: 3px; }
.ax-meta .ck { color: #53bdeb; }
.ax-m.sys { align-self: center; max-width: 86%; }
.ax-m.sys .ax-b { background: rgba(255, 255, 255, .85); color: var(--tx2); font-size: .7rem; text-align: center; border-radius: 6px; padding: 4px 10px; }
.ax-m.sys .ax-b::before { display: none; }
.ax-typing .ax-b { padding: 9px 12px; }
.ax-typing i { display: inline-block; width: 6px; height: 6px; margin: 0 1px; border-radius: 50%; background: #8696a0; animation: typing 1.2s infinite ease-in-out; }
.ax-typing i:nth-child(2) { animation-delay: .15s; } .ax-typing i:nth-child(3) { animation-delay: .3s; }
.ax-opts { display: grid; gap: 4px; margin-top: 6px; }
.ax-opts span { display: block; text-align: center; padding: 6px 10px; border-radius: 6px; background: #fff; color: #027EB5; font-size: .74rem; font-weight: 500; border: 1px solid rgba(0, 0, 0, .06); transition: background .3s, color .3s; }
.ax-opts span.pick { background: #027EB5; color: #fff; }
.ax-pay { display: flex; gap: 8px; align-items: center; margin-top: 5px; padding: 7px 8px; border-radius: 6px; background: rgba(255, 255, 255, .75); }
.ax-pay svg { color: var(--primary); }
.ax-pay b { display: block; font-size: .74rem; }
.ax-pay small { font-size: .64rem; color: #667781; }
.ax-input { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--bd); color: var(--tx2); }
.ax-input__f { flex: 1; height: 34px; border: 1.5px solid var(--bd); border-radius: 2px; display: flex; align-items: center; padding: 0 12px; font-size: .78rem; color: var(--tx3); }
.ax-send { width: 34px; height: 34px; border-radius: 2px; background: var(--primary); color: #fff; display: grid; place-items: center; }

.ax-rp { border-left: 1px solid var(--bd); overflow-y: auto; min-width: 0; background: var(--s1); scrollbar-width: none; }
.ax-rp__h { padding: 16px 12px 12px; text-align: center; border-bottom: 1px solid var(--bd); }
.ax-rp__h .ax-av { width: 46px; height: 46px; font-size: 1.05rem; margin: 0 auto 8px; }
.ax-rp__h b { display: block; font-size: .82rem; }
.ax-rp__h small { font-size: .7rem; color: var(--tx3); }
.ax-sec { border-bottom: 1px solid var(--bd); }
.ax-sec__h { display: flex; align-items: center; gap: 6px; padding: 9px 12px; font-size: .72rem; font-weight: 600; color: var(--tx2); }
.ax-sec__h .ar { margin-left: auto; transform: rotate(180deg); opacity: .7; }
.ax-sec__h .ax-bdg { margin-left: auto; }
.ax-sec__h .ax-bdg + .ar { margin-left: 4px; }
.ax-sec__b { padding: 2px 12px 12px; font-size: .74rem; animation: ax-in .45s cubic-bezier(.2, .7, .1, 1) both; }
.ax-f { display: flex; gap: 6px; margin-bottom: 5px; }
.ax-f span:first-child { color: var(--tx3); min-width: 74px; white-space: nowrap; }
.ax-f span:last-child { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .4s; }
.ax-line { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--bd); }
.ax-line:first-child { border-top: 0; }
.ax-line small { display: block; color: var(--tx3); font-size: .64rem; }
.ax-line > span:last-child { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ax-line.tot { font-weight: 700; border-top: 1.5px solid var(--tx); }
.ax-empty { color: var(--tx3); font-size: .72rem; padding: 4px 0; }
.ax-cal { display: grid; grid-template-columns: 34px repeat(5, minmax(0, 1fr)); gap: 3px; font-size: .62rem; text-align: center; }
.ax-cal span { padding: 5px 0; border-radius: 2px; background: var(--s2); color: var(--tx2); }
.ax-cal .h { background: none; font-weight: 600; color: var(--tx); }
.ax-cal .t { background: none; color: var(--tx3); text-align: left; }
.ax-cal .busy { background: #DBEAFE; color: #1D4ED8; font-weight: 600; }
.ax-cal .pick { background: var(--primary); color: #fff; font-weight: 600; animation: pop .5s cubic-bezier(.2, .7, .1, 1) both; }
.ax-hist { display: grid; gap: 7px; }
.ax-hist div { display: flex; align-items: center; gap: 7px; color: var(--tx2); }
.ax-hist svg { color: var(--primary); }
.ax-hist .new { color: var(--tx); font-weight: 600; animation: ax-in .45s cubic-bezier(.2, .7, .1, 1) both; }
.ax-ia { font-size: .58rem; font-weight: 700; padding: 1px 5px; border-radius: 3px; background: #EEF2FF; color: var(--primary); }
.ax-bars { display: flex; align-items: flex-end; gap: 4px; height: 46px; margin-top: 6px; }
.ax-bars i { flex: 1; height: var(--h); background: #DBEAFE; border-radius: 2px 2px 0 0; transition: height .8s cubic-bezier(.2, .7, .1, 1), background .4s; }
.ax-bars i.new { background: var(--primary); }
.ax-kpi { font-size: 1.35rem; font-weight: 800; line-height: 1; }
.ax-kpi small { font-size: .66rem; font-weight: 600; color: var(--ok); margin-left: 4px; }

/* ---------- softphone flotante ---------- */
.ax-sp { position: absolute; right: 14px; bottom: 14px; z-index: 5; width: 250px; background: var(--sb); color: #fff; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 24px 64px rgba(0, 0, 0, .45); overflow: hidden; animation: ax-in .5s cubic-bezier(.2, .7, .1, 1) both; }
.ax-sp__h { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: rgba(255, 255, 255, .04); border-bottom: 1px solid rgba(255, 255, 255, .07); font-size: .7rem; font-weight: 600; color: rgba(255, 255, 255, .65); }
.ax-sw { width: 30px; height: 17px; border-radius: 17px; background: var(--ok); position: relative; }
.ax-sw::after { content: ''; position: absolute; right: 2px; top: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; }
.ax-sp__tabs { display: flex; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.ax-sp__tabs span { flex: 1; text-align: center; padding: 7px 0; font-size: .68rem; font-weight: 600; color: rgba(255, 255, 255, .45); border-bottom: 2px solid transparent; }
.ax-sp__tabs span.on { color: #fff; border-bottom-color: var(--primary-light); }
.ax-sp__b { padding: 12px; }
.ax-caller { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 2px; background: rgba(255, 255, 255, .05); }
.ax-caller .ax-av { width: 38px; height: 38px; }
.ax-caller b { display: block; font-size: .8rem; letter-spacing: .02em; }
.ax-caller small { font-size: .66rem; color: rgba(255, 255, 255, .5); }
.ax-sp__t { text-align: center; font-size: 1.15rem; font-weight: 600; margin: 10px 0 2px; font-variant-numeric: tabular-nums; }
.ax-sp__st { text-align: center; font-size: .66rem; color: #FCA5A5; display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 14px; }
.ax-sp__st i { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); animation: blink 1.2s infinite; }
.ax-wave { display: flex; align-items: center; gap: 2px; height: 26px; margin: 8px 0; }
.ax-wave i { flex: 1; border-radius: 2px; background: var(--primary-light); height: 20%; animation: wave 1s ease-in-out infinite; }
.ax-wave i:nth-child(3n) { animation-delay: -.3s; } .ax-wave i:nth-child(3n+1) { animation-delay: -.6s; } .ax-wave i:nth-child(4n) { animation-delay: -.85s; }
.ax-wave.off i { animation: none; height: 12%; background: rgba(255, 255, 255, .2); }
.ax-fabs { display: flex; justify-content: center; gap: 12px; margin-top: 6px; }
.ax-fab { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: #fff; }
.ax-fab.end { background: var(--danger); }
.ax-fab.end svg { transform: rotate(135deg); }

/* ---------- tablas (llamadas en vivo, consumos) ---------- */
.ax-table { width: 100%; border-collapse: collapse; font-size: .74rem; }
.ax-table th { text-align: left; padding: 9px 12px; font-size: .64rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--tx3); border-bottom: 1px solid var(--bd); background: var(--s2); white-space: nowrap; }
.ax-table td { padding: 10px 12px; border-bottom: 1px solid var(--bd); white-space: nowrap; }
.ax-table td small { display: block; color: var(--tx3); font-size: .66rem; }
.ax-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ax-acts { display: flex; gap: 4px; }
.ax-acts span { width: 26px; height: 26px; border-radius: 2px; display: grid; place-items: center; background: var(--s3); color: var(--primary); }
.ax-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ax-stat { padding: 14px; display: grid; gap: 6px; border-top: 3px solid var(--c, var(--primary)); }
.ax-stat small { font-size: .68rem; color: var(--tx3); font-weight: 500; }
.ax-stat b { font-size: 1.35rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ax-stat em { font-style: normal; font-size: .66rem; color: var(--tx2); }
.ax-two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; flex: 1; min-height: 0; }
.ax-chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding: 0 4px; border-bottom: 1px solid var(--bd); }
.ax-chart i { flex: 1; height: var(--h); background: linear-gradient(#3B82F6, #0033CC); border-radius: 2px 2px 0 0; transform-origin: bottom; }
.ax-axis { display: flex; justify-content: space-between; font-size: .6rem; color: var(--tx3); padding: 4px 4px 0; }
.ax-cardh { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--bd); font-size: .78rem; font-weight: 700; }
.ax-pad { padding: 14px; }

@keyframes ax-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes blink { 50% { opacity: .25; } }
@keyframes wave { 50% { height: 90%; } }
@keyframes typing { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }
@keyframes pop { 40% { transform: scale(1.15); } }
