/* User topbar — company wordmark */
.ft-topbar {
    position: sticky;
    top: 0;
    z-index: 97;
    max-width: 540px;
    margin: 0 auto;
    padding: max(12px, env(safe-area-inset-top)) 16px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(180deg, rgba(232, 244, 220, 0.98) 0%, rgba(238, 248, 228, 0.94) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(40, 60, 20, 0.1);
}

.ft-topbar.has-more-back {
    justify-content: flex-start;
}

.ft-more-back {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #1a1a1a;
    color: #d4ff33;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
    transition: transform .15s, opacity .15s;
}
.ft-more-back i { font-size: 12px; }
.ft-more-back:hover {
    transform: translateY(-1px);
    opacity: .92;
    color: #d4ff33;
}

.ft-topbar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    max-width: 100%;
    flex: 1;
}

.ft-topbar.has-more-back .ft-topbar-brand {
    justify-content: flex-start;
}

.ft-topbar-name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--ft-navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}

.ft-topbar.has-more-back .ft-topbar-name {
    text-align: left;
}

/* Sidebar kept in CSS but unused while disabled from layout */
.ft-menu-toggle {
    display: none !important;
}

.ft-menu-toggle:hover {
    transform: translateY(-1px);
    box-shadow: var(--ft-shadow-lg);
    background: #fff;
}

.ft-menu-toggle.is-open {
    opacity: 0;
    pointer-events: none;
    transform: scale(.92);
}

.ft-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 10040;
    background: rgba(21, 42, 69, 0.52);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .28s ease;
    pointer-events: none;
}

.ft-sidebar-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.ft-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10045;
    width: min(300px, 88vw);
    transform: translateX(-105%);
    transition: transform .32s cubic-bezier(.22, 1, .36, 1);
    pointer-events: none;
}

.ft-sidebar.is-open {
    transform: translateX(0);
    pointer-events: auto;
}

.ft-sidebar__panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #1e3a5f 0%, #152a45 100%);
    color: #fff;
    box-shadow: 8px 0 40px rgba(21, 42, 69, 0.28);
    overflow: hidden;
}

.ft-sidebar__top {
    position: relative;
    padding: max(16px, env(safe-area-inset-top)) 18px 16px;
    background: linear-gradient(145deg, rgba(255, 140, 0, 0.14) 0%, transparent 55%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ft-sidebar__close {
    position: absolute;
    top: max(14px, env(safe-area-inset-top));
    right: 14px;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}

.ft-sidebar__close:hover {
    background: rgba(255, 255, 255, 0.16);
}

.ft-sidebar__user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 44px;
}

.ft-sidebar__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 179, 71, 0.55);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.ft-sidebar__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ft-sidebar__user-info {
    min-width: 0;
}

.ft-sidebar__username {
    display: block;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ft-sidebar__balance {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ft-primary-2);
}

.ft-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px 12px;
    -webkit-overflow-scrolling: touch;
}

.ft-sidebar__nav::-webkit-scrollbar {
    width: 4px;
}

.ft-sidebar__nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.ft-sidebar__section {
    margin: 12px 8px 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.ft-sidebar__section:first-child {
    margin-top: 4px;
}

.ft-sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    margin-bottom: 4px;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.ft-sidebar__link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.ft-sidebar__link.active {
    background: rgba(255, 140, 0, 0.16);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--ft-primary);
}

.ft-sidebar__ico {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    transition: background .2s ease, box-shadow .2s ease;
}

.ft-sidebar__link.active .ft-sidebar__ico {
    background: var(--ft-grad);
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.35);
}

.ft-sidebar__foot {
    padding: 12px 14px max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.12);
}

.ft-sidebar__logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #fecaca;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background .2s ease, color .2s ease;
}

.ft-sidebar__logout:hover {
    background: rgba(239, 68, 68, 0.24);
    color: #fff;
}

body.ft-sidebar-open {
    overflow: hidden;
}

/* FBR / SECP logo modal (shared) */
.bx-reg-modal {
    position: fixed;
    inset: 0;
    background: rgba(21, 42, 69, 0.55);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10060;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, visibility .25s;
    padding: 20px;
}

.bx-reg-modal.open {
    opacity: 1;
    visibility: visible;
}

.bx-reg-modal-card {
    background: #fff;
    border-radius: 14px;
    padding: 6px;
    width: 100%;
    max-width: 96vw;
    text-align: center;
    box-shadow: var(--ft-shadow-lg);
    position: relative;
    transform: scale(.92);
    transition: transform .25s;
}

.bx-reg-modal.open .bx-reg-modal-card {
    transform: scale(1);
}

.bx-reg-modal-close {
    position: absolute;
    top: -14px;
    right: -6px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--ft-navy);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.bx-reg-modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

.bx-reg-modal-badge,
.bx-reg-modal-title {
    display: none !important;
}

.bx-reg-modal-logo {
    background: transparent;
    border-radius: 14px;
    padding: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bx-reg-modal-img {
    width: 100%;
    max-width: 100%;
    max-height: 88vh;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 8px;
    image-rendering: -webkit-optimize-contrast;
}

@media (prefers-reduced-motion: reduce) {
    .ft-sidebar,
    .ft-sidebar-overlay,
    .ft-menu-toggle {
        transition-duration: .01ms !important;
    }
}
