/* AI-Powered ERP page: builds on hrms.css and vision.css */
.ai-live { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #32D583; box-shadow: 0 0 8px #32D583; animation: vz-blink 1.4s ease-in-out infinite; }
.ai-console-body { display: grid; grid-template-columns: 1fr 250px; gap: 0.8rem; padding: 1rem; }
.ai-chat { display: grid; align-content: start; gap: 0.7rem; min-height: 330px; }
.ai-msg { max-width: 88%; padding: 0.8rem 1rem; border-radius: 1rem; font-size: 0.9rem; line-height: 1.5; animation: hr-in 0.5s ease both; animation-delay: var(--d, 0s); }
.ai-msg > span { display: block; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 0.25rem; opacity: 0.75; }
.ai-msg--you { justify-self: end; background: #0096EE; color: #fff; border-bottom-right-radius: 0.3rem; }
.ai-msg--bot { justify-self: start; background: #12233D; color: #E6F0FA; border: 1px solid rgba(110, 197, 247, 0.18); border-bottom-left-radius: 0.3rem; }
.ai-typing { justify-self: start; display: flex; gap: 0.3rem; padding: 0.7rem 0.9rem; border-radius: 1rem; background: #12233D; opacity: 0; animation: ai-typing-life 1.1s ease forwards; animation-delay: var(--d); }
@keyframes ai-typing-life { 0% { opacity: 0; } 15%, 85% { opacity: 1; } 100% { opacity: 0; height: 0; padding: 0; margin: -0.35rem 0; } }
.ai-typing i { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: #7CD0FA; animation: ai-dot 0.9s ease-in-out infinite; }
.ai-typing i:nth-child(2) { animation-delay: 0.15s; } .ai-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ai-dot { 50% { transform: translateY(-4px); opacity: 0.5; } }
.ai-table { width: 100%; border-collapse: collapse; margin: 0.7rem 0; font-size: 0.8rem; }
.ai-table th { text-align: left; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; color: #8FA6C6; font-weight: 600; padding: 0.3rem 0.4rem; border-bottom: 1px solid rgba(143, 166, 198, 0.25); }
.ai-table td { padding: 0.4rem; border-bottom: 1px solid rgba(143, 166, 198, 0.12); }
.ai-table tr[style] { animation: hr-in 0.4s ease both; animation-delay: calc(2.7s + var(--i) * 0.15s); }
.ai-table .bad { color: #FDA29B; font-weight: 600; }
.ai-actions { display: flex; gap: 0.5rem; }
.ai-actions span { padding: 0.45rem 0.8rem; border-radius: 0.5rem; font-size: 0.78rem; font-weight: 600; border: 1px solid rgba(143, 166, 198, 0.4); }
.ai-actions .is-go { background: #0096EE; border-color: #0096EE; color: #fff; animation: ai-glow 2s ease-in-out infinite 3.6s; }
@keyframes ai-glow { 50% { box-shadow: 0 0 0 5px rgba(0, 150, 238, 0.3); } }
.ai-side { display: grid; align-content: start; gap: 0.5rem; padding: 0.3rem; border-left: 1px solid rgba(110, 197, 247, 0.12); padding-left: 0.8rem; }
.ai-side > small { font-size: 0.7rem; font-weight: 600; color: #8FA6C6; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.2rem; }
.ai-agent { display: grid; grid-template-columns: auto 1fr; column-gap: 0.6rem; align-items: center; padding: 0.55rem 0.65rem; border-radius: 0.6rem; background: #12233D; animation: hr-in 0.45s ease both; animation-delay: calc(0.8s + var(--i) * 0.15s); }
.ai-agent > span { grid-row: span 2; width: 2rem; height: 2rem; border-radius: 0.55rem; background: rgba(0, 150, 238, 0.18); color: #7CD0FA; display: flex; align-items: center; justify-content: center; }
.ai-agent b { font-size: 0.8rem; color: #F2F7FC; } .ai-agent em { font-style: normal; font-size: 0.68rem; color: #FEC84B; }

/* Feature mocks */
.ai-qa { padding-bottom: 1rem; }
.ai-qa .ai-msg { margin: 0.9rem 1rem 0; max-width: none; animation: none; }
.ai-qa .ai-msg--bot { background: #F0F8FE; color: #101828; border-color: #DCEBF7; }
.ai-bars { display: grid; gap: 0.5rem; margin-top: 0.7rem; }
.ai-bars > div { display: grid; grid-template-columns: 8.5rem 1fr 3rem; gap: 0.6rem; align-items: center; font-size: 0.78rem; }
.ai-bars > div > div { height: 0.75rem; background: #E4EEF6; border-radius: 99px; overflow: hidden; }
.ai-bars i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #FDA29B, #F04438); border-radius: 99px; }
.hr-feat.is-in .ai-bars i { animation: hr-w 0.8s ease forwards; animation-delay: calc(0.3s + var(--i) * 0.15s); }
.ai-bars b { color: #B42318; text-align: right; }
.ai-feed { max-width: 420px; }
.hr-feat .ai-feed .vz-alert { animation: none; opacity: 0; transform: translateX(-12px); transition: opacity 0.4s ease, transform 0.4s ease; transition-delay: calc(0.2s + var(--i) * 0.2s); }
.hr-feat.is-in .ai-feed .vz-alert { opacity: 1; transform: none; }
.ai-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; padding: 0.9rem 1rem 0; }
.ai-kpis span { display: grid; padding: 0.6rem 0.7rem; border-radius: 0.6rem; background: #F7FAFD; }
.ai-kpis small { font-size: 0.68rem; color: #667085; } .ai-kpis b { font-size: 1.15rem; } .ai-kpis em { font-style: normal; font-size: 0.68rem; color: #0077C0; font-weight: 600; }
.ai-chart i { background: linear-gradient(180deg, #33B1F5, #0078BE) !important; }
.ai-stack { position: relative; display: grid; gap: 0.9rem; width: 100%; max-width: 520px; perspective: 900px; }
.ai-layer { display: grid; grid-template-columns: auto 1fr; column-gap: 0.9rem; align-items: center; padding: 1rem 1.2rem; border-radius: 1rem; background: rgba(255, 255, 255, 0.95); color: #101828; box-shadow: 0 24px 40px -24px rgba(20, 10, 60, 0.7); transform: rotateX(18deg); opacity: 0; transition: opacity 0.5s ease, transform 0.6s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(0.2s + (2 - var(--i)) * 0.25s); }
.hr-feat.is-in .ai-layer { opacity: 1; transform: rotateX(0); }
.ai-layer > span { grid-row: span 2; width: 2.8rem; height: 2.8rem; border-radius: 0.8rem; background: linear-gradient(135deg, #33B1F5, #0078BE); color: #fff; display: flex; align-items: center; justify-content: center; }
.ai-layer:nth-child(2) > span { background: linear-gradient(135deg, #7A5AF8, #0096EE); }
.ai-layer:nth-child(3) > span { background: linear-gradient(135deg, #0B3A66, #1C5FA0); }
.ai-layer b { font-size: 1rem; } .ai-layer small { font-size: 0.78rem; color: #667085; }
.ai-auto { display: flex; align-items: center; gap: 0.5rem; justify-content: center; padding: 0.7rem 1rem; border-radius: 99px; border: 1.5px dashed rgba(255, 255, 255, 0.7); color: #fff; font-size: 0.85rem; font-weight: 500; }
.ai-perms { padding: 1rem; font-size: 0.82rem; }
.ai-perm-h, .ai-perm-r { display: grid; grid-template-columns: 6.5rem repeat(4, 1fr); gap: 0.5rem; align-items: center; padding: 0.45rem 0; }
.ai-perm-h { border-bottom: 1px solid #EEF2F6; } .ai-perm-h b { text-align: center; font-size: 0.7rem; color: #667085; }
.ai-perm-r i { justify-self: center; position: relative; width: 2.2rem; height: 1.25rem; border-radius: 99px; background: #E4E7EC; transition: background-color 0.3s ease; transition-delay: calc(0.3s + var(--r) * 0.15s); }
.ai-perm-r i::after { content: ""; position: absolute; left: 0.15rem; top: 0.15rem; width: 0.95rem; height: 0.95rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.3s ease; transition-delay: inherit; }
.hr-feat.is-in .ai-perm-r i.is-on { background: #0096EE; }
.hr-feat.is-in .ai-perm-r i.is-on::after { transform: translateX(0.95rem); }

/* Comparison */
.ai-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; width: 100%; max-width: 460px; }
.ai-old, .ai-new { background: #fff; border-radius: 1rem; padding: 1.1rem; display: grid; align-content: start; gap: 0.45rem; box-shadow: 0 24px 50px -30px rgba(80, 40, 0, 0.5); }
.ai-old b, .ai-new b { font-size: 0.9rem; margin-bottom: 0.3rem; }
.ai-old span { font-size: 0.8rem; color: #98A2B3; padding: 0.4rem 0.6rem; border-radius: 0.5rem; background: #F2F4F7; text-decoration: line-through; text-decoration-color: rgba(152, 162, 179, 0.6); }
.ai-new { background: linear-gradient(160deg, #0096EE, #0078BE); color: #fff; }
.ai-one { display: flex; align-items: center; gap: 0.5rem; padding: 0.8rem; border-radius: 0.7rem; background: rgba(255, 255, 255, 0.18); font-weight: 600; animation: ai-glow 2.4s ease-in-out infinite; }
.ai-new em { font-style: normal; font-size: 0.8rem; margin-top: auto; color: #DDF3FF; }
.ai-agents { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin-bottom: 2.2rem; }
.ai-agent-chip { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.88rem; padding: 0.55rem 1rem; border-radius: 99px; color: #fff; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.22); transition: background-color 0.2s ease, transform 0.2s ease; }
.ai-agent-chip:hover { background: rgba(0, 150, 238, 0.35); transform: translateY(-2px); }
.ai-agent-chip svg { color: #7CD0FA; }

@media (max-width: 1023px) {
  .ai-console-body { grid-template-columns: 1fr; }
  .ai-side { border-left: 0; padding-left: 0; grid-template-columns: 1fr 1fr; } .ai-side > small { grid-column: span 2; }
}
@media (max-width: 640px) {
  .ai-side { display: none; }
  .ai-chat { min-height: 0; }
  .ai-msg { max-width: 100%; }
  .ai-bars > div { grid-template-columns: 6rem 1fr 2.6rem; }
  .ai-compare { grid-template-columns: 1fr; }
  .ai-perm-h, .ai-perm-r { grid-template-columns: 4.6rem repeat(4, 1fr); }
}

/* Placement fixes */
#actions .hr-float--l { top: 1rem; bottom: auto; left: 0; max-width: 15rem; }
@media (min-width: 1024px) { #actions .hr-mock { justify-content: flex-end; padding-right: 2rem; } }
.ai .hr-scene--sea .hr-s2 { top: 8%; right: 4%; }
#control .hr-float--r { bottom: -1.2rem; }
