/**
 * ==========================================================
 * Francherry Manager Portal
 * App Shell / Navigation Experience
 * Version: 1.0.0
 * ==========================================================
 */


/* ==========================================================
   1. VARIABLES
========================================================== */

:root {

    --fb-app-gold: #C89B3C;
    --fb-app-black: #111111;
    --fb-app-white: #FFFFFF;

    --fb-app-text: #222222;
    --fb-app-muted: #777777;

    --fb-app-soft: #F6F7F8;

    --fb-app-success: #287A4D;
    --fb-app-danger: #A23D3D;

}


/* ==========================================================
   2. PAGE ENTRY
========================================================== */

html.fb-app-ready body {

    opacity: 0;
}


body.fb-app-page-enter {

    opacity: 1 !important;

    transition:
        opacity 0.22s ease !important;
}


/* ==========================================================
   3. NAVIGATION STATE
========================================================== */

html.fb-app-is-navigating {

    cursor: progress !important;
}


html.fb-app-is-navigating body {

    overflow: hidden !important;
}


/* ==========================================================
   4. LOADING OVERLAY
========================================================== */

.fb-app-loader {

    position: fixed !important;

    inset: 0 !important;

    z-index: 1000000 !important;

    width: 100% !important;
    height: 100% !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    padding: 24px !important;

    background:
        rgba(
            246,
            247,
            248,
            0.96
        ) !important;

    backdrop-filter:
        blur(4px) !important;

    opacity: 0 !important;
    visibility: hidden !important;

    pointer-events: none !important;

    transition:
        opacity 0.18s ease,
        visibility 0.18s ease !important;
}


.fb-app-loader.is-visible {

    opacity: 1 !important;
    visibility: visible !important;

    pointer-events: auto !important;
}


/* ==========================================================
   5. LOADER CONTENT
========================================================== */

.fb-app-loader-inner {

    display: flex !important;

    flex-direction: column !important;

    align-items: center !important;
    justify-content: center !important;

    gap: 14px !important;

    text-align: center !important;
}


/* ==========================================================
   6. LOADER MARK
========================================================== */

.fb-app-loader-mark {

    position: relative !important;

    width: 58px !important;
    height: 58px !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    background:
        var(--fb-app-black) !important;

    border-radius:
        15px !important;

    box-shadow:
        0 12px 30px
        rgba(
            0,
            0,
            0,
            0.13
        ) !important;
}


/* ==========================================================
   7. LOADER SPINNER
========================================================== */

.fb-app-loader-spinner {

    width: 28px !important;
    height: 28px !important;

    border:
        3px solid
        rgba(
            255,
            255,
            255,
            0.18
        ) !important;

    border-top-color:
        var(--fb-app-gold) !important;

    border-radius:
        50% !important;

    animation:
        fb-app-spin
        0.75s
        linear
        infinite !important;
}


@keyframes fb-app-spin {

    to {

        transform:
            rotate(
                360deg
            );
    }

}


/* ==========================================================
   8. LOADER TEXT
========================================================== */

.fb-app-loader-copy {

    display: flex !important;

    flex-direction: column !important;

    align-items: center !important;

    gap: 2px !important;
}


.fb-app-loader-copy strong {

    color:
        var(--fb-app-text) !important;

    font-size:
        16px !important;

    font-weight:
        700 !important;

    line-height:
        1.2 !important;
}


.fb-app-loader-copy span {

    color:
        var(--fb-app-muted) !important;

    font-size:
        12px !important;

    font-weight:
        500 !important;

    line-height:
        1.3 !important;
}


/* ==========================================================
   9. OFFLINE / CONNECTION NOTICE
========================================================== */

.fb-app-connection-notice {

    position: fixed !important;

    left: 50% !important;

    bottom: 20px !important;

    z-index: 999998 !important;

    min-width: 150px !important;
    max-width: calc(100% - 30px) !important;

    min-height: 40px !important;

    padding:
        0
        14px !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    gap: 8px !important;

    background:
        var(--fb-app-black) !important;

    color:
        var(--fb-app-white) !important;

    border-radius:
        999px !important;

    box-shadow:
        0 10px 30px
        rgba(
            0,
            0,
            0,
            0.20
        ) !important;

    opacity: 0 !important;
    visibility: hidden !important;

    transform:
        translate(
            -50%,
            14px
        ) !important;

    transition:
        opacity 0.22s ease,
        visibility 0.22s ease,
        transform 0.22s ease !important;
}


