
:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --app-vh: 1vh;
    --viewport-bottom-offset: 0px;
    --header-height: 4rem;
    --bottom-nav-height: 5.3rem;
    --surface-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    min-height: calc(var(--app-vh, 1vh) * 100);
    overscroll-behavior-y: none;
}

body.app-shell {
    margin: 0;
    min-height: calc(var(--app-vh, 1vh) * 100);
}

img {
    max-width: 100%;
}

button,
a,
input,
select,
textarea,
[role="button"] {
    touch-action: manipulation;
}

button,
.touch-target,
.touch-target-inline,
.bottom-nav-link {
    min-height: 24px;
}

.touch-target,
.touch-target-inline {
    min-width: 44px;
}

.tap-gap > * + * {
    margin-left: 0.5rem;
}

.safe-top-pad {
    padding-top: var(--safe-top);
}

.safe-bottom-pad {
    padding-bottom: var(--safe-bottom);
}

.safe-bottom-inset {
    bottom: calc(1rem + var(--safe-bottom));
}

.safe-side-pad {
    padding-left: max(1rem, var(--safe-left));
    padding-right: max(1rem, var(--safe-right));
}

.mobile-page-shell {
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 1rem);
}

.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    border-top: 1px solid rgba(255, 231, 173, 0.28);
    border-radius: 0;
    background: linear-gradient(180deg, #d5a033 0%, #c9921e 100%);
    box-shadow: 0 -18px 36px rgba(18, 13, 8, 0.24);
    padding: 0 max(0.25rem, var(--safe-right)) var(--safe-bottom) max(0.25rem, var(--safe-left));
    animation: mobileBottomNavRise 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.bottom-nav-link {
    flex: 1 1 0;
    display: inline-flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border-radius: 0;
    padding: 0.7rem 0.35rem 0.6rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    text-decoration: none;
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease, opacity 180ms ease;
    border-right: 1px solid rgba(255, 240, 210, 0.2);
}

.bottom-nav-link:last-child {
    border-right: 0;
}

.bottom-nav-icon-shell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
}

.bottom-nav-link.is-active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.bottom-nav-link i,
.bottom-nav-link svg {
    width: 1.4rem;
    height: 1.4rem;
    flex-shrink: 0;
    stroke-width: 2.1;
}

.bottom-nav-link span{ 
    font-size: 12px !important;
    font-weight: 200;
    margin-top: -5px;
}
a.bottom-nav-link {
    gap: 0 !important;
}
.customer-mobile-contact {
    position: fixed;
    right: max(1rem, calc(var(--safe-right) + 1rem));
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 1rem);
    z-index: 78;
    display: none;
    align-items: flex-end;
    flex-direction: column;
    gap: 0.75rem;
}

.customer-mobile-contact-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.6rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(1rem) scale(0.92);
    transform-origin: bottom right;
    transition: opacity 220ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.customer-mobile-contact-link,
.customer-mobile-contact-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.35rem;
    height: 3.35rem;
    border-radius: 999px;
    color: #fff;
    box-shadow: 0 16px 28px rgba(18, 13, 8, 0.22);
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.customer-mobile-contact-trigger {
    border: 0;
    background: #c6942b;
    color: #1b1b1b;
    box-shadow: 0 0 0 4px #69adff, 0 14px 26px rgba(18, 13, 8, 0.28);
    animation: contactPulse 2.15s infinite;
}

.customer-mobile-contact.is-open .customer-mobile-contact-trigger {
    transform: rotate(12deg) scale(0.98);
    animation: none;
}

.customer-mobile-contact-link:hover,
.customer-mobile-contact-trigger:hover {
    transform: translateY(-1px);
}

.customer-mobile-contact.is-open .customer-mobile-contact-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.customer-mobile-contact-link {
    transform: translateY(0.5rem) scale(0.92);
    opacity: 0;
}

.customer-mobile-contact.is-open .customer-mobile-contact-link {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.customer-mobile-contact.is-open .customer-mobile-contact-link:nth-child(1) {
    transition-delay: 0ms;
}

.customer-mobile-contact.is-open .customer-mobile-contact-link:nth-child(2) {
    transition-delay: 45ms;
}

.customer-mobile-contact.is-open .customer-mobile-contact-link:nth-child(3) {
    transition-delay: 90ms;
}

.customer-mobile-contact-link.is-phone {
    background: linear-gradient(180deg, #2fb463 0%, #239852 100%);
}

.customer-mobile-contact-link.is-facebook {
    background: linear-gradient(180deg, #3b5998 0%, #27457f 100%);
}

.customer-mobile-contact-link.is-zalo {
    background: linear-gradient(180deg, #1790ff 0%, #0a76e8 100%);
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}

.customer-mobile-contact-link-text {
    line-height: 1;
}

@keyframes contactPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(105, 173, 255, 0.48), 0 14px 26px rgba(18, 13, 8, 0.28);
    }

    70% {
        box-shadow: 0 0 0 14px rgba(105, 173, 255, 0), 0 14px 26px rgba(18, 13, 8, 0.2);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(105, 173, 255, 0), 0 14px 26px rgba(18, 13, 8, 0.28);
    }
}

@keyframes mobileBottomNavRise {
    from {
        opacity: 0;
        transform: translateY(1.25rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shell-scroll {
    overflow-x: hidden;
}

.responsive-card-table {
    display: none;
}

.responsive-table-shell {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.responsive-table-shell table {
    min-width: 100%;
}

.sticky-action-footer {
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding-bottom: calc(1rem + var(--safe-bottom));
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.94) 24%, rgba(255,255,255,1) 100%);
    backdrop-filter: blur(10px);
}

.app-surface {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(226, 232, 240, 0.92);
    box-shadow: var(--surface-shadow);
}

.compact-title {
    letter-spacing: -0.02em;
}

@media (max-width: 1023px) {
    body.operations,
    body.admin-shell-body {
        min-height: calc(var(--app-vh, 1vh) * 100);
    }

    .op-sidebar,
    .admin-sidebar {
        padding-top: var(--safe-top);
        padding-bottom: var(--safe-bottom);
    }

    .op-content-shell,
    .admin-content-shell {
        padding-bottom: calc(var(--safe-bottom) + var(--viewport-bottom-offset) + 0.75rem);
    }
}

@media (max-width: 767px) {
    :root {
        --header-height: 4rem;
        --bottom-nav-height: 5rem;
    }

    .mobile-bottom-nav {
        display: flex;
    }

    .customer-mobile-contact {
        display: flex;
    }

    .bottom-nav-link {
        gap: 0.2rem;
        padding: 0.55rem 0.25rem 0.5rem;
        font-size: 0.51rem;
        min-height: calc(var(--bottom-nav-height) - 0.4rem);
    }

    .bottom-nav-link i,
    .bottom-nav-link svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    .customer-shell header.fixed {
        padding-top: var(--safe-top);
    }

    .customer-shell main {
        /*padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 1.25rem);*/
        padding-bottom:0;
    }

    .customer-shell footer {
        padding-bottom: calc(2rem + var(--safe-bottom) + var(--bottom-nav-height));
    }

    .responsive-table-shell[data-mobile-cards="true"] {
        overflow: visible;
    }

    .responsive-table-shell[data-mobile-cards="true"] table {
        display: none;
    }

    .responsive-card-table {
        display: grid;
        gap: 0.85rem;
    }
}

@media (max-width: 767px) {
    .mobile-bottom-nav {
        display: flex
    ;
        max-height: 49px;
    }
}
@media (max-width: 767px) {
    .customer-mobile-contact {
        bottom: 160px;
    }
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
