/* Footer: dark blue status bar, fixed to viewport bottom, full width, marquee ticker */
:root {
    --footer-bg: #19416a;
    --footer-height: 28px;
    --footer-marquee-duration: 85s;
}

.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-height);
    background: var(--footer-bg);
    color: #fff;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 0.7rem;
    z-index: 1040;
    display: flex;
    align-items: center;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.08);
}

/*
 * ERP shell: keep the status bar in the main content band — same horizontal offset as .page-wrapper —
 * so it does not cover the left sidebar (tree + module buttons). POS layouts (.pos-three) have no sidebar.
 */
.main-wrapper:not(.pos-three):not(.pos-home-layout-root) .app-footer {
    left: 252px;
    right: 0;
    width: auto;
}

@media (min-width: 992px) {
    body.mini-sidebar .main-wrapper:not(.pos-three):not(.pos-home-layout-root) .app-footer {
        left: 60px;
    }

    body.mini-sidebar.expand-menu .main-wrapper:not(.pos-three):not(.pos-home-layout-root) .app-footer {
        left: 260px;
    }
}

@media (max-width: 991.98px) {
    .main-wrapper:not(.pos-three):not(.pos-home-layout-root) .app-footer {
        left: 0;
        right: 0;
    }
}

.nosidebar .main-wrapper .app-footer {
    left: 0 !important;
    right: 0 !important;
}

/* RTL: sidebar on the right; mirror insets to match [data-direction=rtl] .page-wrapper */
[data-direction=rtl] body .main-wrapper:not(.pos-three):not(.pos-home-layout-root) .app-footer {
    left: 0;
    right: 260px;
}

@media (min-width: 992px) {
    [data-direction=rtl] body.mini-sidebar .main-wrapper:not(.pos-three):not(.pos-home-layout-root) .app-footer {
        right: 80px;
    }

    [data-direction=rtl] body.mini-sidebar.expand-menu .main-wrapper:not(.pos-three):not(.pos-home-layout-root) .app-footer {
        right: 260px;
    }
}

@media (max-width: 991.98px) {
    [data-direction=rtl] body .main-wrapper:not(.pos-three):not(.pos-home-layout-root) .app-footer {
        right: 0;
    }
}

.app-footer-marquee {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    -webkit-mask-image: linear-gradient(
        to right,
        transparent,
        #000 12px,
        #000 calc(100% - 12px),
        transparent
    );
    mask-image: linear-gradient(
        to right,
        transparent,
        #000 12px,
        #000 calc(100% - 12px),
        transparent
    );
}

.app-footer-marquee-track {
    display: inline-flex;
    flex-shrink: 0;
    white-space: nowrap;
    will-change: transform;
    animation: app-footer-marquee var(--footer-marquee-duration) linear infinite;
}

@keyframes app-footer-marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.app-footer-marquee-seg {
    flex-shrink: 0;
    padding: 0 0.6rem;
    line-height: 1.2;
}

@media (prefers-reduced-motion: reduce) {
    .app-footer-marquee {
        mask-image: none;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .app-footer-marquee-track {
        animation: none;
        will-change: auto;
    }
}

/* Working area: content area with same clean style */
.page-wrapper .content,
.page-wrapper .content .card {
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* Ensure page content doesn't hide behind footer */
.main-wrapper .page-wrapper {
    padding-bottom: var(--footer-height) !important;
}
