/* ==========================================================================
   Infinity Plus Warehouse - Signature Motion and Animation Engine
   Animated Inline Infinity Plus Logo, Global Refresh Wave, Button Sheen,
   Click Ink Ripple, Staggered Tab Transitions, and Living Micro-Interactions
   ========================================================================== */

/* 1. Animated Brand Logo Component (Pure Inline Code + CSS Choreography) */
.ip-logo-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    user-select: none;
    cursor: pointer;
    position: relative;
}

.ip-logo-wrap.is-full {
    width: 176px;
    margin: 0 auto 8px;
}

.ip-logo-wrap.is-compact {
    width: 68px;
    flex-shrink: 0;
}

.ip-logo-svg {
    width: 100%;
    height: auto;
    overflow: visible;
    display: block;
}

/* Infinity Ribbon Animated Draw-In via Masked Stroke */
.ip-logo-mask-stroke {
    fill: none;
    stroke: #FFFFFF;
    stroke-width: 44;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 980;
    stroke-dashoffset: 980;
    animation: ipDrawRibbon 1.25s cubic-bezier(0.32, 0.08, 0.24, 1) forwards;
}

/* Continuous Subtle Light Sheen Gliding Along Infinity Loop */
.ip-logo-sheen-stroke {
    fill: none;
    stroke: rgba(255, 255, 255, 0.52);
    stroke-width: 5.5;
    stroke-linecap: round;
    stroke-dasharray: 46 880;
    stroke-dashoffset: 926;
    animation: ipGlideSheen 4.4s ease-in-out 1.8s infinite;
}

/* Signature Orange Plus Mark Pop + Spin + Gentle Pulse */
.ip-logo-plus {
    transform-box: fill-box;
    transform-origin: center;
    opacity: 0;
    animation:
        ipPlusPop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 0.82s forwards,
        ipPlusBreathe 3.6s ease-in-out 2.2s infinite;
}

.ip-logo-plus-ring {
    transform-box: fill-box;
    transform-origin: center;
    fill: none;
    stroke: #E85D1A;
    stroke-width: 2.5;
    opacity: 0;
    animation: ipPlusRingPulse 1.1s ease-out 0.95s forwards;
}

.ip-logo-wrap:hover .ip-logo-plus {
    animation: ipPlusHoverSpin 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 1;
}

/* Wordmark Rise Reveal */
.ip-logo-word-main {
    opacity: 0;
    transform: translateY(18px);
    animation: ipWordRise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 1.05s forwards;
}

.ip-logo-word-sub {
    opacity: 0;
    transform: translateY(14px);
    animation: ipWordRise 0.58s cubic-bezier(0.22, 1, 0.36, 1) 1.26s forwards;
}

/* Curved Orange Smile Arc Sweep */
.ip-logo-arc {
    transform-box: fill-box;
    transform-origin: center;
    opacity: 0;
    transform: scaleX(0);
    animation: ipArcSweep 0.65s cubic-bezier(0.22, 1, 0.36, 1) 1.44s forwards;
}

/* Compact Header Variant Faster Entrance */
.ip-logo-wrap.is-compact .ip-logo-mask-stroke {
    animation-duration: 0.95s;
}

.ip-logo-wrap.is-compact .ip-logo-plus {
    animation-delay: 0.58s, 2.2s;
}

.ip-logo-wrap.is-compact .ip-logo-word-main {
    animation-delay: 0.72s;
}

.ip-logo-wrap.is-compact .ip-logo-word-sub {
    animation-delay: 0.88s;
}

.ip-logo-wrap.is-compact .ip-logo-arc {
    animation-delay: 1.02s;
}

@keyframes ipDrawRibbon {
    0% { stroke-dashoffset: 980; }
    100% { stroke-dashoffset: 0; }
}

@keyframes ipGlideSheen {
    0%, 20% { stroke-dashoffset: 926; opacity: 0; }
    30% { opacity: 0.85; }
    72% { stroke-dashoffset: 0; opacity: 0.85; }
    85%, 100% { stroke-dashoffset: -40; opacity: 0; }
}

@keyframes ipPlusPop {
    0% {
        opacity: 0;
        transform: scale(0.1) rotate(-135deg);
    }
    65% {
        opacity: 1;
        transform: scale(1.24) rotate(14deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes ipPlusHoverSpin {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.22) rotate(98deg); }
    100% { transform: scale(1) rotate(90deg); }
}

@keyframes ipPlusBreathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.09); }
}

