#bis-auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(8px);
    color: #fff;
    font-family: var(--font-sans);
}

#bis-auth-overlay[hidden] {
    display: none;
}

#bis-auth-overlay .bis-auth-message {
    padding: 0.95rem 1.2rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.24);
    font-size: 0.95rem;
    font-weight: 700;
}

#bis-app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    background: rgba(248, 250, 252, 0.86);
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    backdrop-filter: blur(14px);
}

#bis-app-header .bis-auth-header-inner {
    width: min(1360px, calc(100% - 40px));
    margin: 0 auto;
    padding: 10px 0 8px;
    min-height: 62px;
    display: flex;
    align-items: center;
}

#bis-app-header .bis-auth-toprow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    min-height: 42px;
    margin-bottom: 0;
}

#bis-app-header .bis-auth-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
    flex: 1 1 auto;
}

#bis-app-header .bis-auth-context-link {
    min-width: 36px;
    height: 36px;
    padding: 0 0.78rem;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.92);
    color: #334155;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

#bis-app-header .bis-auth-context-link:hover {
    background: #fff;
    border-color: rgba(37, 99, 235, 0.24);
    color: #1d4ed8;
}

#bis-app-header .bis-auth-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7c3aed, #2563eb 58%, #14b8a6);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
    font-size: 0.95rem;
}

#bis-app-header .bis-auth-brand-copy {
    min-width: 0;
    flex: 1 1 auto;
}

#bis-app-header .bis-auth-brand-title {
    display: block;
    color: #0f172a;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#bis-app-header .bis-auth-brand-page {
    margin-top: 2px;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#bis-app-header .bis-auth-controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
    flex: 0 1 auto;
}

#bis-app-header .bis-auth-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dbeafe, #e0e7ff);
    color: #1d4ed8;
    font-size: 0.8rem;
    font-weight: 800;
}

#bis-app-header .bis-auth-user {
    display: flex;
    flex-direction: column;
    min-width: 0;
    text-align: right;
}

#bis-app-header .bis-auth-name,
#bis-app-header .bis-auth-email {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#bis-app-header .bis-auth-name {
    color: #0f172a;
    font-size: 0.86rem;
    font-weight: 700;
}

#bis-app-header .bis-auth-email {
    color: #64748b;
    font-size: 0.72rem;
}

#bis-app-header .bis-auth-logout {
    min-height: 38px;
    padding: 0.55rem 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 999px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

#bis-app-header .bis-auth-logout-icon {
    display: none;
    font-size: 0.86rem;
}

#bis-app-header .bis-auth-logout::before {
    display: none;
}

#bis-app-header .bis-auth-logout:hover {
    background: #f8fafc;
}

@media (max-width: 768px) {
    #bis-app-header .bis-auth-header-inner {
        width: calc(100% - 24px);
        padding: 8px 0;
        min-height: 56px;
    }

    #bis-app-header .bis-auth-toprow {
        gap: 0.75rem;
        min-height: 40px;
        margin-bottom: 0;
    }

    #bis-app-header .bis-auth-controls {
        justify-content: flex-end;
        gap: 0.55rem;
        max-width: none;
        flex: 0 0 auto;
    }

    #bis-app-header .bis-auth-context-link {
        width: 34px;
        min-width: 34px;
        height: 34px;
        flex: 0 0 34px;
        padding: 0;
    }

    #bis-app-header .bis-auth-context-label {
        display: none;
    }

    #bis-app-header .bis-auth-user {
        flex: 1;
        text-align: right;
    }

    #bis-app-header .bis-auth-name,
    #bis-app-header .bis-auth-email {
        max-width: 100%;
    }

    #bis-app-header .bis-auth-email {
        display: none;
    }

    #bis-app-header .bis-auth-logout {
        width: 34px;
        min-width: 34px;
        min-height: 34px;
        padding: 0;
        overflow: hidden;
        font-size: 0;
        line-height: 0;
    }

    #bis-app-header .bis-auth-logout::before {
        content: "\f2f5";
        display: inline-block;
        font-family: "Font Awesome 5 Free";
        font-size: 0.86rem;
        font-weight: 900;
        line-height: 1;
    }

    #bis-app-header .bis-auth-logout-icon,
    #bis-app-header .bis-auth-logout-label {
        display: none;
    }
}

@media (max-width: 480px) {
    #bis-app-header .bis-auth-header-inner {
        width: calc(100% - 20px);
        min-height: 56px;
    }

    #bis-app-header .bis-auth-toprow {
        gap: 0.55rem;
    }

    #bis-app-header .bis-auth-brand {
        gap: 0.6rem;
    }

    #bis-app-header .bis-auth-brand-mark,
    #bis-app-header .bis-auth-avatar,
    #bis-app-header .bis-auth-context-link {
        width: 34px;
        height: 34px;
    }

    #bis-app-header .bis-auth-brand-mark {
        border-radius: 12px;
        font-size: 0.82rem;
    }

    #bis-app-header .bis-auth-brand-title {
        font-size: 0.9rem;
    }

    #bis-app-header .bis-auth-brand-page {
        font-size: 0.66rem;
    }

    #bis-app-header .bis-auth-controls {
        gap: 0.45rem;
    }

    #bis-app-header .bis-auth-avatar {
        font-size: 0.72rem;
        flex: 0 0 34px;
    }

    #bis-app-header .bis-auth-user {
        display: none;
    }

    #bis-app-header .bis-auth-logout {
        width: 34px;
        min-width: 34px;
        min-height: 34px;
        padding: 0;
    }

}