/* ==========================================================
   10. CONNECTION NOTICE VISIBLE STATES
========================================================== */

.fb-app-connection-notice.is-offline,
.fb-app-connection-notice.is-online {

    opacity: 1 !important;
    visibility: visible !important;

    transform:
        translate(
            -50%,
            0
        ) !important;
}


/* ==========================================================
   11. CONNECTION DOT
========================================================== */

.fb-app-connection-dot {

    width: 8px !important;
    height: 8px !important;

    flex:
        0
        0
        8px !important;

    background:
        #C94C4C !important;

    border-radius:
        50% !important;
}


.fb-app-connection-notice.is-online
.fb-app-connection-dot {

    background:
        var(--fb-app-success) !important;
}


/* ==========================================================
   12. CONNECTION TEXT
========================================================== */

.fb-app-connection-text {

    font-size:
        12px !important;

    font-weight:
        600 !important;

    line-height:
        1 !important;
}


/* ==========================================================
   13. STANDALONE MODE
========================================================== */

html.fb-app-standalone {

    background:
        var(--fb-app-soft) !important;
}


html.fb-app-standalone body {

    overscroll-behavior-y:
        contain !important;
}


/* ==========================================================
   14. STANDALONE APP FEEL
========================================================== */

@media (display-mode: standalone) {

    body {

        -webkit-user-select:
            none;

        user-select:
            none;
    }


    input,
    textarea,
    select {

        -webkit-user-select:
            text;

        user-select:
            text;
    }


    a,
    button {

        -webkit-tap-highlight-color:
            transparent !important;
    }

}


/* ==========================================================
   15. MOBILE TOUCH FEEL
========================================================== */

@media (max-width: 900px) {

    a,
    button {

        -webkit-tap-highlight-color:
            rgba(
                200,
                155,
                60,
                0.12
            ) !important;
    }


    .fb-app-loader {

        padding:
            18px !important;
    }


    .fb-app-loader-mark {

        width:
            56px !important;

        height:
            56px !important;
    }


    .fb-app-loader-spinner {

        width:
            27px !important;

        height:
            27px !important;
    }


    .fb-app-loader-copy strong {

        font-size:
            15px !important;
    }


    .fb-app-loader-copy span {

        font-size:
            12px !important;
    }

}


/* ==========================================================
   16. SMALL MOBILE
========================================================== */

@media (max-width: 520px) {

    .fb-app-loader {

        backdrop-filter:
            blur(3px) !important;
    }


    .fb-app-loader-mark {

        width:
            52px !important;

        height:
            52px !important;

        border-radius:
            14px !important;
    }


    .fb-app-loader-spinner {

        width:
            25px !important;

        height:
            25px !important;

        border-width:
            3px !important;
    }


    .fb-app-loader-copy strong {

        font-size:
            15px !important;
    }


    .fb-app-loader-copy span {

        font-size:
            11px !important;
    }


    .fb-app-connection-notice {

        bottom:
            14px !important;

        min-width:
            140px !important;

        min-height:
            38px !important;

        padding:
            0
            12px !important;
    }


    .fb-app-connection-text {

        font-size:
            11px !important;
    }

}


/* ==========================================================
   17. REDUCED MOTION
========================================================== */

@media (prefers-reduced-motion: reduce) {

    body.fb-app-page-enter,
    .fb-app-loader,
    .fb-app-connection-notice {

        transition:
            none !important;
    }


    .fb-app-loader-spinner {

        animation-duration:
            1.5s !important;
    }

}

/* ==========================================================
   MANAGER HEADER SHORTCODE
   [fb_manager_header]
========================================================== */

.fb-manager-header {
    --fb-header-gold: #c48b00;
    --fb-header-text: #1d2433;
    --fb-header-muted: #626a76;
    width: 100%;
    min-height: 108px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 18px 20px;
    box-sizing: border-box;
    background: transparent;
    color: var(--fb-header-text);
}