@keyframes ipPlusRingPulse {
    0% { opacity: 0.85; transform: scale(0.45); }
    100% { opacity: 0; transform: scale(2.15); }
}

@keyframes ipWordRise {
    0% {
        opacity: 0;
        transform: translateY(16px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ipArcSweep {
    0% {
        opacity: 0;
        transform: scaleX(0);
    }
    100% {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* 2. Interactive Login Screen - Unified Cool Pearl-Slate ("Off-White") Glass + Live Reactive Canvas */
.login-screen {
    overflow: hidden;
    background:
        radial-gradient(circle at 16% 18%, rgba(232, 93, 26, 0.14), transparent 45%),
        radial-gradient(circle at 84% 82%, rgba(14, 77, 100, 0.16), transparent 50%),
        linear-gradient(145deg, #DCE6EE 0%, #E7EEF4 50%, #D4E1EB 100%);
}

.login-fx-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
    pointer-events: auto;
}

.login-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(64px);
    opacity: 0.42;
    animation: ipOrbDrift 14s ease-in-out infinite alternate;
}

.login-orb.orb-1 {
    width: 360px;
    height: 360px;
    top: -90px;
    right: -80px;
    background: radial-gradient(circle, rgba(232, 93, 26, 0.28), transparent 72%);
}

.login-orb.orb-2 {
    width: 420px;
    height: 420px;
    bottom: -120px;
    left: -100px;
    background: radial-gradient(circle, rgba(14, 77, 100, 0.26), transparent 72%);
    animation-delay: -5s;
}

/* Seamless Unified Pearl-Glass Login Panel Matching the Off-White Slate Canvas */
.login-screen .login-card {
    position: relative;
    z-index: 2;
    background: rgba(241, 246, 250, 0.62);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1.5px solid rgba(14, 77, 100, 0.16);
    box-shadow:
        0 24px 56px rgba(11, 57, 75, 0.13),
        inset 0 1px 0 rgba(255, 255, 255, 0.78);
    color: var(--brand-navy-900);
}

.login-screen .login-card h1 {
    color: var(--brand-navy-900);
}

.login-screen .login-subtitle {
    color: var(--text-secondary);
}

.login-screen .field-label {
    color: var(--brand-navy-900);
}

.login-screen .field-label i {
    color: var(--brand-orange-500);
}

.login-screen .input {
    background: rgba(255, 255, 255, 0.72);
    border: 1.5px solid rgba(14, 77, 100, 0.18);
    color: var(--text-primary);
}

.login-screen .input::placeholder {
    color: #64748B;
}

.login-screen .input:focus {
    background: rgba(255, 255, 255, 0.96);
    border-color: var(--brand-orange-500);
    box-shadow: 0 0 0 3.5px rgba(232, 93, 26, 0.16);
}

.login-screen .login-footer-link {
    border-top-color: rgba(14, 77, 100, 0.14);
    color: var(--text-secondary);
}

.login-screen .login-footer-link a {
    color: var(--brand-orange-600);
}

.login-screen .login-footer-link a:hover {
    color: var(--brand-orange-700);
}

.login-screen .admin-badge-pill {
    background: rgba(232, 93, 26, 0.12);
    color: var(--brand-orange-700);
    border: 1px solid rgba(232, 93, 26, 0.28);
}

/* Pure Transparent Original Logo on Pearl-Slate Glass - Zero Box or Halo */
.login-screen .ip-logo-wrap.is-full {
    width: 184px;
    padding: 0;
    margin: 0 auto 6px;
    background: transparent;
}

.login-screen .ip-logo-wrap.is-full .ip-logo-svg {
    filter: drop-shadow(0 4px 10px rgba(11, 57, 75, 0.12));
}

/* Wider, Equal-Height Horizontal Login Card for Both index.html and admin.html */
.login-screen .login-card {
    max-width: 540px;
    padding: 26px 30px 22px;
}

.login-screen .login-brand {
    margin-bottom: 18px;
}

.login-screen .login-fields-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.login-screen .login-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

@media (max-width: 600px) {
    .login-screen .login-card {
        max-width: 420px;
        padding: 22px 20px 18px;
    }

    .login-screen .login-fields-row {
        grid-template-columns: 1fr;
    }
}

/* Password Input with Eye Toggle Button */
.password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrap .input {
    padding-left: 44px;
}

.password-toggle-btn {
    position: absolute;
    left: 8px;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-navy-700);
    transition: color 0.18s ease, background-color 0.18s ease, transform 0.18s var(--ease-spring);
}

.password-toggle-btn:hover {
    color: var(--brand-navy-900);
    background: rgba(14, 77, 100, 0.1);
}

.password-toggle-btn.is-revealed {
    color: var(--brand-orange-600);
}

.password-toggle-btn:active {
    transform: scale(0.9);
}

@keyframes ipOrbDrift {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(26px, -22px) scale(1.08); }
    100% { transform: translate(-20px, 18px) scale(0.96); }
}

/* 3. Signature Global Refresh Button Animation + Top Viewport Progress Bar */
.global-refresh-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5px;
    z-index: 9800;
    pointer-events: none;
    opacity: 0;
    background: rgba(14, 77, 100, 0.12);
    overflow: hidden;
    transition: opacity 0.25s ease;
}

.global-refresh-progress.is-active {
    opacity: 1;
}

.global-refresh-progress-bar {
    width: 42%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand-navy-700), var(--brand-orange-500), #F59E0B, var(--brand-navy-700));
    animation: ipRefreshBarSweep 1.05s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes ipRefreshBarSweep {
    0% { transform: translateX(260%); }
    100% { transform: translateX(-140%); }
}

.global-refresh-btn {
    position: relative;
    overflow: hidden;
}

.global-refresh-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.28) 50%, transparent 80%);
    transform: translateX(130%);
    transition: transform 0.65s ease;
    pointer-events: none;
}

