/* ==========================================================================
   Animações do ConnPBX (usam a mesma moldura .hf das telas da Jornada)
   ========================================================================== */
.px .hf-body { min-height: 320px; }
.px-wrap { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; position: relative; }
.px-center { align-items: center; justify-content: center; text-align: center; }
.px-split { flex-direction: row; align-items: center; gap: 14px; }
.px-split > * { flex: 1; min-width: 0; }
.px-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 1; }
.px-panel { background: var(--hf-panel); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.px-panel h6 { margin: 0 0 2px; font: 700 10px var(--font-head); text-transform: uppercase; letter-spacing: .08em; color: var(--hf-mut); }
.px-caption { margin: 0; font-size: 11.5px; color: #ffb3a8; text-align: center; }
.px-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,97,80,.16); color: #ff9a8e; flex: none; }
.px-ico.big { width: 54px; height: 54px; border-radius: 16px; }
.px-ico.big svg { width: 26px; height: 26px; }
.px-ico.ringing, .px-dev.ring .px-ico { animation: pxRing 1.1s infinite; }

/* agentes e filas */
.px-agent { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 9px; background: rgba(255,255,255,.03); }
.px-agent b { display: block; font: 600 11.5px var(--font-head); color: #fff; }
.px-agent small { color: var(--hf-mut); font-size: 10px; }
.px-agent em { margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.px-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.px-agent.busy .px-dot { background: #ff6150; box-shadow: 0 0 0 3px rgba(255,97,80,.2); }
.px-agent.busy em { color: #ff9a8e; }
.px-agent.free .px-dot { background: #25d366; }
.px-agent.free em { color: #7ee2a8; }
.px-agent.pause .px-dot { background: #ffc24a; }
.px-agent.pause em { color: #ffd98a; }
.px-q { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 8px; font-size: 11px; }
.px-q i { height: 8px; border-radius: 8px; background: linear-gradient(90deg, #ff6150, #ff8a1f); width: 0; transition: width 1.4s var(--ease); }
.hf.run .px-q i { width: var(--w); }
.px-q small { color: var(--hf-mut); font-size: 10px; white-space: nowrap; }
.px-ring { margin-top: auto; display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--grad); color: #fff; font: 700 11px var(--font-head); }
.px-ring svg { animation: pxRing 1s infinite; }

/* aparelhos */
.px-incoming { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--grad); color: #fff; }
.px-incoming b { font: 800 13px var(--font-head); }
.px-incoming small { width: 100%; opacity: .9; }
.px-devices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.px-dev { background: var(--hf-panel); border-radius: 14px; padding: 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 1px solid transparent; transition: border-color .4s, background .4s; }
.px-dev b { font: 700 12px var(--font-head); color: #fff; }
.px-dev small { color: var(--hf-mut); font-size: 10px; }
.px-dev em { font-style: normal; font: 700 10.5px var(--font-head); color: #25d366; }
.px-dev.answer:has(em.on) { border-color: #25d366; background: rgba(37,211,102,.1); }
.px-dev.answer:has(em.on) .px-ico { animation: none; background: #25d366; color: #fff; }
.hf.run .px-dev.ring:not(.answer) .px-ico { animation: pxRing 1.1s 3 forwards; }

/* tabela de filas */
.px-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.px-table th { text-align: left; font: 700 9.5px var(--font-head); text-transform: uppercase; letter-spacing: .06em; color: var(--hf-mut); padding: 6px 8px; border-bottom: 1px solid var(--hf-line); }
.px-table td { padding: 8px; border-bottom: 1px solid var(--hf-line); color: #fff; font-weight: 600; }
.px-table td.ok { color: #7ee2a8; }
.px-wait { display: inline-flex; gap: 4px; }
.px-wait i { width: 9px; height: 9px; border-radius: 50%; background: #ffc24a; animation: blink 1.4s infinite; }
.px-wait i:nth-child(2) { animation-delay: .3s; }
.px-flowline { display: flex; align-items: center; gap: 8px; justify-content: center; }
.px-caller { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 99px; background: rgba(255,255,255,.08); color: #fff; font: 600 11px var(--font-head); }
.px-caller.agentc { background: rgba(37,211,102,.16); color: #7ee2a8; }
.px-arrow { flex: 0 1 50px; height: 2px; background: repeating-linear-gradient(90deg, #ff6150 0 6px, transparent 6px 10px); }
.px-pill { padding: 7px 10px; border-radius: 99px; background: var(--grad); color: #fff; font: 700 11px var(--font-head); }

/* lista (não atendidas / gravações) */
.px-list { display: flex; flex-direction: column; gap: 8px; }
.px-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--hf-panel); position: relative; flex-wrap: wrap; }
.px-row > div { flex: 1; min-width: 0; }
.px-row b { display: block; font: 700 12px var(--font-head); color: #fff; }
.px-row small { color: var(--hf-mut); font-size: 10.5px; }
.px-miss { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,97,80,.16); color: #ff6150; transform: rotate(135deg); flex: none; }
.px-btn { font: 700 10.5px var(--font-head); padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,.08); color: #fff; }
.px-row.done .px-btn { background: var(--grad); }
.px-ok { width: 100%; font: 700 10.5px var(--font-head); color: #7ee2a8; padding-left: 42px; }
.px-cursor { position: absolute; width: 18px; height: 18px; right: 46px; top: 150px; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 0 0 6px rgba(255,255,255,.2); pointer-events: none; }
.hf .px-cursor.on { animation: pxClick .9s .3s 2; }
.px-play { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); color: #fff; font-size: 11px; flex: none; }
.px-play.on { background: var(--grad); }
.px-wave { display: flex; align-items: center; gap: 2px; height: 34px; margin-top: 8px; }
.px-wave i { flex: 1; height: var(--h); border-radius: 2px; background: rgba(255,154,142,.55); }
.hf.run .px-wave i { animation: pxWave .9s var(--d) ease-in-out infinite alternate; }
.px-progress { height: 4px; border-radius: 4px; background: rgba(255,255,255,.1); margin-top: 6px; overflow: hidden; }
.px-progress i { display: block; height: 100%; width: 0; background: var(--grad); }
.hf.run .px-progress i { animation: pxGrow 5.5s linear forwards; }
.px-quote { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(139,92,246,.16); border: 1px solid rgba(139,92,246,.35); color: #e5dcff; font-size: 12px; font-style: italic; }

/* transbordo / API */
.px-callcard { background: var(--hf-panel); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.px-callcard b { font: 700 12.5px var(--font-head); color: #fff; }
.px-callcard small { color: var(--hf-mut); font-size: 10.5px; }
.px-callcard .px-ico.big { animation: pxRing 1.1s infinite; }
.px-timer { width: 100%; height: 8px; border-radius: 8px; background: rgba(255,255,255,.08); overflow: hidden; }
.px-timer i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffc24a, #ff6150); }
.hf.run .px-timer i { animation: pxGrow 2.4s linear forwards; }
.px-tag-red { font: 700 10.5px var(--font-head); color: #fff; background: #ec4b3a; padding: 4px 9px; border-radius: 8px; }
.px-hop { flex: 0 0 38px !important; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; }
.px-wa { background: #0b141a; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; }
.px-wa-top { display: flex; gap: 6px; align-items: center; padding: 9px 12px; background: #075e54; color: #fff; font: 700 11px var(--font-head); }
.px-wa-top svg { width: 14px; height: 14px; }
.px-wa p { margin: 0 12px; padding: 8px 10px; border-radius: 10px; background: #1f2c34; color: #e9edef; font-size: 11.5px; max-width: 88%; }
.px-wa p.me { align-self: flex-end; background: #005c4b; }
.px-erp { background: #fff; color: var(--ink); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 16px 30px -14px rgba(0,0,0,.6); }
.px-erp-top { display: flex; gap: 6px; align-items: center; font: 700 11px var(--font-head); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.px-erp dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 11.5px; }
.px-erp dt { color: var(--muted); }
.px-erp dd { margin: 0; font-weight: 700; }
.px-sync { display: inline-flex; gap: 6px; align-items: center; font: 700 10.5px var(--font-head); color: #138a4c; background: #e6f8ee; padding: 5px 9px; border-radius: 8px; align-self: flex-start; }
.px-sync svg { width: 13px; height: 13px; }

/* URA e pesquisa */
.px-ivr { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.px-voice { margin: 0; font-size: 11.5px; color: var(--hf-txt); background: var(--hf-panel); padding: 10px 12px; border-radius: 12px; }
.px-keypad { display: grid; grid-template-columns: repeat(3, 34px); gap: 6px; }
.px-keypad.small { grid-template-columns: repeat(5, 34px); }
.px-keypad span { height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.07); font: 700 13px var(--font-head); color: #fff; }
.hf.run .px-keypad span.press { animation: pxPress .6s 1.4s forwards; }
.px-tree { display: flex; flex-direction: column; gap: 8px; }
.px-node { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 10px; background: var(--hf-panel); font: 600 11.5px var(--font-head); color: var(--hf-txt); }
.px-node.hit { opacity: 1; transform: none; }
.px-node.hit.on { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -10px rgba(255,97,80,.8); }
.hf .px-node.hit { transition: background .4s, box-shadow .4s; }
.px-node svg { width: 13px; height: 13px; }
.px-stars { font-size: 22px; letter-spacing: 3px; color: #ffc24a; text-shadow: 0 0 12px rgba(255,194,74,.5); }
.px-score b { font: 800 34px var(--font-head); color: #fff; display: inline-block; }
.px-score small { display: block; color: var(--hf-mut); font-size: 10.5px; }

/* monitoramento */
.px-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.px-ext { aspect-ratio: 1.3; border-radius: 9px; display: grid; place-items: center; font: 700 11px var(--font-head); color: #fff; }
.px-ext.free { background: rgba(37,211,102,.22); }
.px-ext.busy { background: rgba(255,97,80,.55); animation: pxPulse 2s infinite; }
.px-ext.pause { background: rgba(255,194,74,.35); }
.px-ext.off { background: rgba(255,255,255,.06); color: var(--hf-mut); }
.hf.run .px-ext.flip { animation: pxFlip .5s 1.6s forwards; }
.px-legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; font-size: 10.5px; color: var(--hf-mut); }
.px-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.px-legend .free::before { background: #25d366; }
.px-legend .busy::before { background: #ff6150; }
.px-legend .pause::before { background: #ffc24a; }
.px-legend .off::before { background: rgba(255,255,255,.2); }

/* relatórios */
.px-bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.px-bars div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.px-bars i { width: 100%; height: 0; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #ff8a1f, #ff6150); transition: height 1.3s var(--ease); }
.hf.run .px-bars i { height: var(--h); }
.px-bars small { color: var(--hf-mut); font-size: 10px; }

/* agente */
.px-status { display: grid; }
.px-status span { grid-area: 1 / 1; padding: 10px 12px; border-radius: 10px; font: 700 12px var(--font-head); }
.px-status .s1, .px-status .s3 { background: rgba(37,211,102,.16); color: #7ee2a8; }
.px-status .s2 { background: #3b3220; color: #ffd98a; }
.px-status em { font-style: normal; margin-left: 6px; }
.px-status .s1 { transition: opacity .3s var(--ease), transform .3s var(--ease); }
.px-status:has(.s2.on) .s1, .px-status:has(.s3.on) .s2 { opacity: 0; transform: translateY(-8px); }
.px-reasons { display: flex; flex-wrap: wrap; gap: 5px; }
.px-reasons small { width: 100%; color: var(--hf-mut); font-size: 10px; }
.px-reasons span { font: 600 10px var(--font-head); padding: 4px 8px; border-radius: 7px; background: rgba(255,255,255,.07); }
.px-reasons span:first-of-type { background: rgba(255,194,74,.2); color: #ffd98a; }
.px-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; padding: 4px 0; }
.px-toggle i { width: 30px; height: 17px; border-radius: 99px; background: rgba(255,255,255,.15); position: relative; flex: none; }
.px-toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: transform .3s; }
.px-toggle i.on { background: #25d366; }
.px-toggle i.on::after { transform: translateX(13px); }
.hf.run .px-toggle:nth-of-type(2) i { animation: pxToggleBg .3s 2s forwards; }
.hf.run .px-toggle:nth-of-type(2) i::after { animation: pxToggleKnob .3s 2s forwards; }

@keyframes pxRing { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-14deg); } 20% { transform: rotate(14deg); } 30% { transform: rotate(-10deg); } 40% { transform: rotate(0); } }
@keyframes pxGrow { to { width: 100%; } }
@keyframes pxWave { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
@keyframes pxPress { 0% { transform: scale(1); } 40% { transform: scale(.85); background: #ff6150; } 100% { transform: scale(1); background: #ff6150; } }
@keyframes pxPulse { 50% { box-shadow: 0 0 0 3px rgba(255,97,80,.35); } }
@keyframes pxFlip { to { background: rgba(255,97,80,.55); box-shadow: 0 0 0 3px #fff; } }
@keyframes pxClick { 50% { transform: scale(.7); } }
@keyframes pxToggleBg { to { background: #25d366; } }
@keyframes pxToggleKnob { to { transform: translateX(13px); } }

@container (max-width: 560px) {
  .px-split { flex-direction: column; align-items: stretch; }
  .px-hop { transform: rotate(90deg); align-self: center; }
  .px-cols { grid-template-columns: 1fr; }
  .px-grid { grid-template-columns: repeat(6, 1fr); }
  .px-table { font-size: 10.5px; }
  .px-q { grid-template-columns: 60px 1fr auto; }
  .px-flowline { flex-wrap: wrap; }
  .px-devices { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .px-table th:nth-child(4), .px-table td:nth-child(4) { display: none; }
  .px-cursor { display: none; }
}

/* Itens de grid não podem ser mais largos que a tela (evita rolagem lateral no celular) */
.page-hero-grid > *, .hero-grid > *, .split > *, .tabs > *, .grid > *, .vs > * { min-width: 0; }
@media (max-width: 480px) {
  .btn { white-space: normal; text-align: center; line-height: 1.25; }
}
@container (max-width: 440px) {
  .hf-kpis b { font-size: 14px; }
  .px-keypad { grid-template-columns: repeat(3, 30px); }
  .px-keypad.small { grid-template-columns: repeat(5, 30px); }
  .px-devices { grid-template-columns: 1fr; }
  .px-dev { flex-direction: row; justify-content: flex-start; text-align: left; padding: 8px 10px; }
  .px-grid { grid-template-columns: repeat(4, 1fr); }
  .px-grid .px-ext:nth-child(n+17) { display: none; }
}