.fb-manager-header__greeting {
    min-width: 0;
    flex: 1 1 auto;
}

.fb-manager-header__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: clamp(22px, 2.2vw, 29px);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: var(--fb-header-text);
}

.fb-manager-header__crown {
    flex: 0 0 auto;
    color: var(--fb-header-gold);
    font-size: 28px;
    line-height: 1;
    transform: translateY(-1px);
}

.fb-manager-header__subtitle {
    margin-top: 10px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--fb-header-text);
}

.fb-manager-header__account {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 23px;
}

.fb-manager-header__profile {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.fb-manager-header__avatar {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--fb-header-gold);
}

.fb-manager-header__avatar svg {
    width: 32px;
    height: 32px;
    display: block;
    fill: #fff;
}

.fb-manager-header__identity {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
}

.fb-manager-header__identity strong {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #111;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
}

.fb-manager-header__identity small {
    color: #6d6d6d;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3;
}

.fb-manager-header__notifications {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fb-manager-header__notifications .fb-bell {
    position: relative;
    width: 36px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fb-manager-header__notifications .fb-bell > i {
    color: #1f2631;
    font-size: 20px;
}

.fb-manager-header__notifications .fb-bell-count {
    position: absolute;
    top: 0;
    right: -2px;
    min-width: 21px;
    height: 21px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: 999px;
    background: var(--fb-header-gold);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

@media (max-width: 767px) {
    .fb-manager-header {
        min-height: auto;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 16px;
        padding: 16px 14px 18px;
    }

    /* Account becomes a clean full-width top row on mobile. */
    .fb-manager-header__account {
        order: 1;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .fb-manager-header__profile {
        min-width: 0;
        flex: 1 1 auto;
        gap: 10px;
    }

    .fb-manager-header__avatar {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
    }

    .fb-manager-header__avatar svg {
        width: 27px;
        height: 27px;
    }

    .fb-manager-header__identity {
        min-width: 0;
        display: flex;
    }

    .fb-manager-header__identity strong {
        max-width: min(180px, 48vw);
        font-size: 14px;
        line-height: 1.2;
    }

    .fb-manager-header__identity small {
        margin-top: 2px;
        font-size: 12px;
        line-height: 1.2;
    }

    .fb-manager-header__notifications {
        margin-left: auto;
    }

    .fb-manager-header__notifications .fb-bell {
        width: 36px;
        height: 40px;
    }

    /* Greeting sits below the account row and uses the full width. */
    .fb-manager-header__greeting {
        order: 2;
        width: 100%;
        min-width: 0;
    }

    .fb-manager-header__title {
        display: block;
        margin: 0;
        font-size: clamp(19px, 5.6vw, 23px);
        line-height: 1.2;
        letter-spacing: -0.02em;
    }

    .fb-manager-header__title > span:first-child,
    .fb-manager-header__crown {
        display: inline;
    }

    .fb-manager-header__crown {
        margin-left: 6px;
        font-size: 21px;
        line-height: inherit;
        vertical-align: 0.04em;
        transform: none;
    }

    .fb-manager-header__subtitle {
        margin-top: 7px;
        max-width: 100%;
        font-size: 13px;
        line-height: 1.45;
    }
}

@media (max-width: 390px) {
    .fb-manager-header {
        gap: 14px;
        padding: 14px 12px 16px;
    }

    .fb-manager-header__avatar {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .fb-manager-header__avatar svg {
        width: 25px;
        height: 25px;
    }

    /* Keep the user's identity visible even on narrow phones. */
    .fb-manager-header__identity {
        display: flex;
    }

    .fb-manager-header__identity strong {
        max-width: 150px;
        font-size: 13.5px;
    }

    .fb-manager-header__identity small {
        font-size: 11.5px;
    }

    .fb-manager-header__title {
        font-size: 19px;
    }

    .fb-manager-header__crown {
        font-size: 19px;
    }

    .fb-manager-header__subtitle {
        font-size: 12.5px;
    }
}