.global-refresh-btn:hover::before {
    transform: translateX(-130%);
}

.global-refresh-btn i {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.global-refresh-btn:hover:not(.is-spinning) i {
    transform: rotate(90deg);
}

.global-refresh-btn.is-spinning {
    background: linear-gradient(135deg, var(--brand-orange-500), var(--brand-orange-600));
    box-shadow: 0 0 0 0 rgba(232, 93, 26, 0.55);
    animation: ipRefreshPulseRing 1s ease-out infinite;
}

.global-refresh-btn.is-done-flash {
    background: linear-gradient(135deg, #0F9D58, #0D8A4D);
    animation: ipRefreshDonePop 0.48s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ipRefreshPulseRing {
    0% { box-shadow: 0 0 0 0 rgba(232, 93, 26, 0.55); }
    75% { box-shadow: 0 0 0 12px rgba(232, 93, 26, 0); }
    100% { box-shadow: 0 0 0 0 rgba(232, 93, 26, 0); }
}

@keyframes ipRefreshDonePop {
    0% { transform: scale(0.92); }
    55% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* Content Subtle Refresh Wave */
.main-content.is-refresh-wave .card,
.main-content.is-refresh-wave .kpi-card,
.main-content.is-refresh-wave .shortage-card {
    animation: ipSoftRefreshWave 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ipSoftRefreshWave {
    0% {
        opacity: 0.72;
        transform: translateY(6px) scale(0.992);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 4. Button Light Sheen + Click Ink Ripple Across All Interactive Controls */
.btn,
.nav-item,
.subtab-btn,
.filter-chip,
.mobile-nav-btn,
.admin-quick-card {
    position: relative;
    overflow: hidden;
}

.btn-primary::after,
.btn-accent::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 48%;
    left: -60%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.26), transparent);
    transform: skewX(-18deg);
    transition: left 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.btn-primary:hover::after,
.btn-accent:hover::after {
    left: 125%;
}

.ip-ripple {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    transform: scale(0);
    background: rgba(255, 255, 255, 0.36);
    animation: ipRippleExpand 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.btn-outline .ip-ripple,
.btn-soft .ip-ripple,
.filter-chip:not(.is-active) .ip-ripple,
.subtab-btn:not(.is-active) .ip-ripple,
.mobile-nav-btn .ip-ripple,
.admin-quick-card .ip-ripple {
    background: rgba(14, 77, 100, 0.16);
}

@keyframes ipRippleExpand {
    to {
        transform: scale(2.8);
        opacity: 0;
    }
}

/* 5. Dynamic Tab and Sub-Tab Staggered Motion */
.tab-pane.is-active {
    animation: ipTabGlideIn 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ipTabGlideIn {
    0% {
        opacity: 0;
        transform: translateY(16px) scale(0.992);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tab-pane.is-active .section-hero {
    animation: ipHeroReveal 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ipHeroReveal {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-pane.is-active .kpi-card {
    animation: ipCardPopStagger 0.44s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tab-pane.is-active .kpi-card:nth-child(1) { animation-delay: 0.04s; }
.tab-pane.is-active .kpi-card:nth-child(2) { animation-delay: 0.09s; }
.tab-pane.is-active .kpi-card:nth-child(3) { animation-delay: 0.14s; }
.tab-pane.is-active .kpi-card:nth-child(4) { animation-delay: 0.19s; }

@keyframes ipCardPopStagger {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.kpi-card:hover .kpi-icon {
    transform: scale(1.12) rotate(-6deg);
}

.kpi-icon {
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kpi-value.is-tick {
    animation: ipNumPop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ipNumPop {
    0% { transform: scale(0.86); color: var(--brand-orange-500); }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Subtab Panel Fluid Transition */
.subtab-panel.is-active {
    animation: ipSubtabSlide 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ipSubtabSlide {
    0% {
        opacity: 0;
        transform: translateX(-14px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Sidebar Active Indicator and Icon Motion */
.nav-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 22%;
    bottom: 22%;
    width: 4px;
    border-radius: 4px 0 0 4px;
    background: #FFFFFF;
    transform: scaleY(0);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item.is-active::before {
    transform: scaleY(1);
}

.nav-item:hover i {
    transform: translateX(-3px) scale(1.1);
}

.nav-item i {
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}

/* Mobile Nav Icon Spring Bounce */
.mobile-nav-btn.is-active i {
    animation: ipMobileIconBounce 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ipMobileIconBounce {
    0% { transform: translateY(0) scale(0.85); }
    50% { transform: translateY(-4px) scale(1.18); }
    100% { transform: translateY(0) scale(1); }
}

/* Shortage Cards Staggered Entrance */
.shortage-card {
    animation: ipShortageEnter 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.shortage-card:nth-child(1) { animation-delay: 0.02s; }
.shortage-card:nth-child(2) { animation-delay: 0.06s; }
.shortage-card:nth-child(3) { animation-delay: 0.1s; }
.shortage-card:nth-child(4) { animation-delay: 0.14s; }
.shortage-card:nth-child(5) { animation-delay: 0.18s; }

@keyframes ipShortageEnter {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Admin Quick Cards Stagger & Icon Spring */
.admin-quick-card {
    animation: ipCardPopStagger 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.admin-quick-card:nth-child(1) { animation-delay: 0.06s; }
.admin-quick-card:nth-child(2) { animation-delay: 0.14s; }
.admin-quick-card:nth-child(3) { animation-delay: 0.22s; }

.admin-quick-icon {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.24s ease, color 0.24s ease;
}

.admin-quick-card:hover .admin-quick-icon {
    transform: scale(1.12) rotate(-6deg);
}

/* Table Row Hover Micro Lift */
.data-table tbody tr {
    transition: background-color 0.18s ease, transform 0.18s ease;
}

/* Filter Chip Spring Press */
.filter-chip {
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.filter-chip:active {
    transform: scale(0.95);
}

.filter-chip.is-active {
    box-shadow: 0 6px 14px rgba(14, 77, 100, 0.22);
}

.filter-chip.orange-active.is-active {
    box-shadow: 0 6px 16px rgba(232, 93, 26, 0.28);
}

/* Smooth Directional Portal Switcher Button */
.login-screen .login-footer-link {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(14, 77, 100, 0.14);
}

.portal-switch-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.68);
    border: 1.5px solid rgba(14, 77, 100, 0.16);
    color: var(--brand-navy-900);
    text-align: right;
    position: relative;
    overflow: hidden;
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
                background-color 0.24s ease,
                border-color 0.24s ease,
                box-shadow 0.24s ease;
}

.portal-switch-btn::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 45%;
    left: -60%;
    background: linear-gradient(105deg, transparent, rgba(232, 93, 26, 0.12), transparent);
    transform: skewX(-18deg);
    transition: left 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.portal-switch-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.96);
    border-color: var(--brand-orange-500);
    box-shadow: 0 10px 24px rgba(14, 77, 100, 0.12);
}

.portal-switch-btn:hover::after {
    left: 125%;
}

.portal-switch-btn:active {
    transform: scale(0.985);
}

.portal-switch-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--brand-navy-800), var(--brand-navy-900));
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: background 0.24s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.portal-switch-btn:hover .portal-switch-icon {
    background: linear-gradient(135deg, var(--brand-orange-500), var(--brand-orange-600));
    transform: scale(1.08) rotate(-6deg);
}

.portal-switch-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}

.portal-switch-text strong {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--brand-navy-900);
}

.portal-switch-text small {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-muted);
}

.portal-switch-arrow {
    margin-right: auto;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: rgba(14, 77, 100, 0.08);
    color: var(--brand-navy-800);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: transform 0.26s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, color 0.2s ease;
}

.portal-switch-btn:hover .portal-switch-arrow {
    transform: translateX(-5px);
    background: var(--brand-orange-100);
    color: var(--brand-orange-600);
}

.portal-switch-btn.is-return:hover .portal-switch-arrow {
    transform: translateX(5px);
}

/* Smooth Page Exit & Entry Choreography (Zero White Flash, Directional) */
.page-transition-veil {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    background: linear-gradient(145deg, #DCE6EE 0%, #E7EEF4 50%, #D4E1EB 100%);
    opacity: 0;
    transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.page-transition-veil.is-active {
    opacity: 1;
    pointer-events: auto;
}

body.is-page-leaving .login-card {
    transform: translateX(-32px) scale(0.97);
    opacity: 0;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

body.is-page-leaving-back .login-card {
    transform: translateX(32px) scale(0.97);
    opacity: 0;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

body.is-page-entering-forward .login-card {
    animation: ipPageEnterForward 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.is-page-entering-back .login-card {
    animation: ipPageEnterBack 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes ipPageEnterForward {
    0% {
        opacity: 0;
        transform: translateX(30px) scale(0.975);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes ipPageEnterBack {
    0% {
        opacity: 0;
        transform: translateX(-30px) scale(0.975);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Keep logo immediately settled when switching directly between login portals */
body.is-portal-switch .login-screen .ip-logo-mask-stroke {
    animation: none;
    stroke-dashoffset: 0;
}

body.is-portal-switch .login-screen .ip-logo-plus {
    animation: ipPlusBreathe 3.6s ease-in-out 0.6s infinite;
    opacity: 1;
}

body.is-portal-switch .login-screen .ip-logo-plus-ring {
    animation: none;
    opacity: 0;
}

body.is-portal-switch .login-screen .ip-logo-word-main,
body.is-portal-switch .login-screen .ip-logo-word-sub {
    animation: none;
    opacity: 1;
    transform: translateY(0);
}

body.is-portal-switch .login-screen .ip-logo-arc {
    animation: none;
    opacity: 1;
    transform: scaleX(1);
}

/* Smooth Shell Entrance Upon Login & Relaxed Tab Choreography */
.login-screen.is-unlocking {
    opacity: 0;
    transform: scale(1.03);
    pointer-events: none;
    transition: opacity 0.36s cubic-bezier(0.22, 1, 0.36, 1), transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.app-shell.is-entering .topbar {
    animation: ipTopbarDrop 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.app-shell.is-entering .sidebar {
    animation: ipSidebarSlideIn 0.52s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

@keyframes ipTopbarDrop {
    0% {
        opacity: 0;
        transform: translateY(-16px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ipSidebarSlideIn {
    0% {
        opacity: 0;
        transform: translateX(22px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Smooth Relaxed Stagger for Every Opened Tab */
.tab-pane.is-tab-animating .section-hero {
    animation: ipSmoothRevealDown 0.46s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tab-pane.is-tab-animating .kpi-card {
    animation: ipSmoothRevealUp 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tab-pane.is-tab-animating .kpi-card:nth-child(1) { animation-delay: 0.05s; }
.tab-pane.is-tab-animating .kpi-card:nth-child(2) { animation-delay: 0.1s; }
.tab-pane.is-tab-animating .kpi-card:nth-child(3) { animation-delay: 0.15s; }
.tab-pane.is-tab-animating .kpi-card:nth-child(4) { animation-delay: 0.2s; }

.tab-pane.is-tab-animating .subtabs-bar {
    animation: ipSmoothRevealUp 0.44s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.tab-pane.is-tab-animating .card,
.tab-pane.is-tab-animating .admin-quick-card {
    animation: ipSmoothRevealUp 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tab-pane.is-tab-animating .card:nth-of-type(1),
.tab-pane.is-tab-animating .admin-quick-card:nth-child(1) { animation-delay: 0.14s; }
.tab-pane.is-tab-animating .card:nth-of-type(2),
.tab-pane.is-tab-animating .admin-quick-card:nth-child(2) { animation-delay: 0.21s; }
.tab-pane.is-tab-animating .card:nth-of-type(3),
.tab-pane.is-tab-animating .admin-quick-card:nth-child(3) { animation-delay: 0.28s; }

@keyframes ipSmoothRevealDown {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.992);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ipSmoothRevealUp {
    0% {
        opacity: 0;
        transform: translateY(16px) scale(0.985);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* End of Motion Engine */
